Skip to content

Commit a534ae7

Browse files
authored
MCKIN-17536: add korean translations (#77)
* add korean translations * bump version * fix tests * cleanup * add comment
1 parent da2d8fd commit a534ae7

File tree

9 files changed

+487
-294
lines changed

9 files changed

+487
-294
lines changed

poll/poll.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def i18n_service(self):
8282
def get_translation_content(self):
8383
try:
8484
return self.resource_string('public/js/translations/{lang}/textjs.js'.format(
85-
lang=utils.translation.get_language(),
85+
lang=utils.translation.to_locale(utils.translation.get_language()),
8686
))
8787
except IOError:
8888
return self.resource_string('public/js/translations/en/textjs.js')

poll/public/js/translations/ko_KR/textjs.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,28 @@
1616

1717
django.catalog = django.catalog || {};
1818

19+
var newcatalog = {
20+
"Answer": "\ub2f5\ubcc0",
21+
"Delete": "\uc0ad\uc81c",
22+
"Feedback": "\ud53c\ub4dc\ubc31",
23+
"Image URL": "\uc774\ubbf8\uc9c0 URL",
24+
"Image alternative text": "\uc774\ubbf8\uc9c0 \ub300\uccb4 \ud14d\uc2a4\ud2b8",
25+
"Question": "\uc9c8\ubb38",
26+
"Results": "\uacb0\uacfc",
27+
"Results gathered from {total} respondent.": [
28+
"\ucd1d {total}\uba85\uc758 \uc751\ub2f5\uc790\ub85c\ubd80\ud130 \uc218\uc9d1\ud55c \uacb0\uacfc\uc785\ub2c8\ub2e4.",
29+
"\ucd1d {total}\uba85\uc758 \uc751\ub2f5\uc790\ub85c\ubd80\ud130 \uc218\uc9d1\ud55c \uacb0\uacfc\uc785\ub2c8\ub2e4."
30+
],
31+
"Submit": "\uc81c\ucd9c",
32+
"This must have an image URL or text, and can have both. If you add an image, you must also provide an alternative text that describes the image in a way that would allow someone to answer the poll if the image did not load.": "\uc774\ubbf8\uc9c0 URL \ub610\ub294 \ud14d\uc2a4\ud2b8 \uc911 \ud558\ub098\ub294 \uc788\uc5b4\uc57c \ud558\uba70 \ub458 \ub2e4 \uc788\uc5b4\ub3c4 \ub429\ub2c8\ub2e4. \uc774\ubbf8\uc9c0\ub97c \ucd94\uac00\ud558\ub294 \uacbd\uc6b0, \uc774\ubbf8\uc9c0\uac00 \ub85c\ub4dc\ub418\uc9c0 \uc54a\ub354\ub77c\ub3c4 \ub204\uad6c\ub4e0\uc9c0 \ud22c\ud45c\uc5d0 \ucc38\uc5ec\ud560 \uc218 \uc788\ub3c4\ub85d \uc774\ubbf8\uc9c0\ub97c \uc124\uba85\ud558\ub294 \ub300\uccb4 \ud14d\uc2a4\ud2b8\ub3c4 \uc81c\uacf5\ud574\uc57c \ud569\ub2c8\ub2e4.",
33+
"You can make limited use of Markdown in answer texts, preferably only bold and italics.": "Markdown\uc740 \ub2f5\ubcc0 \ud14d\uc2a4\ud2b8\uc5d0\uc11c \uc81c\ud55c\uc801\uc73c\ub85c \uc0ac\uc6a9\ud560 \uc218 \uc788\uc73c\uba70 \ubcfc\ub4dc\uccb4 \ubc0f \uc774\ud0e4\ub9ad\uccb4\ub9cc \uc0ac\uc6a9\ud558\ub294 \uac83\uc774 \uc88b\uc2b5\ub2c8\ub2e4.",
34+
"move poll down": "\ud22c\ud45c \ub0b4\ub9ac\uae30",
35+
"move poll up": "\ud22c\ud45c \uc62c\ub9ac\uae30"
36+
};
37+
for (var key in newcatalog) {
38+
django.catalog[key] = newcatalog[key];
39+
}
40+
1941

2042
if (!django.jsi18n_initialized) {
2143
django.gettext = function(msgid) {

poll/public/js/translations/ko_kr/text.js

Lines changed: 0 additions & 113 deletions
This file was deleted.

poll/public/js/translations/ko_kr/textjs.js

Lines changed: 94 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,90 @@
44
init: function() {
55

66

7-
(function (globals) {
7+
(function(globals) {
88

99
var django = globals.django || (globals.django = {});
1010

1111

12-
django.pluralidx = function (count) { return (count == 1) ? 0 : 1; };
12+
django.pluralidx = function(count) { return (count == 1) ? 0 : 1; };
1313

1414

15-
16-
/* gettext identity library */
15+
/* gettext library */
1716

18-
django.gettext = function (msgid) { return msgid; };
19-
django.ngettext = function (singular, plural, count) { return (count == 1) ? singular : plural; };
20-
django.gettext_noop = function (msgid) { return msgid; };
21-
django.pgettext = function (context, msgid) { return msgid; };
22-
django.npgettext = function (context, singular, plural, count) { return (count == 1) ? singular : plural; };
17+
django.catalog = django.catalog || {};
2318

24-
25-
django.interpolate = function (fmt, obj, named) {
26-
if (named) {
27-
return fmt.replace(/%\(\w+\)s/g, function(match){return String(obj[match.slice(2,-2)])});
28-
} else {
29-
return fmt.replace(/%s/g, function(match){return String(obj.shift())});
30-
}
19+
var newcatalog = {
20+
"Answer": "\ub2f5\ubcc0",
21+
"Delete": "\uc0ad\uc81c",
22+
"Feedback": "\ud53c\ub4dc\ubc31",
23+
"Image URL": "\uc774\ubbf8\uc9c0 URL",
24+
"Image alternative text": "\uc774\ubbf8\uc9c0 \ub300\uccb4 \ud14d\uc2a4\ud2b8",
25+
"Question": "\uc9c8\ubb38",
26+
"Results": "\uacb0\uacfc",
27+
"Results gathered from {total} respondent.": [
28+
"\ucd1d {total}\uba85\uc758 \uc751\ub2f5\uc790\ub85c\ubd80\ud130 \uc218\uc9d1\ud55c \uacb0\uacfc\uc785\ub2c8\ub2e4.",
29+
"\ucd1d {total}\uba85\uc758 \uc751\ub2f5\uc790\ub85c\ubd80\ud130 \uc218\uc9d1\ud55c \uacb0\uacfc\uc785\ub2c8\ub2e4."
30+
],
31+
"Submit": "\uc81c\ucd9c",
32+
"This must have an image URL or text, and can have both. If you add an image, you must also provide an alternative text that describes the image in a way that would allow someone to answer the poll if the image did not load.": "\uc774\ubbf8\uc9c0 URL \ub610\ub294 \ud14d\uc2a4\ud2b8 \uc911 \ud558\ub098\ub294 \uc788\uc5b4\uc57c \ud558\uba70 \ub458 \ub2e4 \uc788\uc5b4\ub3c4 \ub429\ub2c8\ub2e4. \uc774\ubbf8\uc9c0\ub97c \ucd94\uac00\ud558\ub294 \uacbd\uc6b0, \uc774\ubbf8\uc9c0\uac00 \ub85c\ub4dc\ub418\uc9c0 \uc54a\ub354\ub77c\ub3c4 \ub204\uad6c\ub4e0\uc9c0 \ud22c\ud45c\uc5d0 \ucc38\uc5ec\ud560 \uc218 \uc788\ub3c4\ub85d \uc774\ubbf8\uc9c0\ub97c \uc124\uba85\ud558\ub294 \ub300\uccb4 \ud14d\uc2a4\ud2b8\ub3c4 \uc81c\uacf5\ud574\uc57c \ud569\ub2c8\ub2e4.",
33+
"You can make limited use of Markdown in answer texts, preferably only bold and italics.": "Markdown\uc740 \ub2f5\ubcc0 \ud14d\uc2a4\ud2b8\uc5d0\uc11c \uc81c\ud55c\uc801\uc73c\ub85c \uc0ac\uc6a9\ud560 \uc218 \uc788\uc73c\uba70 \ubcfc\ub4dc\uccb4 \ubc0f \uc774\ud0e4\ub9ad\uccb4\ub9cc \uc0ac\uc6a9\ud558\ub294 \uac83\uc774 \uc88b\uc2b5\ub2c8\ub2e4.",
34+
"move poll down": "\ud22c\ud45c \ub0b4\ub9ac\uae30",
35+
"move poll up": "\ud22c\ud45c \uc62c\ub9ac\uae30"
3136
};
37+
for (var key in newcatalog) {
38+
django.catalog[key] = newcatalog[key];
39+
}
40+
3241

42+
if (!django.jsi18n_initialized) {
43+
django.gettext = function(msgid) {
44+
var value = django.catalog[msgid];
45+
if (typeof(value) == 'undefined') {
46+
return msgid;
47+
} else {
48+
return (typeof(value) == 'string') ? value : value[0];
49+
}
50+
};
3351

34-
/* formatting library */
52+
django.ngettext = function(singular, plural, count) {
53+
var value = django.catalog[singular];
54+
if (typeof(value) == 'undefined') {
55+
return (count == 1) ? singular : plural;
56+
} else {
57+
return value[django.pluralidx(count)];
58+
}
59+
};
3560

36-
django.formats = {
61+
django.gettext_noop = function(msgid) { return msgid; };
62+
63+
django.pgettext = function(context, msgid) {
64+
var value = django.gettext(context + '\x04' + msgid);
65+
if (value.indexOf('\x04') != -1) {
66+
value = msgid;
67+
}
68+
return value;
69+
};
70+
71+
django.npgettext = function(context, singular, plural, count) {
72+
var value = django.ngettext(context + '\x04' + singular, context + '\x04' + plural, count);
73+
if (value.indexOf('\x04') != -1) {
74+
value = django.ngettext(singular, plural, count);
75+
}
76+
return value;
77+
};
78+
79+
django.interpolate = function(fmt, obj, named) {
80+
if (named) {
81+
return fmt.replace(/%\(\w+\)s/g, function(match){return String(obj[match.slice(2,-2)])});
82+
} else {
83+
return fmt.replace(/%s/g, function(match){return String(obj.shift())});
84+
}
85+
};
86+
87+
88+
/* formatting library */
89+
90+
django.formats = {
3791
"DATETIME_FORMAT": "Y\ub144 n\uc6d4 j\uc77c g:i A",
3892
"DATETIME_INPUT_FORMATS": [
3993
"%Y-%m-%d %H:%M:%S",
@@ -60,7 +114,7 @@
60114
],
61115
"DECIMAL_SEPARATOR": ".",
62116
"FIRST_DAY_OF_WEEK": "0",
63-
"MONTH_DAY_FORMAT": "F\uc6d4 j\uc77c",
117+
"MONTH_DAY_FORMAT": "n\uc6d4 j\uc77c",
64118
"NUMBER_GROUPING": "3",
65119
"SHORT_DATETIME_FORMAT": "Y-n-j H:i",
66120
"SHORT_DATE_FORMAT": "Y-n-j.",
@@ -73,27 +127,30 @@
73127
"%H\uc2dc %M\ubd84 %S\ucd08",
74128
"%H\uc2dc %M\ubd84"
75129
],
76-
"YEAR_MONTH_FORMAT": "Y\ub144 F\uc6d4"
130+
"YEAR_MONTH_FORMAT": "Y\ub144 n\uc6d4"
77131
};
78132

79-
django.get_format = function (format_type) {
80-
var value = django.formats[format_type];
81-
if (typeof(value) == 'undefined') {
82-
return format_type;
83-
} else {
84-
return value;
85-
}
86-
};
133+
django.get_format = function(format_type) {
134+
var value = django.formats[format_type];
135+
if (typeof(value) == 'undefined') {
136+
return format_type;
137+
} else {
138+
return value;
139+
}
140+
};
141+
142+
/* add to global namespace */
143+
globals.pluralidx = django.pluralidx;
144+
globals.gettext = django.gettext;
145+
globals.ngettext = django.ngettext;
146+
globals.gettext_noop = django.gettext_noop;
147+
globals.pgettext = django.pgettext;
148+
globals.npgettext = django.npgettext;
149+
globals.interpolate = django.interpolate;
150+
globals.get_format = django.get_format;
87151

88-
/* add to global namespace */
89-
globals.pluralidx = django.pluralidx;
90-
globals.gettext = django.gettext;
91-
globals.ngettext = django.ngettext;
92-
globals.gettext_noop = django.gettext_noop;
93-
globals.pgettext = django.pgettext;
94-
globals.npgettext = django.npgettext;
95-
globals.interpolate = django.interpolate;
96-
globals.get_format = django.get_format;
152+
django.jsi18n_initialized = true;
153+
}
97154

98155
}(this));
99156

9.61 KB
Binary file not shown.

0 commit comments

Comments
 (0)