NOTE: This part does not support snaps that use bases
This remote part ships the
gettext-launch launcher to your snap, this launcher fixes GNU Gettext-based internationalization(I18N) without generating locale data like the locales-launch remote part does.
How to use?
Merge the following snapcraft recipe:
gettext-launch to the snap application command chain:
apps: _app_name_: command: gettext-launch _original_app_command_chain_
GNU Gettext-specific fixes
Due to the fact that the gettext library doesn’t support locating the localization data from a non-fixed location, additional modifications may be required to make I18N work.
For example for software using the GNU build system the following modification is usually necessary:
parts: _part_name_: configflags: - --datarootdir=/snap/$SNAPCRAFT_PROJECT_NAME/current/share organize: snap/$SNAPCRAFT_PROJECT_NAME/current: /
For users that uses the
base keyword(thus not compatible with remote parts) or one simply doesn’t like remote parts here’s a Snapcraft YAML patch that has the same effect as using the
gettext-launch remote part:
apps: _app_name_: environment: LANG: C.UTF-8 LC_ALL: C.UTF-8
- This launcher is not necessary if the snap target is a GUI application and you’re using the
desktop-*remote part and the
desktop-launchlauncher. This remote part is primarily for CLI applications
- This remote part fixes the locale problem by hardcoding all the locale variables to
C.UTF-8, and should only be used when the snap doesn’t depend on
LC_*environment variables for any kind of localization beside of
LC_MESSAGES, for a general locale solution please use the locales-launch remote part instead
You may also run
snapcraft define gettext-launch to verify the actual implementation being used.
Snaps that use
- Lack of compiled locales breaks gettext based localisation - snapcraft - snapcraft.io
- Remote (reusable) parts - doc - snapcraft.io