Snapd date localization is VERY MUCH wrong
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
language-pack-ru-base (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Consider this:
```
dmitry@MUNIT-517:~$ LANG=C.UTF-8 snap info firefox | grep refresh-date
refresh-date: 3 days ago, at 11:52 EET
dmitry@MUNIT-517:~$ LANG=ru_RU.UTF-8 snap info firefox | grep refresh-date
refresh-date: 3 дня назад в 2626:52 UTC
```
2626 is a funny hour indeed.
After some research™ I've found out that:
1. Snappy asks gettext for a localized string "%d days ago, at 15:04 MST",
2. gettext finds a string from a language-pack,
3. Then this string is formatted using printf-like format and Go time formatting.
This language pack provides those:
```
msgid "%d day ago, at 15:04 MST"
msgid_plural "%d days ago, at 15:04 MST"
msgstr[0] "%d день назад в 22:04 UTC"
msgstr[1] "%d дня назад в 22:04 UTC"
msgstr[2] "%d дней назад в 22:04 UTC"
```
Unfortunately, Go time formatting layouts are made by writing out in the way you like a particular magic datetime constant, and layout parser extracts those magic digits to understand which parts of the date are to be printed (see https:/
So, just change the lines to:
```
msgid "%d day ago, at 15:04 MST"
msgid_plural "%d days ago, at 15:04 MST"
msgstr[0] "%d день назад в 15:04 MST"
msgstr[1] "%d дня назад в 15:04 MST"
msgstr[2] "%d дней назад в 15:04 MST"
```
But you probably need to check the localization of every project written in Go that formats time...
I guess if affects all releases...
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: language-
ProcVersionSign
Uname: Linux 6.5.0-26-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: ubuntu:GNOME
Date: Fri Mar 29 11:45:24 2024
InstallationDate: Installed on 2022-04-19 (710 days ago)
InstallationMedia: Ubuntu 20.04.3 LTS "Focal Fossa" - Release amd64 (20210819)
PackageArchitec
SourcePackage: language-
UpgradeStatus: Upgraded to jammy on 2022-08-21 (585 days ago)