diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2021-01-27 12:31:05 +0100 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2021-01-27 12:48:58 +0100 |
commit | ccd952cc8793bc6b866f92912ef0bb51c42eb540 (patch) | |
tree | 289d379a6286efb58ae9f789a18b2a84149327aa | |
parent | 5426ad6462c5478592740146bf3ddd11179e52d8 (diff) |
Include all translations when building the cache
We do download all translations we ever downloaded, but we don't add all
of those to the cache, meaning that if we run update with LANG=C, it
might still download your de_DE translation, but it won't insert it into
the cache, causing your de_DE user to not get translated messages.
LP: #1907850
-rw-r--r-- | apt-pkg/deb/deblistparser.cc | 2 | ||||
-rwxr-xr-x | test/integration/test-bug-490000-search-in-all-translations | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index b5c9c066e..d0f0838d0 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -259,7 +259,7 @@ bool debListParser::NewVersion(pkgCache::VerIterator &Ver) // ListParser::AvailableDescriptionLanguages /*{{{*/ std::vector<std::string> debListParser::AvailableDescriptionLanguages() { - std::vector<std::string> const understood = APT::Configuration::getLanguages(); + std::vector<std::string> const understood = APT::Configuration::getLanguages(true); std::vector<std::string> avail; static constexpr int prefixLen = 12; char buf[32] = "Description-"; diff --git a/test/integration/test-bug-490000-search-in-all-translations b/test/integration/test-bug-490000-search-in-all-translations index 3a034bc49..26c16181b 100755 --- a/test/integration/test-bug-490000-search-in-all-translations +++ b/test/integration/test-bug-490000-search-in-all-translations @@ -62,6 +62,19 @@ setupaptarchive # # =========================== +# ---- LP: #1907850 - check that we actually include the translations we have in the cache, even if config changed --- +configure_languages en zz +testsuccess aptcache showpkg ${PKG_NAME} +cp rootdir/tmp/testsuccess.output showpkg.output + +testsuccess grep -qE Translation-zz showpkg.output +rm rootdir/etc/apt/apt.conf.d/languages.conf +rm rootdir/var/cache/apt/*.bin + +testsuccess aptcache showpkg ${PKG_NAME} +cp rootdir/tmp/testsuccess.output showpkg.output +testsuccess grep -qE Translation-zz showpkg.output + # ----------[ apt ]---------- # Test that all translations are searched, but the short |