Jump to content

VisualEditor/Typing/Right-to-left

From mediawiki.org

Introduction

[edit]

This is an acceptance test procedure for typing in a right-to-left language in the VisualEditor.

The basic typing test is done using Hebrew, because Hebrew characters should be easier to discern than of the other alphabets. Special features of complex RTL scripts will be checked in other tests.

Basic assumptions

[edit]
  • Visual Editor is completely installed and configured (Parsoid etc.)
  • LocalSettings.php: $wgLanguageCode = "he";
  • The computer has a physical US QWERTY keyboard.
  • The computer has an English (US) keyboard enabled in software.
  • The computer has a Hebrew keyboard enabled. (TODO: Which one? Specify for Mac, Desktop Linux, Windows.)
  • The computer has a Hebrew font installed.
  • The user interface of the wiki is Hebrew (change using preferences or ULS)

N.B.: The words "right" and "left" in this document refer to sides. "Right" doesn't mean "correct" and "left" doesn't mean "not taken".

Basic typing

[edit]
  1. Start a new article that doesn't exist.
  2. Start editing it using the Visual Editor.
    • Check: The cursor is at the top right corner.
  3. Type a.
    • Check: The letter ש appears on the screen in the top right corner.
    • Check: The cursor is immediately to the left of the letter.
  4. Type k.
    • Check: The letters של appear on the screen in the top right corner.
    • Check: The cursor is immediately to the left of the letters.
  5. Type ?
    • Check: The letters של? appear on the screen in the top right corner. From right to left: ש, then ל, then ?.
    • Check: The cursor is immediately to the left of the question mark.
  6. Press Enter.
    • Check: The first line didn't change.
    • The cursor is at the right end of the second line.
  7. Switch the keyboard layout to English
  8. Type in English: Hey!
    • Check: The text appears as Hey! at the right side of the second line. The exclamation mark must appear on the left end, next to the letter H.
    • Check: The cursor is at the left of the line, next to the exclamation mark.

Paragraph direction

[edit]

This feature is not implemented yet. Reference bug: Bug 41010 - There's no way to specify the directionality of a paragraph.

  1. Press the toolbar button for changing the paragraph direction to left-to-right.
    • Check: The first line hasn't changed - it's still של?, at the right side of the line.
    • Check: The second line now has the text Hey! at the left side of the line, with the exclamation mark on the right side of the word, next to the letter y.
  2. Select the whole text (probably something like Ctrl+A)
  3. Press the toolbar button for changing the paragraph direction to right-to-left.
    • Check: The first line says של? aligned to the right.
    • Check: The second line says Hey! aligned to the right, with the exclamation mark at the left end.
  4. Press the keyboard shortcut for changing the paragraph direction to left-to-right.
    • Check: The first line says של? aligned to the left, with the question mark at the right end.
    • Check: The second line says Hey! aligned to the left, with the exclamation mark at the right end.
  5. Press the keyboard shortcut for changing the paragraph direction to right-to-left.
    • Check: The first line says של? aligned to the right, with the question mark at the left end.
    • Check: The second line says Hey! aligned to the right, with the exclamation mark at the left end.

Keyboard shortcuts for movement and selection

