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

Bug#389261: #389261: [patch] Progress strings not translated when using APT::Status-Fd option



tags 389261 + l10n patch
thanks

Steinar Gunderson (sesse) has produced a patch for this issue which I have 
successfully tested.

As I understand it, "fetching" translations will not work if they are 
defined in a static const struct. This is resolved by defining them in 
the struct with the no-op "N_" and doing the actual translation later.

After applying the patch; updating the PO-files, translating the relevant 
strings for Dutch and compiling the new version, the output now looks as 
follows. When running tasksel, the strings now also show translated.


Pakketlijsten worden ingelezen...
Boom van vereisten wordt opgebouwd...
Uitgebreide statusinformatie aan het lezen...
Initialiseren van pakketstatussen...
Lezen van taakbeschrijvingen...
Opbouwen van tagdatabase...
De volgende NIEUWE pakketten zullen automatisch worden geïnstalleerd:
  libatm1
De volgende NIEUWE pakketten zullen worden geïnstalleerd:
  iproute libatm1
0 pakketten opgewaardeerd, 2 nieuwe geïnstalleerd, 0 te verwijderen en 0 
niet opwaarderen.
Heb 0B/1115kB archieven nodig. Na uitpakken zal 1720kB worden gebruikt.
Schrijven van uitgebreide statusinformatie...
Selecteren van voorheen niet geselecteerd pakket libatm1.
(Database inlezen ... 30646 bestanden en mappen geïnstalleerd.)
Uitpakken van libatm1 (uit .../libatm1_2.4.1-17_i386.deb) ...
pmstatus:libatm1:10:Bezig met voorbereiden van libatm1
pmstatus:libatm1:20:Bezig met uitpakken van libatm1
pmstatus:libatm1:30:Configureren van libatm1 wordt voorbereid
Selecteren van voorheen niet geselecteerd pakket iproute.
Uitpakken van iproute (uit .../iproute_20051007-4_i386.deb) ...
pmstatus:iproute:40:Bezig met voorbereiden van iproute
pmstatus:iproute:50:Bezig met uitpakken van iproute
pmstatus:iproute:60:Configureren van iproute wordt voorbereid
Instellen van libatm1 (2.4.1-17) ...
pmstatus:libatm1:70:Bezig met configureren van libatm1

pmstatus:libatm1:80:libatm1 is geïnstalleerd
Instellen van iproute (20051007-4) ...
pmstatus:iproute:90:Bezig met configureren van iproute
pmstatus:iproute:100:iproute is geïnstalleerd
diff -ur apt-0.6.46/apt-pkg/deb/dpkgpm.cc apt-0.6.46.patched/apt-pkg/deb/dpkgpm.cc
--- apt-0.6.46/apt-pkg/deb/dpkgpm.cc	2006-07-25 13:19:00.000000000 +0200
+++ apt-0.6.46.patched/apt-pkg/deb/dpkgpm.cc	2006-09-24 23:06:23.000000000 +0200
@@ -355,28 +355,28 @@
    static const struct DpkgState DpkgStatesOpMap[][5] = {
       // Install operation
       { 
-	 {"half-installed", _("Preparing %s")}, 
-	 {"unpacked", _("Unpacking %s") }, 
+	 {"half-installed", N_("Preparing %s")}, 
+	 {"unpacked", N_("Unpacking %s") }, 
 	 {NULL, NULL}
       },
       // Configure operation
       { 
-	 {"unpacked",_("Preparing to configure %s") },
-	 {"half-configured", _("Configuring %s") },
-	 { "installed", _("Installed %s")},
+	 {"unpacked",N_("Preparing to configure %s") },
+	 {"half-configured", N_("Configuring %s") },
+	 { "installed", N_("Installed %s")},
 	 {NULL, NULL}
       },
       // Remove operation
       { 
-	 {"half-configured", _("Preparing for removal of %s")},
-	 {"half-installed", _("Removing %s")},
-	 {"config-files",  _("Removed %s")},
+	 {"half-configured", N_("Preparing for removal of %s")},
+	 {"half-installed", N_("Removing %s")},
+	 {"config-files",  N_("Removed %s")},
 	 {NULL, NULL}
       },
       // Purge operation
       { 
-	 {"config-files", _("Preparing to completely remove %s")},
-	 {"not-installed", _("Completely removed %s")},
+	 {"config-files", N_("Preparing to completely remove %s")},
+	 {"not-installed", N_("Completely removed %s")},
 	 {NULL, NULL}
       },
    };
@@ -670,7 +670,7 @@
 	 {
 	    // only read the translation if there is actually a next
 	    // action
-	    const char *translation = states[PackageOpsDone[pkg]].str;
+	    const char *translation = _(states[PackageOpsDone[pkg]].str);
 	    char s[200];
 	    snprintf(s, sizeof(s), translation, pkg);
 
Only in apt-0.6.46.patched: build
diff -ur apt-0.6.46/buildlib/apti18n.h.in apt-0.6.46.patched/buildlib/apti18n.h.in
--- apt-0.6.46/buildlib/apti18n.h.in	2006-03-02 14:29:56.000000000 +0100
+++ apt-0.6.46.patched/buildlib/apti18n.h.in	2006-09-24 22:56:43.000000000 +0200
@@ -14,8 +14,10 @@
 # else
 #   define _(x) gettext(x)
 # endif
+# define N_(x) x
 #else
 // apt will not use any gettext
 # define setlocale(a, b)
 # define _(x) x
+# define N_(x) x
 #endif

Attachment: pgpUaOaVQKYR2.pgp
Description: PGP signature


Reply to: