[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#265009: additonal data



Hi,

I tested the patch with 

deb ftp://ftp.leo.org/debian-ddtp/ sarge main

in my sources.list. It does not work with the current common locale
settings. I attached a addtional patch that is a first fix so that the
correct translation file is downloaded. It still is not perfect but it
highlights the problem pretty well. Basicly
pkgIndexFile::CheckLanguageCode() and pkgIndexFile::LanguageCode()
needs to be fixed. apt-cache shows correct translations after that. 
The attached patches is a start.

It seems not behave transparently to the applications build on top of
apt. I tested it with synaptic and only got english translations. This
will need fixing as well.

bye,
 Michael


-- 
The first rule of holes is: when you find yourself in one, stop digging. - PJ
Linux is not The Answer. Yes is the answer. Linux is The Question. - Neo
diff -u apt-pkg/indexfile.cc apt-pkg/indexfile.cc
--- apt-pkg/indexfile.cc	11 Aug 2004 13:32:45 -0000
+++ apt-pkg/indexfile.cc	12 Aug 2004 09:29:15 -0000
@@ -94,6 +94,12 @@
 // IndexFile::CheckLanguageCode - Check the Language Code   	        /*{{{*/
 // ---------------------------------------------------------------------
 /* */
+/* common cases: de_DE, de_DE@euro, de_DE.UTF-8, de_DE.UTF-8@euro,
+                 de_DE.ISO8859-1, tig_ER
+                 more in /etc/gdm/locale.conf 
+		 approach: just get the first letter before the underscore?!?
+*/
+
 bool pkgIndexFile::CheckLanguageCode(const char *Lang)
 {
   if (strlen(Lang) == 2 || (strlen(Lang) == 5 && Lang[2] == '_'))
@@ -112,8 +118,13 @@
 {
   const string Translation = _config->Find("APT::Acquire::Translation");
 
-  if (Translation.compare("environment") == 0)
-     return std::setlocale(LC_MESSAGES,NULL);
+  if (Translation.compare("environment") == 0) {
+     string lang = std::setlocale(LC_MESSAGES,NULL);
+     if(lang.size() > 2)
+	return lang.substr(0,2);
+     else
+	return lang;
+  }
   else 
      return Translation;
 }

Reply to: