summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <egon@bottom>2006-06-06 19:38:22 +0200
committerMichael Vogt <egon@bottom>2006-06-06 19:38:22 +0200
commitd77f118854b7fcd1552272c97a3ddf02080f94c6 (patch)
tree53b3260c735b5808f5f2412284c3eb49758172a4
parent4f5bd4471049f89c4ce52864e62f54aadf1804d4 (diff)
parente0c4f06387ade5761e644b5b96e41284c12da23c (diff)
* fix languages like pt_PT, pt_BR, zh_CN by special casing
-rw-r--r--BUGS1
-rw-r--r--apt-pkg/indexfile.cc7
-rw-r--r--debian/changelog5
3 files changed, 9 insertions, 4 deletions
diff --git a/BUGS b/BUGS
index 6bbc6f839..a7b6b1114 100644
--- a/BUGS
+++ b/BUGS
@@ -6,3 +6,4 @@ DDTP problems:
enviroment or Translations apt variable
- there needs to be a list of locales (pt, sv, en) that need
both language and country code to get the right file
+ (is in the code in indexfile::LanguageCode(), just a bit ugly
diff --git a/apt-pkg/indexfile.cc b/apt-pkg/indexfile.cc
index 496e68b8b..bb2210bf6 100644
--- a/apt-pkg/indexfile.cc
+++ b/apt-pkg/indexfile.cc
@@ -113,11 +113,14 @@ string pkgIndexFile::LanguageCode()
{
string lang = std::setlocale(LC_MESSAGES,NULL);
- // FIXME: this needs to be added
// we have a mapping of the language codes that contains all the language
// codes that need the country code as well
// (like pt_BR, pt_PT, sv_SE, zh_*, en_*)
-
+ char *need_full_langcode[] = { "pt","sv","zh","en", NULL };
+ for(char **s = need_full_langcode;*s != NULL; s++)
+ if(lang.find(*s) == 0)
+ return lang.substr(0,5);
+
if(lang.size() > 2)
return lang.substr(0,2);
else
diff --git a/debian/changelog b/debian/changelog
index 2f7e5f872..83135ec08 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,8 +3,10 @@ apt (0.6.44.1exp1) experimental; urgency=low
* added support for i18n of the package descriptions
* synced with the http://people.debian.org/~mvo/bzr/apt/debian-sid branch
* build from http://people.debian.org/~mvo/bzr/apt/debian-experimental
+ * merged patch from Otavio (thanks!) to better support translations
+ that need the full language-code (like pt_BR)
- -- Michael Vogt <mvo@debian.org> Wed, 1 Mar 2006 13:34:15 +0100
+ -- Michael Vogt <mvo@debian.org> Tue, 6 Jun 2006 19:31:31 +0200
apt (0.6.44.1) unstable; urgency=low
@@ -313,7 +315,6 @@ apt (0.6.38) unstable; urgency=low
-- Matt Zimmerman <mdz@debian.org> Sat, 25 Jun 2005 09:51:00 -0700
->>>>>>> MERGE-SOURCE
apt (0.6.37) breezy; urgency=low
* Merge bubulle@debian.org--2005/apt--main--0 up to patch-81