summaryrefslogtreecommitdiff
path: root/src/lang.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-05-13 08:36:08 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-05-13 08:36:08 +0300
commit47111d6da444a8370e14ff62a7f6b9ee396c1a24 (patch)
treef26310202505c8f6481a3abbe64e248270ee2828 /src/lang.c
parent2363eac97aa03db8147d353a145e24aa64d9957c (diff)
Lang: Added Polish UI translation
IssueID #192
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;