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

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



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


      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.


        Issue Links



              dobedobedoh Andrew Lyons
              brendanheywood Brendan Heywood
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              0 Vote for this issue
              4 Start watching this issue