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

Web Service language handling improvements for the mobile app

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.5
    • 3.3.2
    • Web Services
    • MOODLE_33_STABLE
    • MOODLE_35_STABLE
    • MDL-60736-master
    • Hide

      TESTING WS SERVER CHANGES

      1. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      2. Install two additional language packs in your site via Site administration > Language > Language packs
      3. Set English as Default language in Site administration > Language > Language settings
      4. Create or use an existing user in the platform (no admin) setting his language to English via User preferences > Preferred language
      5. Create a Token in the mobile app service for the student user:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      6. In your browser, open the following url (use your user token and your site URL): http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_webservice_get_site_info&wstoken=12a2a65aeea2a177055e233f9e303218
      7. Check that in the JSON response you see a field “lang” set to “en” (English language)
      8. Now, change the Default language via Site administration > Language > Language packs to other language different than english
      9. Open again the URL and you will still see lang set to en (English language) because is the user language profile
      10. Now, change the user preferred language via User preferences > Preferred language to a different language than English and the Site language
      11. Open again the Url and check that this time lang is set to the language used in the User preferences
      12. Append the following to the URL &moodlewssettinglang=en, an open it again, you will see now that the language is set to English
      13. If you change the value of moodlewssettinglang to any installed language code and open the URL, the lang field must always set to that language

      TESTING WEB SERVICE

      1. As admin go to Site administration > Language > Language settings
      2. Change the following settings: autolang, lang, langmenu, langlist and locale
      3. Open in your browser the following URL (using the previous token and your site URL): http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=tool_mobile_get_public_config&wstoken=12a2a65aeea2a177055e233f9e303218
      4. Check that the returned values for the fields autolang, lang, langmenu, langlist and locale matches the one in the web interface (for checkboxes it will be a 1 when the checkbox is ticked)
      Show
      TESTING WS SERVER CHANGES As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings Install two additional language packs in your site via Site administration > Language > Language packs Set English as Default language in Site administration > Language > Language settings Create or use an existing user in the platform (no admin) setting his language to English via User preferences > Preferred language Create a Token in the mobile app service for the student user: Click on Site administration ► Plugins ► Web services ► Manage tokens In your browser, open the following url (use your user token and your site URL): http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_webservice_get_site_info&wstoken=12a2a65aeea2a177055e233f9e303218 Check that in the JSON response you see a field “lang” set to “en” (English language) Now, change the Default language via Site administration > Language > Language packs to other language different than english Open again the URL and you will still see lang set to en (English language) because is the user language profile Now, change the user preferred language via User preferences > Preferred language to a different language than English and the Site language Open again the Url and check that this time lang is set to the language used in the User preferences Append the following to the URL &moodlewssettinglang=en, an open it again, you will see now that the language is set to English If you change the value of moodlewssettinglang to any installed language code and open the URL, the lang field must always set to that language TESTING WEB SERVICE As admin go to Site administration > Language > Language settings Change the following settings: autolang, lang, langmenu, langlist and locale Open in your browser the following URL (using the previous token and your site URL): http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=tool_mobile_get_public_config&wstoken=12a2a65aeea2a177055e233f9e303218 Check that the returned values for the fields autolang, lang, langmenu, langlist and locale matches the one in the web interface (for checkboxes it will be a 1 when the checkbox is ticked)

      The mobile app needs to be consistent with Moodle Web language handling so we'd need to do a few changes:

      Add a new WS "moodlewssetting": moodlewssettinglang to allow to set a session language for the WS request.

      Return langsettings information in tool_mobile_get_public_data (autolang, lang, langmenu, langlist, locale) so we know since the beginning which language to use.

            jleyva Juan Leyva
            jleyva Juan Leyva
            Carlos Escobedo Carlos Escobedo
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            David Mudrák (@mudrd8mz) David Mudrák (@mudrd8mz)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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