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

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

Gettext plural forms for Irish


From: Kevin Scannell
Subject: Gettext plural forms for Irish
Date: Mon, 9 Jul 2007 07:56:57 -0500

The gettext documentation says that Irish has three plural forms, with
special cases for one and two.   This is not general enough for our
purposes though, and in practice we've been using 5 plural forms.
This is seen even in common examples, like translating "%d items" or
"%d things", which behaves like this:

one: "ceann amháin"
two: "dhá cheann"
3-6: "%d cinn"
7-10: "%d gcinn"
11+: "%d ceann"

We made this change in KDE about two years ago
(http://bugs.kde.org/show_bug.cgi?id=96127) and this has been standard
practice with the GNU TP for at least that long
(http://translationproject.org/team/ga.html)

I've created a patch below, to the documentation and plural-forms.c.
I didn't see anywhere else that needed tweaking.  Thanks!

Kevin Scannell




diff -u -r gettext-0.16.1/gettext-tools/doc/gettext.texi
gettext-modified/gettext-tools/doc/gettext.texi
--- gettext-0.16.1/gettext-tools/doc/gettext.texi       2006-11-27
11:02:01.000000000 -0600
+++ gettext-modified/gettext-tools/doc/gettext.texi     2007-07-09
07:33:50.000000000 -0500
@@ -5438,21 +5438,6 @@
Latvian
@end table

address@hidden Three forms, special cases for one and two
-The header entry would be:
-
address@hidden
-Plural-Forms: nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2;
address@hidden smallexample
-
address@hidden
-Languages with this property include:
-
address@hidden @asis
address@hidden Celtic
-Gaeilge (Irish)
address@hidden table
-
@item Three forms, special case for numbers ending in 00 or [2-9][0-9]
The header entry would be:

@@ -5551,6 +5536,21 @@
@item Slavic family
Slovenian
@end table
+
address@hidden Five forms, special cases for one, two, three through six, and
seven through ten
+The header entry would be:
+
address@hidden
+Plural-Forms: nplurals=5; plural=(n==1 ? 0 : n==2 ? 1 : (n>=3 &&
n<=6) ? 2 : (n>=7 && n<=10) ? 3 : 4;
address@hidden smallexample
+
address@hidden
+Languages with this property include:
+
address@hidden @asis
address@hidden Celtic
+Gaeilge (Irish)
address@hidden table
@end table

You might now ask, @code{ngettext} handles only numbers @var{n} of type
diff -u -r gettext-0.16.1/gettext-tools/src/plural-table.c
gettext-modified/gettext-tools/src/plural-table.c
--- gettext-0.16.1/gettext-tools/src/plural-table.c     2006-11-27
11:02:08.000000000 -0600
+++ gettext-modified/gettext-tools/src/plural-table.c   2007-07-08
15:25:09.000000000 -0500
@@ -51,7 +51,6 @@
    { "fr", "French",            "nplurals=2; plural=(n > 1);" },
    { "pt_BR", "Brazilian",      "nplurals=2; plural=(n > 1);" },
    { "lv", "Latvian",           "nplurals=3; plural=(n%10==1 &&
n%100!=11 ? 0 : n != 0 ? 1 : 2);" },
-    { "ga", "Irish",             "nplurals=3; plural=n==1 ? 0 : n==2
? 1 : 2;" },
    { "ro", "Romanian",          "nplurals=3; plural=n==1 ? 0 : (n==0
|| (n%100 > 0 && n%100 < 20)) ? 1 : 2;" },
    { "lt", "Lithuanian",        "nplurals=3; plural=(n%10==1 &&
n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);" },
    { "hr", "Croatian",          "nplurals=3; plural=(n%10==1 &&
n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 :
2);" },
@@ -61,6 +60,7 @@
    { "sk", "Slovak",            "nplurals=3; plural=(n==1) ? 0 :
(n>=2 && n<=4) ? 1 : 2;" },
    { "cs", "Czech",             "nplurals=3; plural=(n==1) ? 0 :
(n>=2 && n<=4) ? 1 : 2;" },
    { "pl", "Polish",            "nplurals=3; plural=(n==1 ? 0 :
n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);" },
-    { "sl", "Slovenian",         "nplurals=4; plural=(n%100==1 ? 0 :
n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);" }
+    { "sl", "Slovenian",         "nplurals=4; plural=(n%100==1 ? 0 :
n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);" },
+    { "ga", "Irish",             "nplurals=5; plural=(n==1 ? 0 : n==2
? 1 : (n>=3 && n<=6) ? 2 : (n>=7 && n<=10) ? 3 : 4;" }
  };
const size_t plural_table_size = sizeof (plural_table) / sizeof
(plural_table[0]);

reply via email to

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