Moodle
  1. Moodle
  2. MDL-37035

The LTI consumer does not pass the user's locale if the course locale is not enforced

    Details

    • Testing Instructions:
      Hide

      1. Setup a Moodle space with no enforced locale.
      2. Enrol a user in that space, with es as their locale
      3. Add an external tool to the space
      4. Login as the Spanish user and click on the tool

      What should happen is that the tool should show up in Spanish.

      Show
      1. Setup a Moodle space with no enforced locale. 2. Enrol a user in that space, with es as their locale 3. Add an external tool to the space 4. Login as the Spanish user and click on the tool What should happen is that the tool should show up in Spanish.
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull Master Branch:
    • Rank:
      46575

      Description

      The LTI consumer does not pass the user's locale if the course locale is not enforced. Currently, the course locale is passed if set, and, if not, the default system locale is set instead.

        Activity

        Hide
        Michael de Raadt added a comment -

        Thanks for reporting that and providing a fix.

        Chris: It would be great if you could peer review this and push to integration.

        Show
        Michael de Raadt added a comment - Thanks for reporting that and providing a fix. Chris: It would be great if you could peer review this and push to integration.
        Hide
        Mark Nielsen added a comment -

        Hi Adrian, I believe that current_language() is a better way to get the current language.

        Show
        Mark Nielsen added a comment - Hi Adrian, I believe that current_language() is a better way to get the current language.
        Hide
        Adrian Fish added a comment -

        Agreed. I didn't know that existed, so thanks for the pointer. I'm very new to Moodle coding

        Show
        Adrian Fish added a comment - Agreed. I didn't know that existed, so thanks for the pointer. I'm very new to Moodle coding
        Hide
        Adrian Fish added a comment -

        I've updated my branch, same details as before.

        Show
        Adrian Fish added a comment - I've updated my branch, same details as before.
        Hide
        Mark Nielsen added a comment -

        This looks good to me, just cannot push it past peer review.

        Show
        Mark Nielsen added a comment - This looks good to me, just cannot push it past peer review.
        Hide
        Sam Hemelryk added a comment -

        Thanks Adrian, this has been integrated now.

        Show
        Sam Hemelryk added a comment - Thanks Adrian, this has been integrated now.
        Hide
        Adrian Fish added a comment -

        No worries. Not exactly a substantial change

        Show
        Adrian Fish added a comment - No worries. Not exactly a substantial change
        Hide
        Jason Fowler added a comment -

        I've tested this with the LTI mentioned in the Moodle QA for LTI, and it would seem that the locale only matters if the LTI supports locales too, as the tool detailed in the QA test does not change language. I've tested this in Spanish and French, and the LTI does not change language. It does not cause any errors however, so I am passing this. If any further work is required, the issue may be re-opened.

        Show
        Jason Fowler added a comment - I've tested this with the LTI mentioned in the Moodle QA for LTI, and it would seem that the locale only matters if the LTI supports locales too, as the tool detailed in the QA test does not change language. I've tested this in Spanish and French, and the LTI does not change language. It does not cause any errors however, so I am passing this. If any further work is required, the issue may be re-opened.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Changes are now upstream, thanks for your collaboration!

        If you are going to have any celebration next days, enjoy with your gang, if not, too!

        Ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Changes are now upstream, thanks for your collaboration! If you are going to have any celebration next days, enjoy with your gang, if not, too! Ciao

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: