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

Add text direction to default ATTO generated markup

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Test #1

      1. Make sure you are using Atto editor (User's preferences) and that you are using the English UI language.
      2. Go the Atto toolbar settings (Site administration ► Plugins ► Text editors ► Atto HTML editor ► Atto toolbar settings) and add ",rtl" to the align section. when finished, it should look like "align = align,rtl". save new settings.
      3. Navigate into a page where you can use the HTML editor (You can start a Discussion on a Forum or Edit your own user's description on your profile page)
      4. Type into the Atto editor a few words and press the <enter> key.
      5. Switch to HTML mode (use the "<>" icon on the Atto's second/hidden toolbar)
      6. Make sure you see HTML P elements with dir=ltr and style=text-align:left; attributes surrounding your text.
      7. Switch language to any RTL language (Hebrew, Arabic, ... )
      8. Reload the page (or click "Cancel" to discard "auto save draft" content and start fresh)
      9. Type into the Atto editor a few words and press the <enter> key.
      10. Switch to HTML mode (use the "<>" icon on the Atto's second/hidden toolbar)
      11. Make sure you see HTML P elements with dir=rtl and style=text-align:right; attributes surrounding your text.

      Test #2

      1. Go to Site administration ► Plugins ► Authentication ► Manage authentication
      2. Select your language as hebrew
      3. Copy the following text into the atto editor on the page, this will go to "auth_instructions" or הוראות

        הבעירה. הטמפרטורה של האש נעה על פני טווח רחב, החל מעשרות מעלות ועד אלפי מעלות.

      4. Save
      5. Logout and click login.
      6. You should see a period at the end of the hebrew sentence (which is on the far left, since hebrew is read right to left.) This means that the direction was automatically chosen correctly.
      7. Login as admin and go back to Manage authentication
      8. In english, add a test sentence with punctuation

        Hello! Welcome to this site!

      9. Log out and click login
      10. Change the language of the site to hebrew
      11. The punctuation should still be in the correct spot
      12. Login as admin and go back to Manage authentication
      13. Delete all the text (ctrl+a)
      14. Logout and click login
      15. Make sure the "Is this your first time?" text is no longer there
      Show
      Test #1 Make sure you are using Atto editor (User's preferences) and that you are using the English UI language. Go the Atto toolbar settings (Site administration ► Plugins ► Text editors ► Atto HTML editor ► Atto toolbar settings) and add ",rtl" to the align section. when finished, it should look like "align = align,rtl". save new settings. Navigate into a page where you can use the HTML editor (You can start a Discussion on a Forum or Edit your own user's description on your profile page) Type into the Atto editor a few words and press the <enter> key. Switch to HTML mode (use the "<>" icon on the Atto's second/hidden toolbar) Make sure you see HTML P elements with dir= ltr and style=text-align:left; attributes surrounding your text. Switch language to any RTL language (Hebrew, Arabic, ... ) Reload the page (or click "Cancel" to discard "auto save draft" content and start fresh) Type into the Atto editor a few words and press the <enter> key. Switch to HTML mode (use the "<>" icon on the Atto's second/hidden toolbar) Make sure you see HTML P elements with dir= rtl and style=text-align:right; attributes surrounding your text. Test #2 Go to Site administration ► Plugins ► Authentication ► Manage authentication Select your language as hebrew Copy the following text into the atto editor on the page, this will go to "auth_instructions" or הוראות הבעירה. הטמפרטורה של האש נעה על פני טווח רחב, החל מעשרות מעלות ועד אלפי מעלות. Save Logout and click login. You should see a period at the end of the hebrew sentence (which is on the far left, since hebrew is read right to left.) This means that the direction was automatically chosen correctly. Login as admin and go back to Manage authentication In english, add a test sentence with punctuation Hello! Welcome to this site! Log out and click login Change the language of the site to hebrew The punctuation should still be in the correct spot Login as admin and go back to Manage authentication Delete all the text (ctrl+a) Logout and click login Make sure the "Is this your first time?" text is no longer there
    • Affected Branches:
      MOODLE_27_STABLE, MOODLE_29_STABLE, MOODLE_32_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-45227-master

      Description

      Considering word processing desktop applications, when a new (or existing) document is opened up, the RTL/LTR (directionality) and the Left/Right (Alignment) buttons are "pressed" according to the user's current language.
      So each paragraph is embedded (inlined) with the proper style.

      The above behaviour should also be implemented on the web, especially in the HTML editor we use (Atto) since the user is under the illusion (due to the theme's styles) that the content that is entered is properly aligned to his/her current language preferences, but when the content is send by email (Forum) the theme's style is removed (not added) and the RTL content is displayed as LTR when the user open the email.

      There is already a similar suggested fix MDL-40520 for TinyMCE editor,
      Which detects the user's language and enables (set) the proper directionality and alignment buttons, when the editor initiates.
      All this, to make it more easy for the users to start inputting content without the need to click those buttons. (which they mostly forget or not aware of, due to desktop word processing habits)

      Also, system setting should include by default the RTL/LTR buttons
      editor_atto | toolbar

       align = align,rtl
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                7 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated: