The gettext-launch remote part

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:


and prepend gettext-launch to the snap application command chain:

    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:

    - --datarootdir=/snap/$SNAPCRAFT_PROJECT_NAME/current/share

      snap/$SNAPCRAFT_PROJECT_NAME/current: /

Alternative implementation

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:

      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-launch launcher. 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

The implementation

You may also run snapcraft define gettext-launch to verify the actual implementation being used.

Snaps that use gettext-launch


This part will not have great success without James Henstridge’s research and Sebastien Bacher’s initial implementation.


Happy snapcrafting!