New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementing right to left text support #310
Conversation
Updating master to version 0.7.1
Merge for version 0.8
Merging changes for version 1.0.0
Config settings for 1.0.0
Upon further exploration it appears that the issue is not with the first or last character of a line, but with punctuation marks at the start or end of lines. See these examples: I do not understand the exact set of characters that are moved around, and can't find any documentation about it. The next step is to speak with Arabic speakers and users to understand the scale of the impact this will have on maintaining correctly formatted ATF files. |
I'm seeing something similar with punctuation when changing the text direction of HTML pages. Perhaps this is an issue with what constitutes a "word" in a right-to-left language for the purposes of display? |
It seems this may be the expected behaviour. A (hopefully) useful description of why it happens and how to work around it: https://www.w3.org/International/articles/inline-bidi-markup/uba-basics |
The initial plan is to preserve left to right text for the headers and transliterations and lemmatizations. Then switch to right to left for the translations in Arabic. There are language codes in the atf format to signify a change of language. We are assuming a single atf header per file so there will be one switch from left to right to right to left per file. Next step is to understand how to do the switch at a specified point in the file. |
The MWE added in the last commit shows how to interleave text directions on a line by line basis. |
Big step forward, as we have now got right to left text mixed with left to right text in the same document: There are still a lot of issues to resolve surrounding the precise styling of the arabic lines, and ensuring that the syntax highlighting does not break. |
more pom edits based on the previous PR more pom edits based on the previous PR more pom edits based on the previous PR
The right to left text is mostly working now. One issue is that if the language code is changed from EDIT: this has now been resolved |
Based on #315 we will need to add support for:
and for:
|
more pom edits based on the previous PR more pom edits based on the previous PR more pom edits based on the previous PR
…ate an easy way of adding new languages or translation types in the future
This branch has been merged into #318 so this PR is not closed. |
This is a work in progress PR to manage the work required to support right to left text, e.g. Arabic within ATF files. The complete scope of this still needs to be defined.
Initial work has identified that we can change the text direction by editing the
ComponentOrientation
within the constructor ofAtfEditArea
. however, this results in strange behaviour, where the first character of a line (in left to right mode) is moved to the far right of the line in right to left mode. This also happens when we use the keyboard shortcut documented in #297, which appears to do the same thing.