On Sun, Feb 19, 2006 at 10:43:40PM +0100, Ruben Porras wrote:
> Am Mittwoch, den 08.02.2006, 23:07 +0100 schrieb Jens Seidel:
> > msgid "Encoding of README|UTF-8"
> > msgstr "UTF-8"
> > 
> > without effect. After reinstalling version 0.4.1-1 from the archive it
> > works again.
> 
> So, Daniel, it seems that you need to check this regression.

I found it. As usual only two or three lines of code are effected.
Here is the patch:

--- old-aptitude/src/aptitude.h 2006-02-21 21:24:56.000000000 +0100
+++ new-aptitude/src/aptitude.h 2006-02-21 21:24:56.000000000 +0100
@@ -29,8 +29,8 @@
 # define _(Text) gettext (Text)
 # define N_(Text) Text
 
-/** Strips everything up to and includeing the first pipe character
- *  from the string.  Strings without a pipe character are unchanged.
+/** Strips everything up to and including the first pipe character
+ *  from the translated string.  Translations without a pipe character are 
unchanged.
  */
 #ifdef __GNUG__
 __attribute__ ((format_arg(1)))
@@ -41,7 +41,7 @@
   const char * const stripto = strchr(translation, '|');
 
   if(stripto == NULL)
-    return Text;
+    return translation;
   else
     return stripto+1;
 }
@@ -53,7 +53,11 @@
 # define textdomain(Domain) /* empty */
 # define _(Text) Text
 # define N_(Text) Text
-# define P_(Text) Text
+inline const char *P_(const char *Text)
+{
+  const char * const stripto = strchr(Text, '|');
+  return stripto+1;
+}
 # define gettext(Text) Text
 # define dgettext(Domain, Text) Text
 #endif

> -  const char *encoding=P_("Encoding of README|UTF-8");
> +  const char *encoding=P_("Encoding of README|ISO_8859-1");

The old version didn't support a translation into "UTF-8" or similar
without "|". Other languages such as Italian were effected as well.
The old code failed also with NLS support disabled.

Jens


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to