Open hturner opened 1 year ago
I think there are some Farsi translations already:
Here is the startup message when we start R with LANGUAGE=fa
@alswajiab and @imanalhasani vetted that it looks ~roughly OK (though they don't speak Farsi, Arabic is similar). Note that this is mixing RtL and LtR as well.
(also note that I am running this on Linux)
Yes, I think there are very carefully selected messages that have been translated, for example the startup message and possibly other messages that can be hacked to look correct with judicious white space. I don't think there are examples of general messages/warnings/errors?
I see -- here is the whitespace in question, for reference:
messages that can be hacked to look correct with judicious white space
Do I understand correctly this is a concern limited to multi-line messages? Because "left-justified" text should be "right-justified" in RtL languages to be displayed correctly?
If so, any message without a newline (\n
) may be ready to translate.
Some more evidence: That one-line Farsi message produced via stop()
-- looks OK to a naive reader (me):
I've done a little reading around, if I understand correctly the example you give is bidirectional text, that would ideally be formatted as follows:
[TXET LTR] : Error in f( )
Background reading:
Introduction to typing and using RTL (Right to Left) text, and configuring software applications to support RTL Bi-directional (BiDi) text in terminal emulators
Support:
Comparison of text editors: Right-to-left and bidirectional_text - suggests Emacs and VS Code provide support Discussion re support in Microsoft terminal - maybe one day the entire terminal output could be formatted RTL, but it seems to not be done (anywhere?) currently
Possible lead re implementation:
Unicode-aware terminals may use Bidirectional hints -- comment by Jongware on https://stackoverflow.com/q/20450017/173755
But maybe we just need to do more testing with an appropriately configured Emacs terminal.
Thanks for digging into this Heather. Great references. I'm still not fully clear if there are R problems (and hence worthy of a Buganizer report) or if it's down to using an appropriate/appropriately-configured terminal. My examples above were from running R under LANGUAGE=fa
, not changing the terminal / system languages, so, e.g., my terminal was still left-aligned, as visible in the screenshots. Not sure if that would have made a difference in the output.
In either case, though, my understanding is that translators of RtL languages need not be deterred -- the messages will be displayed and usable when such translations are complete, though the formatting may be a bit unnatural.
Currently the only translations of R messages into a RTL language are for the Windows GUI, due to the belief that R does not support RTL languages in the console. At least, this is what I gathered from discussion with the Persian translator (https://svn.r-project.org/R/trunk/src/library/base/po/RGui-fa.po). I discussed this issue a little with @kalibera by email some time ago and he said this issue needs investigating to be more precise. The sprint may be a good opportunity as we have both people fluent in Arabic and people with a range of experience of different IDEs/consoles/programming languages and operating systems.
From previous correspondence with Tomas:
The goal of the discussion here would be to identify if there is anything that could be changed in base R to provide better support, or if it is a third-party issue that might be "fixed" by choosing an appropriate GUI/IDE/console (on the right OS).
If there is at least some way for RTL messages to be presented in a useful way to users, then it is worthwhile to extend translation beyond the GUI strings.