Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / src / plural-table.c
1 /* Table of known plural form expressions.
2    Copyright (C) 2001-2006, 2009-2010, 2015 Free Software Foundation,
3    Inc.
4    Written by Bruno Haible <haible@clisp.cons.org>, 2002.
5
6    This program is free software: you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 3 of the License, or
9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
18
19 #ifdef HAVE_CONFIG_H
20 # include "config.h"
21 #endif
22
23 /* Specification.  */
24 #include "plural-table.h"
25
26 /* Formulas taken from the documentation, node "Plural forms".  */
27 struct plural_table_entry plural_table[] =
28   {
29     { "ja", "Japanese",          "nplurals=1; plural=0;" },
30     { "vi", "Vietnamese",        "nplurals=1; plural=0;" },
31     { "ko", "Korean",            "nplurals=1; plural=0;" },
32     { "en", "English",           "nplurals=2; plural=(n != 1);" },
33     { "de", "German",            "nplurals=2; plural=(n != 1);" },
34     { "nl", "Dutch",             "nplurals=2; plural=(n != 1);" },
35     { "sv", "Swedish",           "nplurals=2; plural=(n != 1);" },
36     { "da", "Danish",            "nplurals=2; plural=(n != 1);" },
37     { "no", "Norwegian",         "nplurals=2; plural=(n != 1);" },
38     { "nb", "Norwegian Bokmal",  "nplurals=2; plural=(n != 1);" },
39     { "nn", "Norwegian Nynorsk", "nplurals=2; plural=(n != 1);" },
40     { "fo", "Faroese",           "nplurals=2; plural=(n != 1);" },
41     { "es", "Spanish",           "nplurals=2; plural=(n != 1);" },
42     { "pt", "Portuguese",        "nplurals=2; plural=(n != 1);" },
43     { "it", "Italian",           "nplurals=2; plural=(n != 1);" },
44     { "bg", "Bulgarian",         "nplurals=2; plural=(n != 1);" },
45     { "el", "Greek",             "nplurals=2; plural=(n != 1);" },
46     { "fi", "Finnish",           "nplurals=2; plural=(n != 1);" },
47     { "et", "Estonian",          "nplurals=2; plural=(n != 1);" },
48     { "he", "Hebrew",            "nplurals=2; plural=(n != 1);" },
49     { "eo", "Esperanto",         "nplurals=2; plural=(n != 1);" },
50     { "hu", "Hungarian",         "nplurals=2; plural=(n != 1);" },
51     { "tr", "Turkish",           "nplurals=2; plural=(n != 1);" },
52     { "pt_BR", "Brazilian",      "nplurals=2; plural=(n > 1);" },
53     { "fr", "French",            "nplurals=2; plural=(n > 1);" },
54     { "lv", "Latvian",           "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);" },
55     { "ga", "Irish",             "nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2;" },
56     { "ro", "Romanian",          "nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2;" },
57     { "lt", "Lithuanian",        "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);" },
58     { "ru", "Russian",           "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);" },
59     { "uk", "Ukrainian",         "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);" },
60     { "be", "Belarusian",        "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     { "sr", "Serbian",           "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);" },
62     { "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);" },
63     { "cs", "Czech",             "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;" },
64     { "sk", "Slovak",            "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;" },
65     { "pl", "Polish",            "nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);" },
66     { "sl", "Slovenian",         "nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);" }
67   };
68 const size_t plural_table_size = sizeof (plural_table) / sizeof (plural_table[0]);