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

Impossible to change UI language to english if your system locale isn't set to an anglophonic country #619

Closed
Protected opened this issue Aug 17, 2019 · 23 comments
Labels
Milestone

Comments

@Protected
Copy link

Protected commented Aug 17, 2019

Version 0.9, Windows 10.

Apparently the "english" option in the settings actually means "system locale if a translation is available for that". I can change to any other language and restart and it will work, but if I change to english and restart it will go back to my system locale language (not english).

The only way I found for working around this issue was to delete the Manuskript translation files entirely.

Please do not do this. The system locale is set for the sake of measurement units, currency, time, etc. and is not my system language or the language I want to read things in. Either have a "System locale" option in the dropdown, distinct from "English" (and keep "English" for "use built-in labels without applying any translation") or do not make any assumptions and let people choose (in addition, this option should be immediately accessible on first run - without requiring the creation of a project - and should prompt for an application restart!)

Thanks.

@worstje
Copy link
Contributor

worstje commented Aug 18, 2019

Thank you for your report. It is very much appreciated.

I am in complete agreement with you: these things should not be mixed up. Although it can be considered jarring when you end up with days or formats that don't match the language of the rest of the interface, there are good reasons these things are kept separate, some of which you have eloquently described in your post.

Based on your description, I am not sure if the issue is as simple as the system-defined locale setting being labeled as 'English', or if it is indeed an 'English' setting that is being poisoned with system-specific settings.

Would you be able to provide a representative screenshot of the English language in Manuskript with

  1. a problematic system locale selected and

  2. the correct output with all translation files removed.

Please have your region and locale settings in Windows present on the screenshot for reproduction purposes.

Additionally, feel free to list of any locations you are able to identify that fail to properly behave for the selected language. In order to solve these translation & locale-related issues, it might be best to thoroughly identify the scope of the issues first.

The few volunteers we have that work on Manuskript may not necessarily be in a position to properly identify the scope of this particular issue on their own. The more thoroughly and clearly we document the wrong behaviour, the easier it is for someone to actually dig into this issue. 😄

@mxamber
Copy link

mxamber commented Aug 18, 2019

Same issues here. Upon startup (Windows 7), the console window that opens says Loaded translation from system locale: manuskript_de_DE.qm. and subsequently presents the UI in German. While there is an option in the settings to switch to another language, it's ineffective, as described above, requiring a restart only to be set to German again. It might be noteworthy that the option in the settings remains set to English, even as the actual language keeps being reset to my system language, German.

@worstje
Copy link
Contributor

worstje commented Aug 22, 2019

@mxamber Can you share with us the console log you get for your initial start of manuskript, and also what the log looks like when you restart a second time again?

Based on my cursory glance through the code, you should be seeing different messages.

Assuming the message you shared in your post is the only one, then that implies it never saved your language preference to begin with, as it is falling back on the default for your system without any user preference being configured.

I might try to do some more indepth testing at a later point, but it would be nice to exactly understand the nature of the issue before I dig in and try to reproduce the symptoms that are described in this issue. (I am not seeing it in my brief test just now, but I suspect that is in part because my own locale has no Manuskript translation available for it.)

@mxamber
Copy link

mxamber commented Aug 22, 2019

Log upon startup:

Debug: Web rendering engine used: QWebView
Running manuskript version 0.9.0.
Found translation in settings:
Loaded translation from system locale: manuskript_de_DE.qm.
Loading: path/to/my/project
Detected file format version: 1. Zip: True.
Projekt path/to/my/project geladen.
Projekt my/project gespeichert.

and then
Log upon subsequent restart after changing language:

Debug: Web rendering engine used: QWebView
Running manuskript version 0.9.0.
Found translation in settings:
Loaded translation from system locale: manuskript_de_DE.qm.

@worstje
Copy link
Contributor

worstje commented Aug 22, 2019

That is weird. Why does it completely skip trying to load from settings? 🤔

Actually no, worse. I just noticed the colon. Why is it not storing the translation in the settings to begin with? Clearly the setting it loads is empty, and if it is unable to load a setting it obviously loads from default. That explains the behaviour seen during load-up...

Thank you for the logs; just seeing those saved me barking up the wrong tree when looking for the cause. I'll look further into this later today. 😃

