• Resolved jstead

    (@jstead)


    We are looking to customise some of the inline notification strings.

    For example:
    You must enroll in this course to access course content. and The lesson “%1$s” cannot be accessed until the required prerequisite “%2$s” is completed..

    Where can I customise this content?

    Thanks,
    Jason

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • @jstead,

    Almost any strings coded into the LifterLMS codebase can be customized by using translation.

    You can follow this guide which uses LocoTranslate (free plugin) to translate this kind of thing: https://lifterlms.com/docs/how-do-i-customize-the-text-of-lifterlms-buttons-and-more/

    Hope that helps,

    Thread Starter jstead

    (@jstead)

    Thank you @thomasplevy,

    We have the translation process working using WPML already, but we are looking to change the source English message prior to sending it to translation. Can we change this anywhere?

    Thanks,
    Jason

    @jstead,

    The way translation works in WordPress is that we (the developers) hard code the translatable strings in our native language and then translators translate them using raw PO/MO translation files or plugins like Loco (which give you an interface in WordPress for creating a PO/MO from the source.

    So, no, not really. The way to translate the source before translating it would be that I’d need to write the whole plugin in *your* native language. I like you (and all my customers) but I’m fluent in several programming languages and English (I’m working on Spanish) but I’m not going to be able to provide multiple pre-translated codebases.

    Translation is the way to go and while it is a bit inconvenient I really can’t provide you with any other solutions.

    Sorry,

    Thread Starter jstead

    (@jstead)

    Ok, makes sense. Just wasn’t sure if there was a field to edit it in the source language. I found the first phrase You must enroll in this course to access course content under Course > Restrictions for instance.

    Can the section of code that generates the phraseThe lesson “%1$s” cannot be accessed until the required prerequisite “%2$s” is completed.. for instance be overwritten with a template file like some of the other items?

    I want to test my own conditional loop based on how many lessons are “skipped” during prerequisites, so that

    • The lesson “Lesson 3” cannot be accessed until the required prerequisite “Lesson 2” is completed
    • The lesson “Lesson 2” cannot be accessed until the required prerequisite “Lesson 1” is completed

    maybe becomes

    The Lesson “Lesson 3” connect be accessed until the required prerequisites “Lesson 2” and “Lesson 1” are completed.

    Thanks,
    Jason

    @jstead,

    What you actually want to do here is filter the output on the error messages output by prerequisite restrictions.

    The reason we don’t already do this is that this error message could get *really massive*

    Imagine the error message for lesson #25 if each lesson has the preceeding lesson as the preq…

    In any event, if you want to pursue this you’ll want to look into using the filters found in this function: https://github.com/gocodebox/lifterlms/blob/master/includes/class.llms.template.loader.php#L210-L231

    Hope that helps you move in the right direction and let me know if you have any other questions!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Built in string editing.’ is closed to new replies.