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
Autodetect and set the language on first launch #3481
Autodetect and set the language on first launch #3481
Conversation
Hey there! Thanks for helping Mudlet improve. 🌟 Test versionsYou can directly test the changes here:
No need to install anything - just unzip and run. |
Works as expected on Win10 with German. |
Ehmm ... how can I test this PR? Need to have a fresh install? How can I perform that? |
I've just documented that in https://wiki.mudlet.org/w/Manual:Testing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be reasonable to ALSO bring up the preferences dialogue with the relevant control as the focus on the first launch - if necessary ON TOP of the connection dialogue - so that the non-English speaker end-user can change the setting without having to navigate to the settings blind.
When I originally came up with a GUI switching design I had actually arranged for the controlling widget to have a special non-translatable multi-lingual tool-tip which said something along the lines of "Please select the language you want Mudlet to use." in all the languages that we had translations for. This (and the International icon for "language selection" ) should have made it blindingly obvious what the first time user needed to adjust!
I don't think so from a user experience perspective - you launch Mudlet for the first time and you're attacked with a multitude of dialogs, one of which is very information-rich, lets say, and one that for 90% of our current userbase won't matter. |
I can't confirm this working on macOS: it's having difficulties changing the language. I change the language, it asks to reboot, and after a reboot it forgets about the language change. |
@@ -743,9 +745,6 @@ class translation | |||
// cases the loaded file will be a "xx" language only file even though it | |||
// is an "xx_YY" one here: | |||
QString mQtTranslationFileName; | |||
// Further items like the above pair may be needed should some of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't remove this comment - it is entirely true and shouldn't be forgotten - the few translations in qtkeychain
are ones that we need to get around to including in the near future - the author of that library has just added a Russian (ru_RU) translation in the 0.10 release BTW - see https://github.com/frankosterfeld/qtkeychain/tree/master/translations .
That is one aspect I intended when I made the translation
class - so as to hold ALL the filenames we need to load to handle a particular GUI language (and unload them if/when that was changed)!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand what this comment means, not sure anyone else does either. Can you reword it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We (will need) to include any bunch of .ts
files that any subproject provides and that will need a QString
in this class to hold the path to the selected file needed for the selected GUI language.
Specifically right now, someone (likely you or I) will need to add in the QKeyChain translations by:
- writing a
(void) mudlet::scanForQKeyChainTranslations(const QString& path)
which will be likevoid mudlet::scanForQtTranslations(const QString& path)
except that it will look for a:
QString translationFileName(QStringLiteral("qkeychain_%1.qm").arg(languageCode));
to populate a (QString) Translation::mQKeyChainTranslationFileName
member with the file that best matches the translations in ./3rdparty/qkeychains/translations
- extend
(void) mudlet::loadTranslators(const QString&)
to also load that file after the Qt one and before the mudlet one...
As it happens I allowed for the need for further translation files to be wanted and any additional ones will automatically be handled provided we do the above for any subproject that includes them (as Qt .ts
files).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay - I've added it back with more understandable (for all) wording!
For the other 10% though they will still need to find their way to the GUI Language setting - and don't forget in the absence of a loaded profile most of the controls will be obviously inactive: This first launch situation - may be one, rare I suppose - when we could conceivable have a |
Ooops - hit the wrong button. 😊 |
I insist that the first launch experience is super important to be very smooth and pleasant, interrupting it with pop-ups or big windows full of settings runs counter to a good user experience. Remember first impressions matter. Just check out how simple it is to connect to a game with Mudlet on Windows: https://www.mudlet.org/game-admins/run-game-in-30s Interrupting that is going backwards, not forwards. That said I don't only want this to be my opinion, can @Mudlet/ui-review pitch in as well? |
Review feedback applied. |
…guage-first-launch
95% Chinese now translated! @vingi and @wiploo please test with first launch Mudlet (simulating a fresh install) with Chinese/Italian as the desktop / operating system language, it should choose the right language out of the box. |
test in simplified Chinese operation system(Windows 10), after delete/rename .config/mudlet folder, and the keys in Windows Registry, this testing version works very well...quite convenient , Awesome! |
Not following SlySven's suggestion to present lots of options on first startup. |
Hi, on windows 10 italian, works very well. I don't like language choose screen on first startup, another windows on top of another. Go autodetect and go to preferences if needed (like now) Best regards |
Thanks for testing! This is good for merging pending approval. |
And what language do you put that in? 😜 I am trying to get across how we handle the case where the user is totally unable to comprehend the language that is used on first presentation to the Mudlet application. Whilst the default locale is a good way to go, it is not infallible; for instance: for Mudlet testing purposes a while back set my Linux box to have the So I am thinking that we could take a copy of just the QComboBox (and it's associated code) used for GUI language selection and put THAT (and that language icon) into a one-shot (only on first launch) pop-up dialogue - which could be preset to the default locale that this PR deduces... |
Would that many people be running a desktop environment they are totally unable to comprehend when launching Mudlet for the first time? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay then, I guess things are as good as they can be. ...
OK :D |
* Autodetect and set the language on first launch * Remove unecessary duplicated languageCode key * Add English (British) as an exception * Review feedback * Simplified texts
* Autodetect and set the language on first launch * Remove unecessary duplicated languageCode key * Add English (British) as an exception * Review feedback * Simplified texts
Brief overview of PR changes/additions
Autodetect and set the language to the user's desktop environment language if it's one of those that we have a quality translation for.
Motivation for adding to Mudlet
Better i18n experience out of the box
Other info (issues closed, discussion etc)
@wiploo if you could test it as well.
Needs testing on: