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

Add ability to pass variables for the identifier and component in the string mustache helper

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • 2.9.6, 3.1
    • HTML and CSS

      Currently if I try -

      {{#str}}{{country}}, countries{{/str}}

      It fails because we are literally passing

      {{country}}

      to get_string() which then gets cleaned and ends up with get_string() throwing an exception about an empty identifier. In my use case I get a user record from the DB and want to translate the country, so 'AU' becomes 'Australia'. We currently do this in lib/myprofilelib.php by doing get_string($user->country, 'countries'). This will not work in templates.

            Unassigned Unassigned
            markn Mark Nelson
            Ryan Wyllie Ryan Wyllie
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.