Why do we ship /usr/lib/locale with snap packages?

I noticed locale folder in snap package which was 128 Mb in size , i mean why do we need that to be packed in the package ? Locale should be taken or used from host system. This is increasing the size of my package, is it safe to remove this from the snap package ? Also what are the other ways to find out unnecessary files that can be removed safely.

That is actually a good question. I’d love to be enlightened :thinking:

The core and core18 snaps only ship data for the C.UTF-8 locale to save space. Unfortunately this means that applications that require locale data to run (e.g. for collation, date formatting, etc) end up needing to ship their own.

This is usually done by staging locales-all, or shipping the locales source and trying to compile locales as needed.

Note that the 128 MB figure greatly exaggerates the cost though, both in terms of disk space and downloads. As snaps are distributed as compressed file systems, the cost is closer to 10 MB (or approximately 10% of the size of core).

Removing locale-all from resulting snap is not a good idea in order to make snap smaller.
Many apps and utilities will fail to work properly, i found this with one of my app where ffmpeg require locale to decode names of files passed to it.

making a content snap which provide and gets connected to all snaps automatically could be good idea, but its up to Canonical/snappy developer team.