[edit]
  1. While the whole text is selected, change the keyboard layout to Hebrew and type dwui su.
    • Check: All the previous text was deleted and replaced by new text.
    • Check: The first line says ג'ון דו, aligned to the right and the cursor is at the left end of the line.
  2. Press the right arrow on the keyboard (→).
    • Check: The cursor moved one character to the right and is between the letters of the two-letter word.
  3. Press the Home button (probably Ctrl+ on a Mac).
    • Check: The cursor is at the right end of the line.
  4. Press the left arrow on the keyboard (←).
    • Check: The cursor moved one letter to the left and is between the first letter from the right and the apostrophe.
  5. Hold Shift and press ← three times.
    • Check: The words ג'ון דו appear in the first line, aligned to the right.
    • Check: The letters 'ון are selected.
  6. Type rvo.
    • Check: The words גרהם דו appear in the first line, aligned to the right.
    • Check: No text is selected.
    • Check: The cursor is on the right side of the space between two words.
  7. Hold Shift and press → three times.
    • Check: The text גרהם דו appear in the first line, aligned to the right.
    • Check: The letters רהם are selected.
  8. Type trh
    • Check: The words גארי דו appear in the first line, aligned to the right.
    • Check: No text is selected.
    • Check: The cursor is on the right side of the space between two words.
  9. Press Shift-Control-→ (Probably Shift-Command-→ on a Mac).
    • Check: The words גארי דו appear in the first line, aligned to the right.
    • Check: The first word from the right is selected.
  10. Press the End key. (Probably Control-← on a Mac)
    • Check: The words גארי דו appear in the first line, aligned to the right.
    • Check: No text is selected.
    • Check: The cursor is on the left end of the first line.
  11. Press Ctrl+.
    • Check: The words גארי דו appear in the first line, aligned to the right.
    • Check: The cursor is on the left side of the space between the two words.
  12. Press Ctrl+.
    • Check: The words גארי דו appear in the first line, aligned to the right.
    • Check: The cursor is in the right end of the first line.
  13. Press Ctrl+.
    • Check: The words גארי דו appear in the first line, aligned to the right.
    • Check: The cursor is in the right side of the space between the two words.
  14. Press Ctrl+.
    • Check: The words גארי דו appear in the first line, aligned to the right.
    • Check: The cursor is in the left end of the first line.
  15. Press Ctrl+.
  16. Press Ctrl+⇧ Shift+.
    • Check: The words גארי דו appear in the first line, aligned to the right.
    • Check: The two letter word דו is selected.
  17. Press the End key.
    • Check: The words גארי דו appear in the first line, aligned to the right.
    • Check: The cursor is in the left end of the first line.
  18. Press Shift-Home
    • Check: The words גארי דו appear in the first line, aligned to the right.
    • Check: Both words are selected.
  19. Press the Home key.
    • Check: The words גארי דו appear in the first line, aligned to the right.
    • Check: The cursor is in the right end of the first line.
  20. Press Shift-End
    • Check: The words גארי דו appear in the first line, aligned to the right.
    • Check: Both words are selected.
  21. Press the End key.
  22. Press Enter twice.
  23. Type akuo/.
    • Check: The words גארי דו appear in the first line, aligned to the right.
    • Check: The second line is empty.
    • Check: The word שלום. appears in the third line, aligned to the right, and the period is at the left end of the line.
    • Check: The cursor is at the left end of the third line.
  24. Press Ctrl+Home.
    • Check: The cursor is at the right end of the first line.
  25. Press Ctrl+End.
    • Check: The cursor is at the left end of the third line.
  26. Press Ctrl+⇧ Shift+Home.
    • Check: The whole text is selected.
  27. Press End.
    • Check: The cursor is at the left end of the first line.
  28. Press Ctrl+⇧ Shift+End.
    • Check: The first line is not selected.
    • Check: The second and the third line are selected.
  29. Press the Home key.
    • Check: No lines are selected.
    • Check: The cursor is at the right end of the third line.
  30. Press the Delete key (Mac: fn-delete).
    • Check: Nothing is selected.
    • Check: The third line says לום.
    • Check: The cursor is at the right end of the third line.
  31. Press the End key.
  32. Press the Backspace key ("delete" on Macs) twice.
    • Check: The cursor is at the left end of the third line.
    • Check: The third line says לו.

Inline direction

[edit]
  1. Press Ctrl+Home.
  2. Press End.
  3. Type one space.
  4. Switch the keyboard layout to English.
  5. Type (Gary Doe;
  6. Type one space.
  7. Switch to the Hebrew keyboard
  8. Type 12 cnth 1977
    • Check: The first line says: גארי דו (Gary Doe; 12 במאי 1977). The number 12 is to the right of the words Gary Doe;. (This is intentionally incorrect display.)
  9. Select the words Gary Doe (with any punctuation marks).
  10. Use the language setting button to set the language of the selected text to English.
    • Check: The first line says: גארי דו (Gary Doe; 12 במאי 1977). The semicolon appears to the left of the words Gary Doe, and the number 12 appears to the left of the semicolon.

More shortcuts

[edit]
  1. Press Ctrl+End.
  2. Press Enter twice.
  3. Type tj, a,hho akua.
  4. Press Ctrl-Backspace
    • Check: The words אחת שתיים appear in the fifth line.
  5. Press the undo button (probably Ctrl+Z).
    • Check: The words אחת שתיים שלוש appear in the fifth line.
  6. Press Ctrl+ twice.
  7. Press Ctrl+Delete.
    • Check: The words אחת שלוש appear in the fifth line.

Clusters in Arabic

[edit]

Assumption: An Arabic keyboard layout is installed.

  1. Start in an empty editing window.
    • Check: The cursor is at the top right corner.
  2. Type sghl!.
    • Check: The word سلام! appears in the first line.
    • Check: The exclamation mark is at the left end of the first line.
    • Check: The cursor is to the left of the exclamation mark.
  3. Press the right arrow (→) four times.
    • Check: The cursor is between س‍ and ‍لا.
  4. Hold down Shift and press the left arrow ← twice.
    • Check: ‍لا is selected.
  5. Press Ctrl+End.
  6. Press Enter twice.
  7. Type sQgQhl?.
    • Check: The word سَلَام؟ appears in the first line.
    • Check: The inverted question mark is at the left end of the first line.
    • Check: The cursor is to the left of the inverted question mark.
  8. Press the Home key.
  9. Hold down Shift and press the left arrow (←) four times.
    • Check: The word سَلَام is selected.