summaryrefslogtreecommitdiff
path: root/src
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
parent2363eac97aa03db8147d353a145e24aa64d9957c (diff)
Lang: Added Polish UI translation
IssueID #192
Diffstat (limited to 'src')
-rw-r--r--src/lang.c9
-rw-r--r--src/ui/util.c1
2 files changed, 10 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;
diff --git a/src/ui/util.c b/src/ui/util.c
index 2d4bd628..7156b445 100644
--- a/src/ui/util.c
+++ b/src/ui/util.c
@@ -2268,6 +2268,7 @@ iWidget *makePreferences_Widget(void) {
2268 { "${lang.fr} - fr", 0, 0, "uilang id:fr" }, 2268 { "${lang.fr} - fr", 0, 0, "uilang id:fr" },
2269 { "${lang.ia} - ia", 0, 0, "uilang id:ia" }, 2269 { "${lang.ia} - ia", 0, 0, "uilang id:ia" },
2270 { "${lang.ie} - ie", 0, 0, "uilang id:ie" }, 2270 { "${lang.ie} - ie", 0, 0, "uilang id:ie" },
2271 { "${lang.pl} - pl", 0, 0, "uilang id:pl" },
2271 { "${lang.ru} - ru", 0, 0, "uilang id:ru" }, 2272 { "${lang.ru} - ru", 0, 0, "uilang id:ru" },
2272 { "${lang.sr} - sr", 0, 0, "uilang id:sr" }, 2273 { "${lang.sr} - sr", 0, 0, "uilang id:sr" },
2273 { "${lang.tok} - tok", 0, 0, "uilang id:tok" }, 2274 { "${lang.tok} - tok", 0, 0, "uilang id:tok" },