@mxamber
Copy link

mxamber commented Aug 22, 2019

In case it's any help, other settings, such as labels or UI style (I changed it to Windows XP style to test if it worked) are saved and loaded properly.

@mxamber
Copy link

mxamber commented Aug 24, 2019

I took a look at the registry and the source code and the key it looks for (applicationTranslation) is empty. It's not an issue with loading the translation, it's an issue with not storing it in the first place.

@mxamber
Copy link

mxamber commented Aug 24, 2019

Take a look at this commit here. English is just "" and many of the languages specified don't exist, for instance, it says UK English is manuskript_en_GB.qm, yet no such translation file exists within the current release, however, manuskript_uk.qm, here labelled Ukranian, appears to contain the British translations (took a quick peek with the hex editor). I think the issue lies within settings.py or settingsWindow.py. I edited the registry key via regedit and it works, changing it manuskript_uk.qm loads the British UI language, manuskript_es.qm shows Spanish, etc etc.

@worstje
Copy link
Contributor

worstje commented Aug 24, 2019

It's not quite that simple, @mxamber . I dug into the code the other day - I was on my phone, not really the right time to code but browsing github worked 😄 - and it basically comes down to the code treating an empty string as the 'default' translation (the one in the code, so to speak), which happens to be the English language you expect.

However, when starting the application and detecting what language to load, and then trying to load it, also short-circuits a missing translation to 'autodetect'. Ergo, it kicks in with the autodetection based on your configured region when the interface has the correct option selected.

I intended to write a patch for it today, but I've been getting distracted so it will hopefully be tomorrow. The code is just slightly hairy enough (it smelled like a copypaste from some other project or demo with far more translations available) that I want to properly triplecheck all the code paths to make sure everything makes sense after I fix it. (Which would most likely involve adding an auto-detection entry to the settings screen as well.)

@mxamber
Copy link

mxamber commented Aug 24, 2019

i just noticed that ""fixing"" it via regedit crashes if i try to load a project so yeehaw

@worstje
Copy link
Contributor

worstje commented Aug 24, 2019

If you want to still use an English language and can stomach working around the bug for now, you can set the registry key you mentioned to manuskript_en_GB.qm to select the UK English variant. It is not ideal, but at least it is a form of English that is hopefully readable enough. 😉

@mxamber
Copy link

mxamber commented Aug 24, 2019

If you want to still use an English language and can stomach working around the bug for now, you can set the registry key you mentioned to manuskript_en_GB.qm to select the UK English variant. It is not ideal, but at least it is a form of English that is hopefully readable enough.

I did, didn't work, said there was no such translation and gave me my system language. I checked, and no file of that name exists. I changed it to manuskript_uk.qm which, despite being labelled as Ukranian, contained the English translation, seemed to work but crashed upon opening a project, so back to square one I am.

@worstje
Copy link
Contributor

worstje commented Aug 24, 2019

Hrm, it sounds like there may be more than one issue. I'll have to check separately later whether or not the British language actually works for me.

@gedakc
Copy link
Collaborator

gedakc commented Aug 25, 2019

Adding a British translation is a work in progress. See issue #592 and also Weblate.

@gedakc
Copy link
Collaborator

gedakc commented Aug 28, 2019

The British English translation has been added to the develop branch.

worstje added a commit to worstje/manuskript that referenced this issue Sep 4, 2019
Issue olivierkes#619 revealed an unintentional overlap between the auto-detection
of the locale and the implicit builtin English language, which resulted
in users being unable to select the builtin English language when their
device was configured with a locale that we happen to have a translation
for. The code has been rewritten to more clearly separate auto-detection
and the final fallback that is the builtin English translations.
worstje added a commit to worstje/manuskript that referenced this issue Sep 4, 2019
The user can configure a language for Manuskript in the dialog, but
before that setting is ever written to disk, there is the default
behaviour that tries to auto-detect the best language to show based on
the configuration of the device it is running on.

While doing my due diligence on issue olivierkes#619, I realized we were relying
on the system locale, which is not necessarily equivalent to the
language the user is working with. Worse still: a user can have multiple
preferred languages for their user interface, and our old approach might
actually offer them the 'wrong' language. This patch fixes this.

