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

Pass formatted site name to Moodle App to allow for translations

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.6, 3.7
    • Fix Version/s: 3.6.5, 3.7.1
    • Component/s: Web Services
    • Labels:
    • Database:
      Any
    • Testing Instructions:
      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.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE
    • Pull 3.6 Branch:
    • Pull 3.7 Branch:
    • Pull Master Branch:
      MDL-65893-master

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                nicoroeser Nico Roeser
                Reporter:
                nicoroeser Nico Roeser
                Peer reviewer:
                Juan Leyva
                Integrator:
                Jake Dallimore
                Tester:
                Anna Carissa Sadia
                Participants:
                Component watchers:
                Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  8/Jul/19

                  Time Tracking

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