Enable localization and follow system language - #123
Merged
Conversation
Translations were never delivered: ghosteel.pro lacked sailfishapp_i18n so lrelease never ran and no .qm files were installed, and loadTranslations() passed locale.name() into the 4-arg QString overload of QTranslator::load, which treats the second argument as a directory and can never find the files. Enable the i18n feature and switch to the QLocale overload, which also performs the de_DE -> de fallback itself. Normalize the .ts files with the now-active lupdate and ignore the regenerated source-language template.
The emulator image ships without sailfish-locale, so the Settings language list is empty and no locales beyond C/POSIX exist: language QA is impossible until the package is installed. scripts/emulator_language.sh installs it, switches the system language the way the Settings page does (/etc/locale.conf plus reboot), or launches ghosteel under a chosen locale for a fast check without rebooting.
The set command wrote only /etc/locale.conf, but lipstick inherits its locale from the per-user environment file /home/.system/var/lib/environment/<uid>/locale.conf, which only the setuid setlocale helper (not callable over ssh) writes; the OS stayed in the old language after reboot. Write the same three files the helper writes and show both in status.
set en failed because en_EN.utf8 does not exist: English generates as en_GB/en_US. Resolve a bare code by trying xx_XX first, then any generated xx_* variant, so every language in the generated set works without knowing its region.
Guard the locale.conf read against set -e exiting silently when the file is missing, and derive XDG_RUNTIME_DIR from the user's uid instead of hardcoding it, matching set and status.
sailfishapp_i18n chains lupdate and lrelease with a bare || :, so a build image lacking the tools would succeed and ship an RPM with no compiled translations. Require qt5-qttools, which provides them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enables runtime translations: the UI now follows the system language across the 39 maintained locales. Menus, settings, and dialogs render translated; untranslated locales fall back to English.