+2007-06-28 Bruno Haible <bruno@clisp.org>
+
+ * 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 <lidaobing@gmail.com>.
+
2007-06-25 Bruno Haible <bruno@clisp.org>
Change boundary of extracted comments.
/* Table of languages.
- Copyright (C) 2001-2006 Free Software Foundation, Inc.
+ Copyright (C) 2001-2007 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2005.
This program is free software; you can redistribute it and/or modify
{ "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]);
/* Table of languages.
- Copyright (C) 2001-2006 Free Software Foundation, Inc.
+ Copyright (C) 2001-2007 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2005.
This program is free software; you can redistribute it and/or modify
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 */
{
size_t i;
- for (i = 0; i < language_table_size; i ++)
+ for (i = 0; i < language_table_size; i++)
if (strcmp (language_table[i].code, language) == 0)
return language_table[i].english;
}
+/* 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 ()
return "none";
else
{
- const char *englishname = englishname_of_language ();
+ const char *englishname = language_team_englishname ();
const char *address = language_team_address ();
if (address != NULL && address[0] != '\0')