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

Bug#624150: marked as done (www.debian.org: Please use iso-codes to translate language and country names)



Your message dated Wed, 27 Apr 2011 13:34:47 -0400
with message-id <4DB853B7.60709@tilapin.org>
and subject line Re: Bug#624150: www.debian.org: Please use iso-codes to translate language and country names
has caused the Debian Bug report #624150,
regarding www.debian.org: Please use iso-codes to translate language and country names
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
624150: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=624150
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: www.debian.org
Severity: wishlist
Tags: patch l10n
User: www.debian.org@packages.debian.org
Usertags: scripts international

Hi,

It would be pointless to fix all #556394-like bug one language at a
time, and since those translations already exists, there is no point
to ask each translators team to provide those translations again.

Moreover, Locale::Language is not complete in regard to ISO 639-3.

In order to apply the following patch, isoquery and iso-codes must be
installed on wolkenstein.

I'll continue to prepare patches for other parts of the website that
rely on internal translation unless someone objects. The last three
changes are unrelated: Alexander Reshetov suggested to get rid of the
parenthesis and I tend to agree. I also wonder if we shouldn't separate
the language of the country by a simple dash (like in French), instead
of using a (translatable) “, as spoken in” form, which may lead to
problems in some languages (see #444965). Please note that the build
process of intl/l10n would take more time, probably because of the
external call to isoquery, but it's only built once a day.

Result (in every available language) is available online, if my ISP
does its job:

	http://www.tilapin.org/debian/intl/l10n/po/

Regards

David

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (600, 'unstable'), (500, 'oldstable'), (500, 'stable'), (150, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.38-2-amd64 (SMP w/1 CPU core)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

*** /tmp/dtc.def.patch
Index: english/international/l10n/dtc.def
===================================================================
RCS file: /cvsroot/webwml/webwml/english/international/l10n/dtc.def,v
retrieving revision 1.50
diff -u -r1.50 dtc.def
--- english/international/l10n/dtc.def	18 Sep 2008 21:12:58 -0000	1.50
+++ english/international/l10n/dtc.def	26 Apr 2011 01:26:53 -0000
@@ -1,4 +1,3 @@
-#use wml::debian::language_names
 #use wml::debian::common_tags
 
 <bind-gettext-domain domain="l10n" />
@@ -139,38 +138,45 @@
 </table>
 </define-tag>
 
-#use wml::debian::language_names
-
 <:
 use lib '$(ENGLISHDIR)/../Perl';
 use Locale::Language;
-use Locale::Country;
+use Locale::gettext;
 
 sub language_name {
         my $lang=shift;
         my $country=undef;
+	my $loc=language2code($(CUR_LANG));
 
+	$lang  =~ s/@.*$//;
         if ($lang =~ m,^(..)_(..)$,) {
                 $lang=$1;
                 $country=$2;
         }
-        # Looking for something like $trans{'de'}{'finnish'}
-        # Translations in wml::debian::language_names
-        if (defined ($trans{language2code($(CUR_LANG))}{lc(code2language($lang))})) {
-	        $lang = $trans{language2code($(CUR_LANG))}{lc(code2language($lang))};
+        if (`isoquery -i 639-3 --name $lang 2>/dev/null`) {
+		# isoquery fails for unavailable locale, included en, see #624147
+		if ($loc eq 'en'){
+			$lang = `isoquery -i 639-3 -n $lang`;
+		}
+		else {
+			$lang = `isoquery -i 639-3 -l $loc -n $lang`;
+		}
+		chomp $lang;
+		$lang =~ s/^.*\t//g;
         } else {
-                $lang = code2language($lang) or return qq(<Unknown_Language>);
+                return qq(<Unknown_Language>);
         }
         if (defined $country) {
-	        $country=uc($country);
-	        # Looking for something like $countries{'AT'}{'FI'} (for _AT in finnish
-                if (defined ($countries{$country}{uc(language2code($(CUR_LANG)))})) {
-		        $country=$countries{$country}{uc(language2code($(CUR_LANG)))};
-                } elsif (defined ($countries{$country}{'EN'})) {
-	                $country=$countries{$country}{'EN'};
-                } elsif (defined (code2country($country))) {
-	 	        $country=code2country($country);
+		if (`isoquery --name $country 2>/dev/null`) {
+			if ($loc eq 'en'){
+				$country = `isoquery --name $country`;
+			}
+			else {
+				$country = `isoquery -l $loc --name $country`;
+			}
                 }
+		chomp $country;
+		$country =~ s/^.*\t//g;
 	        return "<langcountryoutput $lang $country>";
         } else {
                 return $lang;
@@ -196,7 +202,7 @@
 close(LANGS);
 print "<ul>\n" if (@po4alangs);
 foreach my $l (sort @po4alangs) {
-        print "<li>$l (<a href=\"$l\">".language_name($l)."</a>)</li>\n";
+        print "<li>$l &mdash; <a href=\"$l\">".language_name($l)."</a></li>\n";
 }
 print "</ul>\n" if (@po4alangs);
 :>
@@ -232,7 +238,7 @@
 close(LANGS);
 print "<ul>\n" if (@polangs);
 foreach my $l (sort @polangs) {
-        print "<li>$l (<a href=\"$l\">".language_name($l)."</a>)</li>\n";
+        print "<li>$l &mdash; <a href=\"$l\">".language_name($l)."</a></li>\n";
 }
 print "</ul>\n" if (@polangs);
 :>
@@ -268,7 +274,7 @@
 close(LANGS);
 print "<ul>\n" if (@podebconflangs);
 foreach my $l (sort @podebconflangs) {
-        print "<li>$l (<a href=\"$l\">".language_name($l)."</a>)</li>\n";
+        print "<li>$l &mdash; <a href=\"$l\">".language_name($l)."</a></li>\n";
 }
 print "</ul>\n" if (@podebconflangs);
 :>



--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Le 25/04/2011 23:04, David Prévot a écrit :

> In order to apply the following patch, isoquery and iso-codes must be
> installed on wolkenstein.

Thanks to Stephen Gran who took care quickly of [rt.debian.org #3132], I
just applied the patch, and will continue to get rid of other use of
language_names.wml when possible.

Regards

David

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBCAAGBQJNuFO1AAoJELgqIXr9/gnyzUwP/0U8oK8on3g6rC0u/0HaV/bs
TP6jGYvVyhYM8HzGoIWm1RFAWShCDas3G8/Z9qAdoqQngDWTTRmuBC0fCojd11An
ixbgV/Wm1TnCrdd8LyhGyd597PlPiHriBNaRxjwGz+ftKtQmO2P3oQbQNkinjYu5
3dxpUa6l928iM7B8IbUQ9lMq2vbqS6BTZt8IWioGzI1YLIA25zEoJeM2B/ZDVdJP
kRQmsaafnqPB/iuAmtGlzTrYJYiBNLCu3vWWK0kF5MgUvhi0MT9inb1ezLgU1NFX
QlJYkHs9CqiJajj6CfHbCTjMLDxI2H/CMbVEFGBm7m8LDwxR8xpi+0ZR5CPKGAZz
ASbnVBcsbPHx1UtdizFzxRx7pR0vQRTFO4rN5xkmEjhXbeJKA5JOs/QYXh20NWTu
20idGBkD+1CpQq31v8GJhD0R7RY+v7dx5d+LsRPW1pGsRPundR2gBBgKQW4HJC+V
nQcWeCsuJ0WKU80IaICxE9LwOxTVfCi/rPkfezZuOId25Up5+OgR/ETdWMargRXZ
FXSgraoVyHVVhMWHwjGQH9dsgjrVhRwCQAKoL2BY0LX0qTMFCK3jXrCPCDs9Audl
kZ8/SONwav0aTUqbVEJvlssHpPwSu+JevFbzhJXmDSb7YLojzGm6+FsjrbXCMNJq
T8/1KyE5JhNfHw2MqHc2
=0Auj
-----END PGP SIGNATURE-----


--- End Message ---

Reply to: