This remote part ships the
locales-launch launcher to your snap, this launcher fixes Glibc locales support and allows GNU Gettext-based internationalization(I18N) to work.
How to use?
Merge the following snapcraft recipe:
locales-launch to the snap application command chain:
apps: _app_name_: command: locales-launch _original_app_command_chain_
That’s all you have to do, but if you want to directly embed the full set of pre-compiled locale data without generating them at runtime once per installation per locale and don’t care about the snap size increase by ~7MiB, override the
stage-packages key to stage the
parts: locales-launch: stage-packages: - locales-all
The launcher will automatically use the in-snap locale data if found.
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: /
This launcher is not necessary if the snap target is a GUI application and you’re using the
desktop-* remote part and the
desktop-launch launcher. This remote part is primarily for CLI applications.
You may also run
snapcraft define locales-launch to verify the actual implementation being used.
Snaps that uses
- Lack of compiled locales breaks gettext based localisation - snapcraft - snapcraft.io
- Remote (reusable) parts - doc - snapcraft.io