multipass icon indicating copy to clipboard operation
multipass copied to clipboard

[snap] Snapshot timestamp format doesn't honor user's prefered locale when in a snap

Open ricab opened this issue 1 year ago • 3 comments

When running locally, the locale is properly used when formatting a snapshot's timestamp:

$ echo $LC_TIME
pt_PT.UTF-8
$ multipass info alive-chamois.snapshot2 | grep Created
Created:        ter 14 nov 2023 16:04:17 WET

This is not the case when running in a snap

$ echo $LC_TIME
pt_PT.UTF-8
$ multipass info primary.snapshot1 | grep Created
Created:        Tue Nov 14 14:35:27 2023 WET

ricab avatar Nov 14 '23 16:11 ricab

Localization of the timestamp added by #3237

ricab avatar Nov 14 '23 16:11 ricab

A couple of relevant (if old) threads:

  • https://forum.snapcraft.io/t/lack-of-compiled-locales-breaks-gettext-based-localisation/3758
  • https://forum.snapcraft.io/t/why-do-we-ship-usr-lib-locale-with-snap-packages/11652

From that, we could stage all locales or stage sources and compile locales on first launch. I am not sure if there is an easier way nowadays (e.g. using an extension).

ricab avatar Nov 14 '23 19:11 ricab

A few things that I tried to throw into the snapcraft.yaml, with no success unfortunately. locales-all adds some 20Mb to the snap package.

ricab avatar Nov 14 '23 20:11 ricab