bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: Bug#428594: msginit: incorrect language team name for zh_CN (fwd)


From: Bruno Haible
Subject: Re: Bug#428594: msginit: incorrect language team name for zh_CN (fwd)
Date: Thu, 28 Jun 2007 13:15:46 +0200
User-agent: KMail/1.5.4

Li Daobing wrote:
> Package: gettext
> Version: 0.16.1-1
> Severity: normal
> 
> Hello,
> 
> when I call "msginit -l zh_CN.utf8", the generated zh_CN.po file is not
> accepted by TP robot because the language team name is not correct.
> following patch is needed to apply on the generated zh_CN.po file
> 
> $ diff zh_CN.po.bak zh_CN.po
> 14c14
> < "Language-Team: Chinese <address@hidden>\n"
> ---
> > "Language-Team: Chinese (simplified) <address@hidden>\n"
> 
> [...]

Thanks for this report. You can use this fix; it will be contained in gettext
0.16.2.

Bruno


2007-06-28  Bruno Haible  <address@hidden>

        * lang-table.h (language_variant_table, language_variant_table_size):
        New declarations.
        * lang-table.c (language_variant_table, language_variant_table_size):
        New variables.
        * msginit.c (language_team_englishname): New function.
        (language_team): Use it instead of englishname_of_language.
        Reported by Li Daobing <address@hidden>.

*** gettext-tools/src/lang-table.h      11 May 2006 18:41:41 -0000      1.2
--- gettext-tools/src/lang-table.h      28 Jun 2007 11:10:33 -0000
***************
*** 1,5 ****
  /* Table of languages.
!    Copyright (C) 2001-2006 Free Software Foundation, Inc.
     Written by Bruno Haible <address@hidden>, 2005.
  
     This program is free software; you can redistribute it and/or modify
--- 1,5 ----
  /* Table of languages.
!    Copyright (C) 2001-2007 Free Software Foundation, Inc.
     Written by Bruno Haible <address@hidden>, 2005.
  
     This program is free software; you can redistribute it and/or modify
***************
*** 30,33 ****
--- 30,36 ----
  extern struct language_table_entry language_table[];
  extern const size_t language_table_size;
  
+ extern struct language_table_entry language_variant_table[];
+ extern const size_t language_variant_table_size;
+ 
  #endif /* _LANG_TABLE_H */
*** gettext-tools/src/lang-table.c      19 Oct 2006 11:54:29 -0000      1.4
--- gettext-tools/src/lang-table.c      28 Jun 2007 11:10:33 -0000
***************
*** 1,5 ****
  /* Table of languages.
!    Copyright (C) 2001-2006 Free Software Foundation, Inc.
     Written by Bruno Haible <address@hidden>, 2005.
  
     This program is free software; you can redistribute it and/or modify
--- 1,5 ----
  /* Table of languages.
!    Copyright (C) 2001-2007 Free Software Foundation, Inc.
     Written by Bruno Haible <address@hidden>, 2005.
  
     This program is free software; you can redistribute it and/or modify
***************
*** 286,288 ****
--- 286,305 ----
      { "zap", "Zapotec" }
    };
  const size_t language_table_size = sizeof (language_table) / sizeof 
(language_table[0]);
+ 
+ /* The language names for variants of languages, according to the catalog name
+    (usually built from the language code and territory code).
+    Should be consistent with the list of languages found on the TP site, see
+    the URL contained in gettext-tools/projects/TP/teams.url.  */
+ struct language_table_entry language_variant_table[] =
+   {
+     { "de_AT", "Austrian" },
+     { "en_GB", "English (British)" },
+     { "es_AR", "Argentinian" },
+     { "es_IC", "Spanish (Canary Islands)" },
+     { "pt_BR", "Brazilian Portuguese" },
+     { "zh_CN", "Chinese (simplified)" },
+     { "zh_HK", "Chinese (Hong Kong)" },
+     { "zh_TW", "Chinese (traditional)" }
+   };
+ const size_t language_variant_table_size = sizeof (language_variant_table) / 
sizeof (language_variant_table[0]);
*** gettext-tools/src/msginit.c 18 Jun 2007 00:32:54 -0000      1.54
--- gettext-tools/src/msginit.c 28 Jun 2007 11:10:33 -0000
***************
*** 1117,1122 ****
--- 1117,1138 ----
  }
  
  
+ /* Return the name of the language used by the language team, in English.  */
+ static const char *
+ language_team_englishname ()
+ {
+   size_t i;
+ 
+   /* Search for a name depending on the catalogname.  */
+   for (i = 0; i < language_variant_table_size; i++)
+     if (strcmp (language_variant_table[i].code, catalogname) == 0)
+       return language_variant_table[i].english;
+ 
+   /* Search for a name depending on the language only.  */
+   return englishname_of_language ();
+ }
+ 
+ 
  /* Return the language team's mailing list address or homepage URL.  */
  static const char *
  language_team_address ()
***************
*** 1185,1191 ****
      return "none";
    else
      {
!       const char *englishname = englishname_of_language ();
        const char *address = language_team_address ();
  
        if (address != NULL && address[0] != '\0')
--- 1201,1207 ----
      return "none";
    else
      {
!       const char *englishname = language_team_englishname ();
        const char *address = language_team_address ();
  
        if (address != NULL && address[0] != '\0')





reply via email to

[Prev in Thread] Current Thread [Next in Thread]