Prechádzať zdrojové kódy

* fix languages like pt_PT, pt_BR, zh_CN by special casing

Michael Vogt 20 rokov pred
rodič
commit
d77f118854
3 zmenil súbory, kde vykonal 9 pridanie a 4 odobranie
  1. 1 0
      BUGS
  2. 5 2
      apt-pkg/indexfile.cc
  3. 3 2
      debian/changelog

+ 1 - 0
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 

+ 5 - 2
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

+ 3 - 2
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