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

Pass formatted site name to Moodle App to allow for translations

XMLWordPrintable

    • Any
    • MOODLE_36_STABLE, MOODLE_37_STABLE
    • MOODLE_36_STABLE, MOODLE_37_STABLE
    • MDL-65893-master
    • Easy
    • Hide
      1. Enable the multilang filter for both content and headings
      2. Install both French and English language packs via 'language packs' admin setting.
      3. Set 'full site name' (fullname) admin setting to the following:

        <span class="multilang" lang="en">English site name</span><span class="multilang" lang="fr">French site name</span>
        

      4. Enable web services via Admin -> Plugins -> Web services
        • Make sure REST is enabled
        • Create a token for the mobile web service for the admin user and copy it somewhere
      5. Set your preferred language to 'English'. (User preferences -> preferred language)
      6. Now, run the following command: (replacing sitename and token)

        curl 'http://YOURSITE/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_webservice_get_site_info&wstoken=TOKEN&moodlewssettingfilter=true' | python -m "json.tool"
        

      7. Verify you see the string 'English site name' coming back in the results.
      8. Set your preferred language to 'French'. (User preferences -> preferred language)
      9. Now, run the following command: (replacing sitename and token)

        curl 'http://YOURSITE/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_webservice_get_site_info&wstoken=TOKEN&moodlewssettingfilter=true' | python -m "json.tool"
        

      10. Verify you see the string 'French site name' coming back in the results.
      Show
      Enable the multilang filter for both content and headings Install both French and English language packs via 'language packs' admin setting. Set 'full site name' (fullname) admin setting to the following: <span class="multilang" lang="en">English site name</span><span class="multilang" lang="fr">French site name</span> Enable web services via Admin -> Plugins -> Web services Make sure REST is enabled Create a token for the mobile web service for the admin user and copy it somewhere Set your preferred language to 'English'. (User preferences -> preferred language) Now, run the following command: (replacing sitename and token) curl 'http://YOURSITE/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_webservice_get_site_info&wstoken=TOKEN&moodlewssettingfilter=true' | python -m "json.tool" Verify you see the string 'English site name' coming back in the results. Set your preferred language to 'French'. (User preferences -> preferred language) Now, run the following command: (replacing sitename and token) curl 'http://YOURSITE/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_webservice_get_site_info&wstoken=TOKEN&moodlewssettingfilter=true' | python -m "json.tool" Verify you see the string 'French site name' coming back in the results.

      The Moodle App shows language tags in curly braces when the site name has these. The fix is to format the string on server side before it is sent to the app. Then the Moodle App shows the localised site name as intended.

            nicoroeser Nico Roeser
            nicoroeser Nico Roeser
            Juan Leyva Juan Leyva
            Jake Dallimore Jake Dallimore
            Anna Carissa Sadia Anna Carissa Sadia
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 40 minutes
                2h 40m

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