It is currently March 28th, 2024, 12:31 pm

[Bug] Wrong language in log

Report bugs with the Rainmeter application and suggest features.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Bug] Wrong language in log

Post by balala »

oZone wrote: November 7th, 2019, 7:38 am What is your format and what language do you have in Administrative tab in Language for non-Unicode programs option?
Format: Hungarian:
RainmeterLang3.png
Current language for non-Unicode programs: English (United States):
RainmeterLang4.png
User avatar
Brian
Developer
Posts: 2673
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: [Bug] Wrong language in log

Post by Brian »

Excellent. These changes will be in the next public beta.

For years (decades maybe?), Windows used something called a unique "language identifier" or LCID. As Windows has evolved over the years, a new language scheme has emerged to better serve all the language choices that Windows offers. Since Windows still needs to work with older software, they have decided to deprecate the use of LCID's, in favor of IETF language tags (like en-US, fr-FR, etc.)

Here is an overview of the different languages, ids, sub-language ids, etc. that Windows uses for each locale:
https://docs.microsoft.com/en-us/windows/win32/intl/language-identifier-constants-and-strings

To make things more complicated, Windows allows for several different locales used in various areas of the OS. Region (where you are located, currency symbols, number format), regional format (like time and date), display language (you live in Romania, but use English as a UI language), and a list of preferred languages (used in case the display language isn't compatible with an app). So, that's at least 4 locale settings per user (and another 4 of the system defaults). The Windows documentation do not make it crystal clear on how to retrieve each "type" of locale setting and how to process all the different identifiers and sub identifiers. There's lots of examples on the internet, but most are outdated, using the older LCID method.

-Brian
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Bug] Wrong language in log

Post by balala »

Brian wrote: November 7th, 2019, 5:47 pm For years (decades maybe?), Windows used something called a unique "language identifier" or LCID. As Windows has evolved over the years, a new language scheme has emerged to better serve all the language choices that Windows offers. Since Windows still needs to work with older software, they have decided to deprecate the use of LCID's, in favor of IETF language tags (like en-US, fr-FR, etc.)

Here is an overview of the different languages, ids, sub-language ids, etc. that Windows uses for each locale:
https://docs.microsoft.com/en-us/windows/win32/intl/language-identifier-constants-and-strings

To make things more complicated, Windows allows for several different locales used in various areas of the OS. Region (where you are located, currency symbols, number format), regional format (like time and date), display language (you live in Romania, but use English as a UI language), and a list of preferred languages (used in case the display language isn't compatible with an app). So, that's at least 4 locale settings per user (and another 4 of the system defaults). The Windows documentation do not make it crystal clear on how to retrieve each "type" of locale setting and how to process all the different identifiers and sub identifiers. There's lots of examples on the internet, but most are outdated, using the older LCID method.
And if I'm not wrong, until now Rainmeter has worked with LCID technique to identify the Windows language. Now you've changed this to IETF. Is this right? Because this new version had identified correctly what previous versions didn't (at least as far as I can tell).
User avatar
Brian
Developer
Posts: 2673
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: [Bug] Wrong language in log

Post by Brian »

balala wrote: November 7th, 2019, 6:35 pm And if I'm not wrong, until now Rainmeter has worked with LCID technique to identify the Windows language. Now you've changed this to IETF. Is this right? Because this new version had identified correctly what previous versions didn't (at least as far as I can tell).
Yes and no.

We used to use the user's LCID and asked Windows to give us the english "name" of the language (french, instead of français). This method works for most locales, but not all.

However, we aren't explicitly using IETF either, at least not directly. Internally, Windows stores all the locale information using a unique intentifier (not LCID, but something called LANGID). So, we just have to ask Windows for the user language LANGID, then turn around and ask Windows for the english "name" of that LANGID.

Clear as mud? :D

-Brian
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Bug] Wrong language in log

Post by balala »

Brian wrote: November 7th, 2019, 7:03 pm Clear as mud? :D
To reply as you did: yes and no.
Yes, it is, your explanation is clear. No, because I don't programming, so not all terms / expressions are clear and I don't know how all those are working / worked before on Windows.
But doesn't even matter too much. Important is you've figured out how to get returned the proper language and I think this is important from this point of view.
Great job...
oZone
Posts: 154
Joined: May 14th, 2018, 4:46 pm

Re: [Bug] Wrong language in log

Post by oZone »

balala wrote: November 7th, 2019, 4:59 pm Format: Hungarian:
Current language for non-Unicode programs: English (United States):
As I though, I still remember issues when I tried to run old non-unicode program. Unless I had changed format It had always crashed.

Glad it's fixed.

btw for curious about LCID deprecation https://docs.microsoft.com/en-us/globalization/locale/locale-names
Post Reply