Skip to content

Wrapping text in LTR Isolate characters when needed - #483

Open
AgustinVallejo wants to merge 2 commits into
mainfrom
475-rtl
Open

Wrapping text in LTR Isolate characters when needed#483
AgustinVallejo wants to merge 2 commits into
mainfrom
475-rtl

Conversation

@AgustinVallejo

Copy link
Copy Markdown
Contributor

Work related to #475

This branch experiments with a new "RTL" (Right-to-Left) toggle feature to the translation forms, allowing users to specify text directionality for translations. It also makes minor improvements to the development workflow and updates a simulation constant.

Translation Form RTL Support:

  • Added an RTL checkbox to each translation row in TranslationFormRow.tsx, allowing users to toggle between right-to-left and left-to-right text direction. The implementation uses Unicode directional isolation characters to wrap or remove directionality as needed.
  • Updated the translation tables in TranslationFormTables.tsx to include a new "RTL" column for shared, sim-specific, and common strings, and set a fixed table layout for better alignment. [1] [2] [3]
  • Added a new fast npm script to package.json for quickly building and starting the client and node server without extra checks.

Worflow

  • I copy the english pattern, THEN uncheck the RTL (I believe otherwise some hidden chars stay there), paste necessary arabic words in the strings, and test.
  • Sometimes I'm using https://jonathanolson.net/projects/shaping although in one case the report was not consistent with the sim:
image

Results

  • Got satisfactory results with totalCurrencyPattern (Screen 2)
  • Got confusing results with totalValuePattern (Screen 1). Minus sign is in the wrong place again, not sure why.

TODO

  • The RTL checkbox should potentially be hidden for locales that are not RTL.
  • Testing this has been difficult because our processes add and drop RTL characters in many places, mainly chipper's load-unbuilt-strings, number line's removeEmbeddingMarks, and potentially other places I'm unaware of... We gotta find a way to isolate the desired functionality.
  • The local version of Rosetta is not consistent with the Published in what to do when copying the english value: in published the patterns are auto-reversed. In the local version they are not. I'm not sure if JB introduced something to cause this. Gotta say I like it more without auto-reversal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant