Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-76228

Allow language strings to reference other language strings similar to a mustache partial

    XMLWordPrintable

Details

    • New Feature
    • Resolution: Won't Fix
    • Minor
    • None
    • Future Dev
    • Language

    Description

      We have a common requirement with clients to customize the language because they want to use the word Unit vs Course or other similar things. This is the motivation behind MDL-70415 and MDL-32098. It would be much easier if you could do these kinds of things in a single place.

      I would propose we also allow string references similar to mustache partials and it could even use the same syntax for simplicity:

      $string['moodle'] = 'Moodle';
      $string['intro'] = '{{> moodle}} is an open source LMS';
      

      We may need to introduce either helpers for managing case, or have 2 strings for sentence case or lowercase.

      There could also be similar support for to mustache for passing vars down into the other string. The exact syntax doesn't matter and we could find something that doesn't clash with all the existing strings.

      Any concerns around recursive references should be easy to resolve it would just put and ERROR into the output string so its clear to the translator or admin to go fix it. It would also emit a debugging warning.

      Attachments

        Issue Links

          Activity

            People

              dobedobedoh Andrew Lyons
              brendanheywood Brendan Heywood
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: