Manage writing system direction in UI (right to left, etc.) V0
Minimal implementation, see next steps in #1305
In arabic texts:
- concordance contexts display are swaped between left and right
- concordance contexts sizes parameters are swaped
- concordance export contexts are swaped between left and right
- cooccurrences contexts parameters are swaped
- text edition should be justified on the right by default
Solution
[1] Add a new ‘writing-system-direction’ import parameter with default value to 'LTR' (Left To Right) :
- en : Writing system direction
- fr : Orientation du système d'écriture
Possible values:
- LTR: text is written from left to right (e.g. occidental languages)
- RTL: text is written from right to left (e.g. arabic, hebrew)
[2] The import parameter becomes the ‘writing-system-direction’ corpus parameter.
Use the writing-system-direction corpus parameter to build text editions
If (writing-system-direction == RTL)
- HTML edition
- [3] general rendering
- set CSS: .p 'direction: rtl'
- [3] general rendering
Use the writing-system-direction corpus parameter to display command results
- [5] Concordance
If (writing-system-direction == RTL)
- SWAP the content of the left context with the content of the right context
- justify left context, pivot and right context RIGHT
- [7] Cooccurrences
Validation test
- test the following arabic binary corpus:
- binary corpus: UDHR-AR-2025-10-16.txm
- source: https://www.un.org/ar/about-us/universal-declaration-of-human-rights
- set the import parameter field "Writing system direction" to rtl
- do the import
- open the edition
- compute concordances
(from redmine: issue id 1305, created on 2015/04/09 by Serge Heiden)