Cache not generated for all translations
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Confirmed
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Groovy |
Fix Released
|
Undecided
|
Unassigned | ||
Hirsute |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
In bug 1161743 we discovered that if a system is configured with multiple locales, only the locales of the user who generated the apt-cache will be available for translated descriptions.
[Test case]
An automated test case has been included as a snippet in test/integratio
Manual test:
# apt install locales-all # get the locale
# export LANG=sv_SE.UTF-8
# locale
LANG=sv_SE.UTF-8
LANGUAGE=
LC_CTYPE=
LC_NUMERIC=
LC_TIME=
LC_COLLATE=
LC_MONETARY=
LC_MESSAGES=
LC_PAPER=
LC_NAME=
LC_ADDRESS=
LC_TELEPHONE=
LC_MEASUREMENT=
LC_IDENTIFICATI
LC_ALL=
# apt update
# apt-cache show tasksel | grep Desc
Description-sv: tool for selecting tasks for installation on Debian systems
Description-md5: cbbb747708986d1
# apt-cache showpkg tasksel
Package: tasksel
Versions:
3.34ubuntu16 (/var/lib/
Description Language:
Description Language: sv
Description Language: en
[...]
So far so good, but now assume the root user actually has C configured as locale, and e.g. runs apt-cache show (or apt-daily.service does an update):
root@g:~# rm /var/cache/
root@g:~# LANG=C apt-cache show tasksel
[...]
Description-en: tool for selecting tasks for installation on Debian systems
This package provides 'tasksel', a simple interface for users who
want to configure their system to perform a specific task.
root@g:~# apt-cache showpkg tasksel
Package: tasksel
Versions:
3.34ubuntu16 (/var/lib/
Description Language:
Description Language: en
This should show the sv locale as well given that it's still around (also we are still running with LANG=sv_SE.UTF-8), but it only generated the cache with the english language description in here.
[Where problems could occur]
People might end up seeing a wrong translation if other code paths are wrong, but then they'd already see them if they explicitly configured multiple languages and then switched the preferred one.
description: | updated |
tags: | added: fr-1017 |
tags: | removed: rls-hh-incoming |
description: | updated |
Changed in apt (Ubuntu Bionic): | |
status: | New → Confirmed |
Changed in apt (Ubuntu Focal): | |
status: | New → Confirmed |
Changed in apt (Ubuntu Groovy): | |
status: | New → Confirmed |
Changed in apt (Ubuntu Xenial): | |
status: | New → Confirmed |
Changed in apt (Ubuntu Groovy): | |
status: | Confirmed → Triaged |
Changed in apt (Ubuntu Hirsute): | |
status: | Confirmed → Fix Committed |
Changed in apt (Ubuntu Groovy): | |
status: | Triaged → In Progress |
I found that update-manager causes such wrong cache generation. If it fetches updated information about packages during "Checking for updates..." it will generate wrong cache and "apt show" will not display translated descriptions.