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

Auto-detect GUI language on Windows with empty user profile (first launch, or purged-up launch) #1712

Closed
the-Arioch opened this issue Jun 10, 2020 · 3 comments · Fixed by #1751
Labels
bug Something isn't working
Milestone

Comments

@the-Arioch
Copy link

the-Arioch commented Jun 10, 2020

  • Operating System: Win7, Win8.1, probably others too
  • Delta Chat Version: 1.3.4
  • Expected behavior: Main menu being in Russian, from get-go
  • Actual behavior: Main menu reading File/Edit/etc until user's manual override

One the cleansed launch (usual first launch was impossible due to #1597) the file/edit/etc menu was not translated to Russian, which is default OS user locale

I know i can switch it manually, but i believe newb-oriented program should "just work" before any user's tuning

On Linux you typically can get RFC-like language string from LOCALE environment variable.

On Windows that preceeded those they made their own infrasturcture....
First one can get numeric code (LC_ID) from AFAIR GetThreadLocale Win32 function.
It would be 1049==0x419 for Russian.

Win7+ also has this per-user setting, but i am not sure those are reliable... Have no Win2k or XP to check.
HKEY_CURRENT_USER\Control Panel\International
Locale=00000419
LocaleName=ru-RU

And if empty, less correct, but maybe more simple is to get computer-global default language as default values from HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\Language (REG_SZ "00000419" to me).
Then translating it to "ru" via HKEY_CLASSES_ROOT\MIME\DataBase\Rfc1766

@the-Arioch the-Arioch added the bug Something isn't working label Jun 10, 2020
@the-Arioch
Copy link
Author

Just realized, it was not only about Chrome window decoration but about "electron" GUi too, see "welcome window" screenshot at #1711

So it is not merely file/edit menu!

@Simon-Laux
Copy link
Member

Basically we need the feature to auto detect the system language and set it on the first start.
We could probably use https://www.electronjs.org/docs/api/locales for this. app.getLocale()

@gerryfrancis
Copy link
Contributor

Have no Win2k or XP to check.

@the-Arioch It does not matter, these operating systems are no longer supported.

@Simon-Laux Simon-Laux added this to the 1.4 milestone Jun 17, 2020
Simon-Laux added a commit that referenced this issue Jun 24, 2020
Technically, use system language until the user chooses their language
fixes #1712
@r10s r10s added bug Something isn't working and removed bug Something isn't working labels Aug 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants