FS#11180 - On windows layout does is not aligned to the right when language is set to Hebrew

Attached to Project: Rockbox
Opened by Tomer Shalev (tomers) - Wednesday, 07 April 2010, 04:40 GMT
Last edited by Dominik Riebeling (bluebrother) - Wednesday, 07 April 2010, 18:10 GMT
Task Type Bugs
Category Rbutil
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Rbutil SVN
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


In main(), there's the following code which automagically sets GUI layout to be aligned from right to left when the language is Hebrew (and in the future, Arabic):
if(applang == "he")

When the application loads for the first time, there's no configuration yet, and the application chooses the interface language according to the system settings. In Windows, it correctly detects that Hebrew is to be used, if that is the case, but it doesn't sets the layout direction accordingly.
Only after the settings are saved (when the application is closed), it will set layout direction correctly upon application load.

Tested on rbutil r25471, taken from

See attached screenshot.
This task depends upon

Closed by  Dominik Riebeling (bluebrother)
Wednesday, 07 April 2010, 18:10 GMT
Reason for closing:  Fixed
Comment by Dominik Riebeling (bluebrother) - Wednesday, 07 April 2010, 17:15 GMT
This doesn't surprise me, looking at the code. I bet it's caused by checking QLocale::system().name() to match "he". However, the documentation for QLocale::name() says:

QString QLocale::name () const
Returns the language and country of this locale as a string of the form "language_country", where language is a lowercase, two-letter ISO 639 language code, and country is an uppercase, two-letter ISO 3166 country code.

Rockbox Utility, however, stores the language as the same string the translation file uses. In case of hebrew this is "he", so it does match after a restart. I never liked this special casing for hebrew.