Skip to content
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

Explore support for Right-To-Left languages in R console #76

Open
hturner opened this issue Aug 30, 2023 · 8 comments
Open

Explore support for Right-To-Left languages in R console #76

hturner opened this issue Aug 30, 2023 · 8 comments
Labels
MacOS Issues related to Mac GUI or the Mac OS Translations Issues related to translations Windows Issues related to Windows GUI or the Windows OS

Comments

@hturner
Copy link
Member

hturner commented Aug 30, 2023

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:

There are a number of front-ends of R on different platforms. Is it true that none of them works (and still, which of these does it refer to)? Is it really because of lack of support of something in R, or due to lack of support in the OS?

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.

@hturner hturner added MacOS Issues related to Mac GUI or the Mac OS Translations Issues related to translations Windows Issues related to Windows GUI or the Windows OS labels Aug 30, 2023
@MichaelChirico
Copy link

@MichaelChirico
Copy link

Here is the startup message when we start R with LANGUAGE=fa

Screenshot 2023-08-30 4 37 24 PM

@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)

@hturner
Copy link
Member Author

hturner commented Aug 30, 2023

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?

@MichaelChirico
Copy link

@MichaelChirico
Copy link

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.

@MichaelChirico
Copy link

Some more evidence: That one-line Farsi message produced via stop() -- looks OK to a naive reader (me):

image

@hturner
Copy link
Member Author

hturner commented Aug 31, 2023

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.

@MichaelChirico
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MacOS Issues related to Mac GUI or the Mac OS Translations Issues related to translations Windows Issues related to Windows GUI or the Windows OS
Projects
None yet
Development

No branches or pull requests

2 participants