Moodle Community Sites
  1. Moodle Community Sites
  2. MDLSITE-1296

Moodle Docs links need to be fixed to handle language derivatives (i.e. en_us, fr_ca, etc.)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Component/s: docs.moodle.org
    • Labels:
      None

      Description

      The document links are using current_language() producing links like:

      http://docs.moodle.org/en_us/question/import (which end up redirecting to the main page)

      Is current_language() really what we want/intend? Would it make more sense to use something like get_parent_language to return en instead of en_us? If Moodle Docs is going to support child languages like en_us, then we need to ensure that pages are correctly redirecting.

      This came up at the Oklahoma Moot and created a little confusion. I would have expected to be directed to:

      http://docs.moodle.org/en/question/import

      Do we want the link generated to be en or en_us? If it is en_us, then Docs should redirect automatically to en version if the page does not exist (which may make creating the page more complicated).

      Peace - Anthony

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Aparup Banerjee added a comment -

            Hi Anthony,
            Thanks for the report. I had a chat with Jordan, he did think that en_us urls should map to en urls.

            Guys, do we do this in docs or in moodle?

            imo, its pretty docs.moodle.org specific. i suppose anyone implementing their own docs (ou) could handle mapping how they like if we left the mapping to the doc server.

            cheers,
            Aparup

            Show
            Aparup Banerjee added a comment - Hi Anthony, Thanks for the report. I had a chat with Jordan, he did think that en_us urls should map to en urls. Guys, do we do this in docs or in moodle? imo, its pretty docs.moodle.org specific. i suppose anyone implementing their own docs (ou) could handle mapping how they like if we left the mapping to the doc server. cheers, Aparup
            Hide
            Jordan Tomkinson added a comment -

            Added language aliases for en_us es_es, es_mx, es_ar, es_cb, fr_ca, no_gr, zh_cn, zh_tw

            If you can think of any more please let me know

            Show
            Jordan Tomkinson added a comment - Added language aliases for en_us es_es, es_mx, es_ar, es_cb, fr_ca, no_gr, zh_cn, zh_tw If you can think of any more please let me know
            Hide
            Martin Dougiamas added a comment -

            +1 for server redirects

            Show
            Martin Dougiamas added a comment - +1 for server redirects
            Hide
            Anthony Borrow added a comment -

            Jordan - I am re-opening this as it does not seem to be working for all pages. I see that it works for the one page but not for all - for example:

            http://docs.moodle.org/20/en_us/admin/user/profile/index is going back to main page rather than
            http://docs.moodle.org/20/en/admin/user/profile/index
            which is what I would expect.

            Peace - Anthony

            Show
            Anthony Borrow added a comment - Jordan - I am re-opening this as it does not seem to be working for all pages. I see that it works for the one page but not for all - for example: http://docs.moodle.org/20/en_us/admin/user/profile/index is going back to main page rather than http://docs.moodle.org/20/en/admin/user/profile/index which is what I would expect. Peace - Anthony
            Hide
            Jordan Tomkinson added a comment -

            updated rule to include version specific docs

            Show
            Jordan Tomkinson added a comment - updated rule to include version specific docs
            Hide
            Anthony Borrow added a comment -

            Looks good, thanks Jordan! Peace - Anthony

            Show
            Anthony Borrow added a comment - Looks good, thanks Jordan! Peace - Anthony
            Hide
            Helen Foster added a comment -

            Reopening following comment from Mike Algozzine in http://moodle.org/mod/forum/discuss.php?d=176065

            We just noticed that docs.moodle.org/19/en_us links are redirecting to docs.moodle.org/20/en links. Shouldn't they redirect to docs.moodle.org/19/en instead?

            Show
            Helen Foster added a comment - Reopening following comment from Mike Algozzine in http://moodle.org/mod/forum/discuss.php?d=176065 We just noticed that docs.moodle.org/19/en_us links are redirecting to docs.moodle.org/20/en links. Shouldn't they redirect to docs.moodle.org/19/en instead?
            Hide
            Jordan Tomkinson added a comment -

            Helen this is the expected behaviour and is being discussed at MDLSITE-1312.

            Show
            Jordan Tomkinson added a comment - Helen this is the expected behaviour and is being discussed at MDLSITE-1312 .
            Hide
            Mike Algozzine added a comment -

            MDLSITE-1312 indicates that it's not possible to redirect based on whether or not the target page exists, but I don't think that sort of redirection is necessary. I'm suggesting that a docs.moodle.org/19/en_us link should always redirect to the corresponding docs.moodle.org/19/en link, regardless of whether or not the page exists. Just to clarify our scenario:

            1. Moodle 1.9.8 user changes their preferred language to English (en_us).
            2. Moodle 1.9.8 user clicks a "Moodle Docs for this page" link, such as http://docs.moodle.org/19/en_us/course/view.
            3. Moodle 1.9.8 user is redirected to http://docs.moodle.org/20/en/course/view, even though http://docs.moodle.org/19/en/course/view exists and is clearly more relevant.

            The consensus among our users is that this is not the expected behavior.

            Show
            Mike Algozzine added a comment - MDLSITE-1312 indicates that it's not possible to redirect based on whether or not the target page exists, but I don't think that sort of redirection is necessary. I'm suggesting that a docs.moodle.org/19/en_us link should always redirect to the corresponding docs.moodle.org/19/en link, regardless of whether or not the page exists. Just to clarify our scenario: 1. Moodle 1.9.8 user changes their preferred language to English (en_us). 2. Moodle 1.9.8 user clicks a "Moodle Docs for this page" link, such as http://docs.moodle.org/19/en_us/course/view . 3. Moodle 1.9.8 user is redirected to http://docs.moodle.org/20/en/course/view , even though http://docs.moodle.org/19/en/course/view exists and is clearly more relevant. The consensus among our users is that this is not the expected behavior.
            Hide
            Jordan Tomkinson added a comment -

            You are completely correct - not sure what I was thinking previously (maybe I was confused)

            I have updated the htaccess rules if you could test, thanks.

            Show
            Jordan Tomkinson added a comment - You are completely correct - not sure what I was thinking previously (maybe I was confused) I have updated the htaccess rules if you could test, thanks.
            Hide
            Mike Algozzine added a comment -

            It's working correctly for us now. The docs.moodle.org/19/en_us links are redirecting to docs.moodle.org/19/en. Thanks very much.

            Show
            Mike Algozzine added a comment - It's working correctly for us now. The docs.moodle.org/19/en_us links are redirecting to docs.moodle.org/19/en. Thanks very much.
            Hide
            Helen Foster added a comment -

            Mike, glad to hear things are now working correctly. Thanks for your feedback and thanks to Jordan for fixing the problem

            Show
            Helen Foster added a comment - Mike, glad to hear things are now working correctly. Thanks for your feedback and thanks to Jordan for fixing the problem

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Development