It also refactors and comments things a little bit where necessary.
@gedakc gedakc added the bug label Sep 9, 2019
@gedakc gedakc added this to the 0.10.0 milestone Sep 9, 2019
@gedakc
Copy link
Collaborator

gedakc commented Sep 11, 2019

Can someone with a non-English system locale test the proposed fix in PR #619?

@mxamber
Copy link

mxamber commented Sep 13, 2019

Can someone with a non-English system locale test the proposed fix in PR #619?

My system locale is German, what fix?

@gedakc
Copy link
Collaborator

gedakc commented Sep 13, 2019

@mxamber the problem reported is that a system with a non-English locale was unable to display English when choosing English in Edit -> Settings, and then restarting Manuskript. Instead Manuskript would continue to load and display the system locale.

To test you would need to Run Manuskript from Source Code, use the git develop branch, and pull down the commits from PR #619.

If you require exact commands then let me know.

gedakc pushed a commit that referenced this issue Sep 15, 2019
Issue #619 revealed an unintentional overlap between the auto-detection
of the locale and the implicit builtin English language, which resulted
in users being unable to select the builtin English language when their
device was configured with a locale that we happen to have a translation
for. The code has been rewritten to more clearly separate auto-detection
and the final fallback that is the builtin English translations.
gedakc pushed a commit that referenced this issue Sep 15, 2019
The user can configure a language for Manuskript in the dialog, but
before that setting is ever written to disk, there is the default
behaviour that tries to auto-detect the best language to show based on
the configuration of the device it is running on.

While doing my due diligence on issue #619, I realized we were relying
on the system locale, which is not necessarily equivalent to the
language the user is working with. Worse still: a user can have multiple
preferred languages for their user interface, and our old approach might
actually offer them the 'wrong' language. This patch fixes this.

It also refactors and comments things a little bit where necessary.
@gedakc
Copy link
Collaborator

gedakc commented Sep 15, 2019

PR #627 has been tested and confirmed to fix the issue reported here. This enhancement will be included in the next release of Manuskript.

For a non-English default locale to use English one must first change the Manuskript setting to something other than English, then back to English, then restart Manuskript for the builtin English to be displayed in Manuskript.

@gedakc gedakc closed this as completed Sep 15, 2019
@mxamber
Copy link

mxamber commented Sep 15, 2019

For a non-English default locale to use English one must first change the Manuskript setting to something other than English, then back to English, then restart Manuskript for the builtin English to be displayed in Manuskript.

Is this about the current version or the next version? Because in my current install, it won't work, I changed the language to Spanish, restarted, found Manuskript to be in Spanish, changed it to English, restarted, and found Manuskript in my system locale (not English) again.

Oh, and setting the language to Dutch gave me the English UI language... wtf

@gedakc
Copy link
Collaborator

gedakc commented Sep 15, 2019

Is this about the current version or the next version?

This will be fixed in the next version (0.10.0). This is displayed on the right hand side of this issue under Milestone. The fix is already available in the git develop branch.

Oh, and setting the language to Dutch gave me the English UI language.

The language translations are in various stages of completion. See Weblate - Manuskript. Even the current Dutch translation is only about one third complete.

@stereo3d
Copy link

I am running version 0.11.0 having the same problem on OSX 10.14.6
I would like to have the english interface. I set it up in the settings, but
Korean keeps showing up. I downloaded the latest version from git.
Is there a workaround for starting with english?

Running manuskript version 0.11.0.
Preferred translation: ['en-KR', 'ko-KR', 'de-KR'] (based on available ui languages)
No translation found or loaded. (manuskript_en_KR.qm)
Loaded translation: manuskript_ko_KR.qm
Loading: /Users/user/Desktop/test.msk
Detected file format version: 1. Zip: True.
프로젝트 /Users/user/Desktop/test.msk을(를) 불러왔습니다.
프로젝트 test.msk을(를) 갈무리하였습니다.**

Screen Shot 2020-07-24 at 12 47 53

@pkej
Copy link

pkej commented Jan 23, 2022

Quick solution: Go into the Preferences of Manuskript, set to "English (Great Britain)". Restart. Change to "English", restart again, voilá, problem fixed.

I'm using Manuskript 0.10.0 (the one Homebrew defaults to) on macOS Monterey, v 12.1.

I hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants