Skip to content

Enable localization and follow system language - #123

Merged
zackslash merged 6 commits into
mainfrom
fix/ship-translations
Aug 23, 2026
Merged

Enable localization and follow system language#123
zackslash merged 6 commits into
mainfrom
fix/ship-translations

Conversation

@zackslash

Copy link
Copy Markdown
Owner

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.

  • Add sailfishapp_i18n so lrelease builds and installs the .qm files
  • Load them via the QLocale overload of QTranslator::load, which resolves ghosteel_.qm and handles the de_DE -> de fallback
  • Normalize the .ts files with the now-active lupdate and gitignore the regenerated source template

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.
@zackslash
zackslash merged commit 8f0e0fc into main Aug 23, 2026
3 checks passed
@zackslash
zackslash deleted the fix/ship-translations branch August 23, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant