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

Shorten langstring identifiers

XMLWordPrintable

    • MOODLE_401_STABLE
    • MOODLE_401_STABLE
    • MDL-76331-master
    • Hide
      1. Login as admin
      2. Navigate to site admin -> Plugins -> Text editors -> Manage text editors
      3. Ensure that TinyMCE is enabled and at the top of the list
      4. Navigate to a forum
      5. Create a new forum discussion
      6. From the "Insert" menu, choose "Link"
      7. Enter an e-mail address (moodle@example.com)
      8. Press Save
        1. Confirm that you are shown a message:

          The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?

      9. Press No to close the dialogue
      10. Navigate to Site admin -> Language -> Language customisation
      11. Open the English language for editing
      12. Find the editor_tiny string whose strings contain: "The URL you entered seems to be an email address"
      13. Update the first string to "Foo bar baz?"
      14. Navigate back to the Forum
      15. Add the link again and enter an e-mail address
        1. Confirm that you get your "Foo bar baz?" string as confirmation
      Show
      Login as admin Navigate to site admin -> Plugins -> Text editors -> Manage text editors Ensure that TinyMCE is enabled and at the top of the list Navigate to a forum Create a new forum discussion From the "Insert" menu, choose "Link" Enter an e-mail address (moodle@example.com) Press Save Confirm that you are shown a message : The URL you entered seems to be an email address. Do you want to add the required mailto: prefix? Press No to close the dialogue Navigate to Site admin -> Language -> Language customisation Open the English language for editing Find the editor_tiny string whose strings contain: "The URL you entered seems to be an email address" Update the first string to "Foo bar baz?" Navigate back to the Forum Add the link again and enter an e-mail address Confirm that you get your "Foo bar baz?" string as confirmation

      Apparently AMOS gets upset if the langstring identifier is >= 100chars. This is an undocumented restriction so I wasn't aware of it.

      Just need to modify the interim strings to keep them under the limit.

      Because of the way in which we translate TinyMCE strings, this is a very limited change. To explain:

      • TinyMCE uses English language strings for the entire UI
      • each translation provides a mapping of the English string to a translated equivalent, for example "Bold" may be mapped to "Embolden" by creating a JS Object containing {{ {"Bold": "Embolden"}

        }}

      • we generate our langstrings by using a mapping in tinystrings.json which contains the langstring identifier => English language string. In our lang.php processor we then generate a JS object containing the English language string => translated string with the Moodle language identifier as an intermediary like a DB join
      • Because both tinystrings.json and the lang/en/editor_tiny.php content are generated at the same time using the same data, they should always match

      This should have minimal impact upon AMOS because only seven langstrings are modified, and all were over the 100 character limit so could not be imported into AMOS in the first place.

            dobedobedoh Andrew Lyons
            dobedobedoh Andrew Lyons
            Stevani Andolo Stevani Andolo
            Paul Holden Paul Holden
            John Edward Pedregosa John Edward Pedregosa
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 days, 3 hours, 50 minutes
                3d 3h 50m

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