The locales-launch remote part

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.

example of gettext support

How to use?


Merge the following snapcraft recipe:


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

    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 locales-all package:

    - 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:

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

      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.

The implementation

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

Snaps that use locale-launch


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


Happy snapcrafting!


Awesome, thanks for this!

I just tried it out with a python snap and it fixes the locale issues!

Can you add a link to a snap using this? Do you want to make this post into a wiki so others can help maintain this doc?

1 Like

Sure, I was originally using this to fix the GNU Hello snap.

It is now converted to a wiki.

The htop snap is now using this part as of revision 1066, on stable (commit + LP build). Thanks!

1 Like

It’s my pleasure! :slight_smile:

Here’s another solution that solves the problem slightly differently but doesn’t require locale data compilation:

Only use the above one if:

  • The snapped application doesn’t depend on LC_* environment variables other than LC_MESSAGES(if unsure you probably shouldn’t use it as it breaks parts of the localization other than message translation)