summaryrefslogtreecommitdiff
path: root/src/lang.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lang.c')
-rw-r--r--src/lang.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lang.c b/src/lang.c
index cd5d3120..4c05647c 100644
--- a/src/lang.c
+++ b/src/lang.c
@@ -44,6 +44,7 @@ int cmp_MsgStr_(const void *e1, const void *e2) {
44enum iPluralType { 44enum iPluralType {
45 none_PluralType, 45 none_PluralType,
46 notEqualToOne_PluralType, 46 notEqualToOne_PluralType,
47 polish_PluralType,
47 slavic_PluralType, 48 slavic_PluralType,
48}; 49};
49 50
@@ -58,6 +59,10 @@ static size_t pluralIndex_Lang_(const iLang *d, int n) {
58 switch (d->pluralType) { 59 switch (d->pluralType) {
59 case notEqualToOne_PluralType: 60 case notEqualToOne_PluralType:
60 return n != 1; 61 return n != 1;
62 case polish_PluralType:
63 return n == 1 ? 0
64 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1
65 : 2;
61 case slavic_PluralType: 66 case slavic_PluralType:
62 return n % 10 == 1 && n % 100 != 11 ? 0 67 return n % 10 == 1 && n % 100 != 11 ? 0
63 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 68 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1
@@ -81,6 +86,7 @@ static void load_Lang_(iLang *d, const char *id) {
81 : equal_CStr(id, "de") ? &blobDe_Embedded 86 : equal_CStr(id, "de") ? &blobDe_Embedded
82 : equal_CStr(id, "ia") ? &blobIa_Embedded 87 : equal_CStr(id, "ia") ? &blobIa_Embedded
83 : equal_CStr(id, "ie") ? &blobIe_Embedded 88 : equal_CStr(id, "ie") ? &blobIe_Embedded
89 : equal_CStr(id, "pl") ? &blobPl_Embedded
84 : equal_CStr(id, "sr") ? &blobSr_Embedded 90 : equal_CStr(id, "sr") ? &blobSr_Embedded
85 : equal_CStr(id, "tok") ? &blobTok_Embedded 91 : equal_CStr(id, "tok") ? &blobTok_Embedded
86 : equal_CStr(id, "zh_Hans") ? &blobZh_Hans_Embedded 92 : equal_CStr(id, "zh_Hans") ? &blobZh_Hans_Embedded
@@ -89,6 +95,9 @@ static void load_Lang_(iLang *d, const char *id) {
89 if (data == &blobRu_Embedded || data == &blobSr_Embedded) { 95 if (data == &blobRu_Embedded || data == &blobSr_Embedded) {
90 d->pluralType = slavic_PluralType; 96 d->pluralType = slavic_PluralType;
91 } 97 }
98 else if (data == &blobPl_Embedded) {
99 d->pluralType = polish_PluralType;
100 }
92 else if (data == &blobZh_Hans_Embedded || data == &blobZh_Hant_Embedded || 101 else if (data == &blobZh_Hans_Embedded || data == &blobZh_Hant_Embedded ||
93 data == &blobTok_Embedded) { 102 data == &blobTok_Embedded) {
94 d->pluralType = none_PluralType; 103 d->pluralType = none_PluralType;