Commit f2f5e06beaa100499882ea9e3068c83f96000076

Authored by janek37
1 parent 15c173d6

wstępne tłumaczenie napisów z js

--HG--
rename : management/static/js/manage-groups.js => accounts/static/js/manage-groups.js
.hgignore
... ... @@ -6,6 +6,6 @@ syntax: regexp
6 6 \.pyc$
7 7 \.orig$
8 8 ~$
9   -django\.mo$
  9 +\.mo$
10 10 ^\.idea/
11 11 ^static/
12 12 \ No newline at end of file
... ...
README-DEV
... ... @@ -17,4 +17,8 @@ dodawanie pól leksemu w historii
17 17 1. attribute_translation_list
18 18 2. lexeme_attribute_order
19 19 3. get_lexeme_attr
20   -4. prepare_value
21 20 \ No newline at end of file
  21 +4. prepare_value
  22 +
  23 +wyszukiwanie wywołań gettext w javascripcie
  24 +
  25 +grep -no 'gettext([^)]*)' -r . | sed -e 's/:gettext(/\nmsgid /' -e 's/")/"\nmsgstr ""\n/' -e 's%./%# %'
22 26 \ No newline at end of file
... ...
management/static/js/manage-groups.js renamed to accounts/static/js/manage-groups.js
common/locale/en/LC_MESSAGES/djangojs.po 0 → 100644
  1 +# common.js:188
  2 +msgid "Sesja wygasła — zaloguj się i spróbuj ponownie."
  3 +msgstr "Session expired – log in and try again."
  4 +
  5 +# common.js:193
  6 +msgid "Żądanie"
  7 +msgstr "Request"
  8 +
  9 +# common.js:194
  10 +msgid "nie powiodło się"
  11 +msgstr "failed"
0 12 \ No newline at end of file
... ...
common/static/js/base-layout.js
... ... @@ -40,7 +40,7 @@ $(function () {
40 40 e.stopPropagation();
41 41 });
42 42 content.splitter({
43   - type: "v",
  43 + type: 'v',
44 44 minLeft: 200, sizeLeft: 390, minRight: 100,
45 45 resizeToWidth: true
46 46 });
... ...
common/static/js/common.js
1   -/* global $dj, before_save, paginer */
  1 +/* global $dj, before_save, paginer, gettext */
2 2  
3 3 var hash_interpreted = false;
4 4  
... ... @@ -185,13 +185,13 @@ function parse_result(params) {
185 185 if (data.result !== 'ok' || status === 'error') {
186 186 if (data.result === 'logout')
187 187 common.error_alert(
188   - "Sesja wygasła - zaloguj się i spróbuj ponownie.");
  188 + gettext("Sesja wygasła — zaloguj się i spróbuj ponownie."));
189 189 else if (data.result === 'missing params') {
190 190 window.console.warn("missing params: " + data.missing);
191 191 } else if (!params.bad_data_callback ||
192 192 params.bad_data_callback(data.result)) {
193   - var desc = params.description || "Żądanie";
194   - var msg = desc + ' ' + "nie powiodło się:\n";
  193 + var desc = params.description || gettext("Żądanie");
  194 + var msg = desc + ' ' + gettext("nie powiodło się") + ':\n';
195 195 msg += data.result;
196 196 common.error_alert(msg);
197 197 }
... ...
common/urls.py 0 → 100644
  1 +# -*- coding: utf-8 -*-
  2 +from django.conf.urls import patterns
  3 +
  4 +js_info_dict = {
  5 + 'packages': ('dictionary', 'common', 'export', 'history', 'management',
  6 + 'paginer', 'patterns'),
  7 +}
  8 +
  9 +urlpatterns = patterns(
  10 + '',
  11 + (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict,
  12 + 'jsi18n'),
  13 +)
... ...
dictionary/locale/en/LC_MESSAGES/djangojs.po 0 → 100644
  1 +# lexeme-edit.js:86
  2 +msgid "Atrybuty: %s zostaną usunięte."
  3 +msgstr "Attributes: %s will be removed."
  4 +
  5 +# lexeme-edit.js:87
  6 +msgid "Atrybut: %s zostanie usunięty."
  7 +msgstr "Attribute: %s will be removed."
  8 +
  9 +# lexeme-edit.js:89
  10 +msgid "Kontynuować?"
  11 +msgstr "Do you want to continue?"
  12 +
  13 +# lexeme-edit.js:170
  14 +msgid "Anuluj"
  15 +msgstr "Cancel"
  16 +
  17 +# lexeme-edit.js:176
  18 +msgid "Wybierz"
  19 +msgstr "Choose"
  20 +
  21 +# lexeme-edit.js:193
  22 +msgid "Utwórz"
  23 +msgstr "Create"
  24 +
  25 +# lexeme-edit.js:213
  26 +msgid "Wykonaj"
  27 +msgstr "Execute"
  28 +
  29 +# lexeme-edit.js:256
  30 +msgid "Zostaną usunięte klasyfikacje:"
  31 +msgstr "The following classifications will be removed:"
  32 +
  33 +# lexeme-edit.js:256
  34 +msgid "Zostanie usunięta klasyfikacja:"
  35 +msgstr "The following classification will be removed:"
  36 +
  37 +# lexeme-edit.js:320
  38 +msgid "Wybierz słowniki"
  39 +msgstr "Choose dictionaries"
  40 +
  41 +# lexeme-edit.js:321
  42 +msgid "# słowników"
  43 +msgstr "# dictionaries"
  44 +
  45 +# lexeme-edit.js:413
  46 +msgid "Zapisanie zmian"
  47 +msgstr "Save"
  48 +
  49 +# lexeme-edit.js:493
  50 +msgid "Utworzenie derywatów"
  51 +msgstr "Creation of derivatives"
  52 +
  53 +# lexeme-edit.js:593
  54 +msgid "Przeładowanie klasyfikacji"
  55 +msgstr "Classification reload"
  56 +
  57 +# lexeme-edit.js:610
  58 +msgid "Przeładowanie atrybutów"
  59 +msgstr "Attributes reload"
  60 +
  61 +# lexeme-edit.js:644
  62 +msgid "Wzór nie pasuje do rodzaju — na pewno zapisać?"
  63 +msgstr "The pattern doesn't match the gender — save anyway?"
  64 +
  65 +# lexeme-edit.js:688
  66 +msgid "Na pewno usunąć leksem?"
  67 +msgstr "Do you want to delete this lexeme?"
  68 +
  69 +# lexeme-edit.js:693
  70 +msgid "Usunięcie leksemu"
  71 +msgstr "Lexeme deletion"
  72 +
  73 +# lexeme-edit.js:889
  74 +msgid "wszystkie sposoby odmiany"
  75 +msgstr "all inflections"
  76 +
  77 +# lexeme-edit.js:892
  78 +msgid "wszystkie odsyłacze"
  79 +msgstr "all cross-references"
  80 +
  81 +# lexeme-edit.js:896
  82 +msgid "atrybuty"
  83 +msgstr "attributes"
  84 +
  85 +# lexeme-edit.js:901
  86 +msgid "klasyfikacje"
  87 +msgstr "classifications"
  88 +
  89 +# lexeme-edit.js:905
  90 +msgid "Zostaną usunięte:"
  91 +msgstr "Those will be removed:"
  92 +
  93 +# lexeme-edit.js:959
  94 +msgid "Zapisanie domyślnego słownika"
  95 +msgstr "Default dictionary record"
  96 +
  97 +# lexeme-edit.js:969
  98 +msgid "Utworzenie leksemu"
  99 +msgstr "Creation of a new lexeme"
  100 +
  101 +# lexeme-edit.js:983
  102 +msgid "Sklonowanie leksemu"
  103 +msgstr "Lexeme cloning"
  104 +
  105 +# lexeme-edit.js:998
  106 +msgid "Pobranie liczby homonimów"
  107 +msgstr "Homonym query"
  108 +
  109 +# lexeme-edit.js:1054
  110 +msgid "Sprawdzenie homonimów"
  111 +msgstr "Homonym check"
  112 +
  113 +# lexeme-edit.js:1063
  114 +msgid "Brak pasujących leksemów."
  115 +msgstr "No matching lexemes."
  116 +
  117 +# lexeme-view.js:12
  118 +msgid "Atrybut"
  119 +msgstr "Attribute"
  120 +
  121 +# lexeme-view.js:67
  122 +msgid "Leksemy"
  123 +msgstr "Lexemes"
  124 +
  125 +# lexeme-view.js:73
  126 +msgid "Nr"
  127 +msgstr "№"
  128 +
  129 +# lexeme-view.js:74
  130 +msgid "Hasło"
  131 +msgstr "Entry"
  132 +
  133 +# lexeme-view.js:75
  134 +msgid "Część mowy"
  135 +msgstr "Part of speech"
  136 +
  137 +# lexeme-view.js:76
  138 +msgid "Wzory"
  139 +msgstr "Patterns"
  140 +
  141 +# lexeme-view.js:79
  142 +msgid "Rodzaj/aspekt"
  143 +msgstr "Gender/aspect"
  144 +
  145 +# lexeme-view.js:82
  146 +msgid "Słowniki"
  147 +msgstr "Dictionaries"
  148 +
  149 +# lexeme-view.js:83
  150 +msgid "Sł. właściciel"
  151 +msgstr "Owner dict."
  152 +
  153 +# lexeme-view.js:84
  154 +msgid "Status"
  155 +msgstr "Status"
  156 +
  157 +# lexeme-view.js:87
  158 +msgid "Kwal."
  159 +msgstr "Qual."
  160 +
  161 +# lexeme-view.js:99
  162 +msgid "Wzór"
  163 +msgstr "Pattern"
  164 +
  165 +# lexeme-view.js:101
  166 +msgid "Liczba wzorów"
  167 +msgstr "Pattern count"
  168 +
  169 +# lexeme-view.js:106
  170 +msgid "Typ wzoru"
  171 +msgstr "Pattern type"
  172 +
  173 +# lexeme-view.js:112
  174 +msgid "Rodzaj"
  175 +msgstr "Gender"
  176 +
  177 +# lexeme-view.js:117
  178 +msgid "Liczba rodzajów"
  179 +msgstr "Gender count"
  180 +
  181 +# lexeme-view.js:118
  182 +msgid "Forma"
  183 +msgstr "Form"
  184 +
  185 +# lexeme-view.js:120
  186 +msgid "Słownik"
  187 +msgstr "Dictionary"
  188 +
  189 +# lexeme-view.js:126
  190 +msgid "Słownik właściciel"
  191 +msgstr "Owner dictionary"
  192 +
  193 +# lexeme-view.js:137
  194 +msgid "Komentarz"
  195 +msgstr "Comment"
  196 +
  197 +# lexeme-view.js:139
  198 +msgid "Kwal. leksemu"
  199 +msgstr "Lexeme qual."
  200 +
  201 +# lexeme-view.js:145
  202 +msgid "Kwal. odmieniasia"
  203 +msgstr "Inflection qual."
  204 +
  205 +# lexeme-view.js:151
  206 +msgid "Kwal. przy dow. formie"
  207 +msgstr "Any qualifier"
  208 +
  209 +# lexeme-view.js:157
  210 +msgid "Kwal. z Dor."
  211 +msgstr "Dor. qual."
  212 +
  213 +# lexeme-view.js:159
  214 +msgid "Kwal. styl."
  215 +msgstr "Styl. qual."
  216 +
  217 +# lexeme-view.js:161
  218 +msgid "Kwal. zakr."
  219 +msgstr "Scope qual."
  220 +
  221 +# lexeme-view.js:163
  222 +msgid "Wartość klasyfikacji"
  223 +msgstr "Classification value"
  224 +
  225 +# lexeme-view.js:169
  226 +msgid "Źródło zapożyczenia"
  227 +msgstr "Borrowing source"
  228 +
  229 +# lexeme-view.js:174
  230 +msgid "Glosa"
  231 +msgstr "Gloss"
  232 +
  233 +# lexeme-view.js:175
  234 +msgid "Nota"
  235 +msgstr "Note"
  236 +
  237 +# lexeme-view.js:177
  238 +msgid "Nota rozszerzona"
  239 +msgstr "Extended note"
  240 +
  241 +# lexeme-view.js:181
  242 +msgid "Wymowa"
  243 +msgstr "Pronunciation"
  244 +
  245 +# lexeme-view.js:182
  246 +msgid "Łączliwość"
  247 +msgstr "Valence"
  248 +
  249 +# lexeme-view.js:184
  250 +msgid "Typ odsyłacza"
  251 +msgstr "Cross-reference type"
  252 +
  253 +# lexeme-view.js:190
  254 +msgid "Autor ostatniej zmiany"
  255 +msgstr "Last change's author"
  256 +
  257 +# slickgrid.js:12
  258 +msgid "równy|równa|równe"
  259 +msgstr "equal to"
  260 +
  261 +# slickgrid.js:13
  262 +msgid "różny od|różna od|różne od"
  263 +msgstr "not equal to"
  264 +
  265 +# slickgrid.js:14
  266 +msgid "mniejszy lub równy|mniejsza lub równa|mniejsze lub równe"
  267 +msgstr "less than"
  268 +
  269 +# slickgrid.js:15
  270 +msgid "większy lub równy|większa lub równa|większe lub równe"
  271 +msgstr "greater than"
  272 +
  273 +# slickgrid.js:16
  274 +msgid "zaczyna się od"
  275 +msgstr "starts with"
  276 +
  277 +# slickgrid.js:17
  278 +msgid "nie zaczyna się od"
  279 +msgstr "doesn't start with"
  280 +
  281 +# slickgrid.js:18
  282 +msgid "kończy się na"
  283 +msgstr "ends with"
  284 +
  285 +# slickgrid.js:19
  286 +msgid "nie kończy się na"
  287 +msgstr "doesn't end with"
  288 +
  289 +# slickgrid.js:20
  290 +msgid "zawiera"
  291 +msgstr "contains"
  292 +
  293 +# slickgrid.js:21
  294 +msgid "nie zawiera"
  295 +msgstr "doesn't contain"
  296 +
  297 +# slickgrid.js:22
  298 +msgid "pasuje do wzorca"
  299 +msgstr "matched by pattern"
  300 +
  301 +# slickgrid.js:23
  302 +msgid "nie pasuje do wzorca"
  303 +msgstr "not matched by pattern"
  304 +
  305 +# slickgrid.js:367
  306 +msgid "Załadowanie strony nie powiodło się."
  307 +msgstr "Page load failed."
  308 +
  309 +# slickgrid.js:401
  310 +msgid "Czyść"
  311 +msgstr "Clear"
  312 +
  313 +# slickgrid.js:409
  314 +msgid "Zapisz filtr"
  315 +msgstr "Save filter"
  316 +
  317 +# slickgrid.js:413
  318 +msgid "Załaduj filtr"
  319 +msgstr "Load filter"
  320 +
  321 +# slickgrid.js:426
  322 +msgid "Filtruj"
  323 +msgstr "Apply"
  324 +
  325 +# slickgrid.js:472
  326 +msgid "Zatwierdź"
  327 +msgstr "Confirm"
  328 +
  329 +# edit.js:14
  330 +msgid "Edycja"
  331 +msgstr "Edit"
  332 +
  333 +# edit.js:14
  334 +msgid "niezapisane"
  335 +msgstr "not saved"
  336 +
  337 +# edit.js:17
  338 +msgid "Są niezapisane zmiany."
  339 +msgstr "There are unsaved changes."
  340 +
  341 +# edit.js:79
  342 +msgid "Czy chcesz porzucić niezapisane zmiany?"
  343 +msgstr "Do you want to discard changes?"
  344 +
  345 +# edit.js:86
  346 +msgid "kwalifikatorów"
  347 +msgstr "qualifiers"
0 348 \ No newline at end of file
... ...
dictionary/static/js/edit.js
1   -/* global $dj, getBusyOverlay, common */
  1 +/* global $dj, getBusyOverlay, common, gettext */
2 2  
3 3 var edit = {
4 4 changed: false,
... ... @@ -10,9 +10,11 @@ var edit = {
10 10 edit.changed = true;
11 11 $('.' + edit.form_submit_class).button('enable');
12 12 $('.' + edit.form_cancel_class).button('enable');
13   - $('#edit-tab').html('<strong>Edycja (niezapisane)</strong>');
  13 + $('#edit-tab').html(
  14 + '<strong>' + gettext("Edycja") + ' (' + gettext("niezapisane") +
  15 + ')</strong>');
14 16 $(window).on('beforeunload', function () {
15   - return "Są niezapisane zmiany.";
  17 + return gettext("Są niezapisane zmiany.");
16 18 });
17 19 }
18 20 },
... ... @@ -21,7 +23,7 @@ var edit = {
21 23 "use strict";
22 24 if (edit.changed) {
23 25 edit.changed = false;
24   - $('#edit-tab').html('Edycja');
  26 + $('#edit-tab').html(gettext("Edycja"));
25 27 $(window).off('beforeunload');
26 28 }
27 29 },
... ... @@ -73,14 +75,15 @@ var edit = {
73 75  
74 76 confirm_discard: function() {
75 77 "use strict";
76   - return window.confirm("Czy chcesz porzucić niezapisane zmiany?");
  78 + return window.confirm(
  79 + gettext("Czy chcesz porzucić niezapisane zmiany?"));
77 80 }
78 81 };
79 82  
80 83 function selected_qualifiers_text(num, total, checked) {
81 84 "use strict";
82 85 if (num >= 4)
83   - return num + ' kwalifikatorów';
  86 + return num + ' ' + gettext("kwalifikatorów");
84 87 var grouped = {};
85 88 $.each(checked, function (i, elem) {
86 89 var id = elem.value;
... ...
dictionary/static/js/lexeme-edit.js
1   -/* global $dj, edit, slickgrid, common, getBusyOverlay */
  1 +/* global $dj, edit, slickgrid, common, getBusyOverlay, gettext, ngettext, interpolate */
2 2  
3 3 var prompter_ctrl;
4 4  
... ... @@ -82,8 +82,11 @@ $.extend(edit, {
82 82 genders.splice(genders.indexOf(gender), 1);
83 83 var stale_attrs = check_attrs(genders);
84 84 if (stale_attrs.length > 0) {
85   - if (!window.confirm("Atrybuty: " + join_attrs(stale_attrs) +
86   - ' zostaną usunięte. Kontynuować?')) {
  85 + var fmt = ngettext(
  86 + "Atrybuty: %s zostaną usunięte.",
  87 + "Atrybut: %s zostanie usunięty.", stale_attrs.length);
  88 + if (!window.confirm(interpolate(fmt, [stale_attrs]) +
  89 + ' ' + gettext("Kontynuować?"))) {
87 90 return;
88 91 }
89 92 }
... ... @@ -148,7 +151,7 @@ $.extend(edit, {
148 151 $(document).on('change', '.cr-add .entry', set_cr_homonym_number);
149 152 $(document).on('click', '.cr-add .homonym-number', set_cr_homonym_number);
150 153  
151   - $("#load-filter-dialog").dialog({
  154 + $('#load-filter-dialog').dialog({
152 155 autoOpen: false,
153 156 width: 'auto',
154 157 modal: true
... ... @@ -164,13 +167,13 @@ $.extend(edit, {
164 167 modal: true,
165 168 buttons: [
166 169 {
167   - text: "Anuluj",
  170 + text: gettext("Anuluj"),
168 171 click: function () {
169   - $(this).dialog("close");
  172 + $(this).dialog('close');
170 173 }
171 174 },
172 175 {
173   - text: "Wybierz",
  176 + text: gettext("Wybierz"),
174 177 click: input_prompter_pattern
175 178 }
176 179 ]
... ... @@ -181,19 +184,19 @@ $.extend(edit, {
181 184 modal: true,
182 185 buttons: [
183 186 {
184   - text: "Anuluj",
  187 + text: gettext("Anuluj"),
185 188 click: function() {
186 189 $(this).dialog('close');
187 190 }
188 191 },
189 192 {
190   - text: "Utwórz",
  193 + text: gettext("Utwórz"),
191 194 click: create_auto_derivatives
192 195 }
193 196 ]
194 197 });
195 198 $('#action-button').click(function () {
196   - $('#group-action-dialog').dialog("open");
  199 + $('#group-action-dialog').dialog('open');
197 200 });
198 201 var add_action = $('#add-action');
199 202 add_action.click(new_action_row);
... ... @@ -207,7 +210,7 @@ $.extend(edit, {
207 210 width: 'auto',
208 211 buttons: [
209 212 {
210   - text: "Wykonaj",
  213 + text: gettext("Wykonaj"),
211 214 click: execute_actions
212 215 }
213 216 ]
... ... @@ -223,18 +226,18 @@ $.extend(edit, {
223 226 modal: true,
224 227 buttons: [
225 228 {
226   - text: "Anuluj",
  229 + text: gettext("Anuluj"),
227 230 click: function () {
228   - $(this).dialog("close");
  231 + $(this).dialog('close');
229 232 }
230 233 },
231 234 {
232   - text: "Wybierz",
  235 + text: gettext("Wybierz"),
233 236 click: function () {
234 237 var value = $('#default-owner').find(':checked').val();
235 238 if (value) {
236 239 set_default_owner(value);
237   - $(this).dialog("close");
  240 + $(this).dialog('close');
238 241 make_new_lexeme();
239 242 }
240 243 }
... ... @@ -249,10 +252,13 @@ $.extend(edit, {
249 252 $(document).on('change', '#id_new_owner', function () {
250 253 var stale_classifications = check_classifications(), confirmed;
251 254 if (stale_classifications.length > 0) {
  255 + var msg = ngettext(
  256 + "Zostaną usunięte klasyfikacje:",
  257 + "Zostanie usunięta klasyfikacja:",
  258 + stale_classifications.length);
252 259 confirmed = window.confirm(
253   - 'Zostaną usunięte klasyfikacje: ' +
254   - join_classifications(stale_classifications) +
255   - '. Kontynuować?');
  260 + msg + ' ' + join_classifications(stale_classifications) +
  261 + '. ' + gettext("Kontynuować?"));
256 262 if (!confirmed) {
257 263 revert_selection($(this));
258 264 }
... ... @@ -267,9 +273,12 @@ $.extend(edit, {
267 273 var stale_attrs = check_attrs(new_genders);
268 274 var confirmed;
269 275 if (stale_attrs.length > 0) {
  276 + var fmt = ngettext(
  277 + "Atrybuty: %s zostaną usunięte.",
  278 + "Atrybut: %s zostanie usunięty.", stale_attrs.length);
270 279 confirmed = window.confirm(
271   - "Atrybuty: " + join_attrs(stale_attrs) +
272   - ' zostaną usunięte. Kontynuować?');
  280 + interpolate(fmt, [join_attrs(stale_attrs)]) +
  281 + ' ' + gettext("Kontynuować?"));
273 282 if (!confirmed) {
274 283 revert_selection($(this));
275 284 }
... ... @@ -308,8 +317,8 @@ $.extend(edit, {
308 317 //$('#pattern-list').disableSelection();
309 318 $('.lip-row', '#pattern-list').first().click();
310 319 $('#id_vocabularies').multiSelect({
311   - noneSelectedText: 'Wybierz słowniki',
312   - selectedText: '# słowników',
  320 + noneSelectedText: gettext("Wybierz słowniki"),
  321 + selectedText: gettext("# słowników"),
313 322 selectedList: 4
314 323 });
315 324 var scope_qual = $('#id_scope_qualifiers');
... ... @@ -401,7 +410,7 @@ $.extend(edit, {
401 410 data: {
402 411 form_data: form_data
403 412 },
404   - description: "Zapisanie zmian",
  413 + description: gettext("Zapisanie zmian"),
405 414 callback: function (data) {
406 415 edit.hide_changed();
407 416 var edit_id = edit.get_id();
... ... @@ -481,7 +490,7 @@ function create_auto_derivatives() {
481 490 edit.load_content(edit_id);
482 491 }
483 492 },
484   - description: 'Utworzenie derywatów'
  493 + description: gettext("Utworzenie derywatów")
485 494 });
486 495 }
487 496  
... ... @@ -581,7 +590,7 @@ function reload_classifications() {
581 590 data: data,
582 591 dest: $('#classifications'),
583 592 callback: init_classification_forms,
584   - description: "Przeładowanie klasyfikacji"
  593 + description: gettext("Przeładowanie klasyfikacji")
585 594 });
586 595 }
587 596  
... ... @@ -598,7 +607,7 @@ function reload_attributes() {
598 607 url: $dj.ajax_extra_attributes,
599 608 data: data,
600 609 dest: $('#extra-attributes'),
601   - description: "Przeładowanie atrybutów",
  610 + description: gettext("Przeładowanie atrybutów"),
602 611 callback: init_extra_attr_widgets
603 612 });
604 613 }
... ... @@ -632,7 +641,7 @@ function before_save() {
632 641 }
633 642 });
634 643 return (ok || window.confirm(
635   - "Wzór nie pasuje do rodzaju - na pewno zapisać?"));
  644 + gettext("Wzór nie pasuje do rodzaju — na pewno zapisać?")));
636 645 }
637 646  
638 647 var new_row_counter = 1; // potrzebne tylko dla niepowtarzalności idów
... ... @@ -676,12 +685,12 @@ var set_active_lip_row = function () {
676 685 function delete_lexeme() {
677 686 "use strict";
678 687 var id = edit.get_id();
679   - if (window.confirm("Na pewno usunąć leksem?")) {
  688 + if (window.confirm(gettext("Na pewno usunąć leksem?"))) {
680 689 $.ajaxJSON({
681 690 method: 'post',
682 691 url: $dj.ajax_delete_lexeme,
683 692 data: {lexeme_id: id},
684   - description: 'Usunięcie leksemu',
  693 + description: gettext("Usunięcie leksemu"),
685 694 callback: function () {
686 695 edit.hide_changed();
687 696 slickgrid.reload_data();
... ... @@ -877,23 +886,24 @@ var check_pos = function () {
877 886 stale_attrs.length > 0 || stale_classifications.length > 0) {
878 887 var lips_text = '', cr_text = '';
879 888 if (bad_lips > 0) {
880   - lips_text = "wszystkie sposoby odmiany\n";
  889 + lips_text = gettext("wszystkie sposoby odmiany") + '\n';
881 890 }
882 891 if (cr_row_elems.length > 0) {
883   - cr_text += "wszystkie odsyłacze\n";
  892 + cr_text += gettext("wszystkie odsyłacze") + '\n';
884 893 }
885 894 var attr_text = '';
886 895 if (stale_attrs.length > 0) {
887   - attr_text = "atrybuty: " + join_attrs(stale_attrs) + '\n';
  896 + attr_text = gettext("atrybuty") + ': ' +
  897 + join_attrs(stale_attrs) + '\n';
888 898 }
889 899 var clas_text = '';
890 900 if (stale_classifications.length > 0) {
891   - clas_text = "klasyfikacje: " +
  901 + clas_text = gettext("klasyfikacje") + ': ' +
892 902 join_classifications(stale_classifications) + '\n';
893 903 }
894 904 confirmed = window.confirm(
895   - 'Zostaną usunięte:\n' + lips_text + cr_text + attr_text + clas_text +
896   - 'Kontynuować?');
  905 + gettext("Zostaną usunięte:") + '\n' + lips_text + cr_text +
  906 + attr_text + clas_text + gettext("Kontynuować?"));
897 907 if (!confirmed) {
898 908 revert_selection($(this));
899 909 }
... ... @@ -946,7 +956,7 @@ function set_default_owner(vocab_id) {
946 956 method: 'post',
947 957 url: $dj.ajax_save_default_owner,
948 958 data: {vocab_id: vocab_id},
949   - description: "Zapisanie domyślnego słownika"
  959 + description: gettext("Zapisanie domyślnego słownika")
950 960 });
951 961 }
952 962  
... ... @@ -956,7 +966,7 @@ function make_new_lexeme() {
956 966 method: 'post',
957 967 url: $dj.ajax_create_lexeme,
958 968 data: {},
959   - description: "Utworzenie leksemu",
  969 + description: gettext("Utworzenie leksemu"),
960 970 callback: function(data) {
961 971 edit.load_content(data.id, true);
962 972 }
... ... @@ -970,7 +980,7 @@ function clone_lexeme() {
970 980 method: 'post',
971 981 url: $dj.ajax_clone_lexeme,
972 982 data: {lexeme_id: edit.get_id()},
973   - description: "Sklonowanie leksemu",
  983 + description: gettext("Sklonowanie leksemu"),
974 984 callback: function(data) {
975 985 slickgrid.reload_data();
976 986 slickgrid.row_index(data.new_id);
... ... @@ -985,7 +995,7 @@ function show_homonym_count() {
985 995 method: 'get',
986 996 url: $dj.ajax_homonym_count,
987 997 data: {entry: entry, lexeme_id: edit.get_id()},
988   - descripton: "Pobranie liczby homonimów",
  998 + descripton: gettext("Pobranie liczby homonimów"),
989 999 callback: function (data) {
990 1000 var info = '';
991 1001 if (entry === get_entry()) {
... ... @@ -1024,11 +1034,11 @@ function homonym_choice(labels, lexemes, hom_field) {
1024 1034 });
1025 1035 item.click(function () {
1026 1036 hom_field.val($(this).children().first().text());
1027   - $("#choose-homonym-dialog").dialog('close');
  1037 + $('#choose-homonym-dialog').dialog('close');
1028 1038 });
1029 1039 tbody.append(item);
1030 1040 });
1031   - $("#choose-homonym-dialog").dialog('open');
  1041 + $('#choose-homonym-dialog').dialog('open');
1032 1042 }
1033 1043  
1034 1044 var set_cr_homonym_number = function () {
... ... @@ -1041,7 +1051,7 @@ var set_cr_homonym_number = function () {
1041 1051 entry: $t.find('.entry').val(),
1042 1052 cr_type: $t.find('.type').val()
1043 1053 },
1044   - description: "Sprawdzenie homonimów",
  1054 + description: gettext("Sprawdzenie homonimów"),
1045 1055 callback: function (data) {
1046 1056 var lexemes = data.lexemes;
1047 1057 if (lexemes.length === 1)
... ... @@ -1050,7 +1060,7 @@ var set_cr_homonym_number = function () {
1050 1060 homonym_choice(
1051 1061 data.labels, lexemes, $t.find('.homonym-number'));
1052 1062 } else { // nie ma żadnego
1053   - window.alert('Brak pasujących leksemów.');
  1063 + window.alert(gettext("Brak pasujących leksemów."));
1054 1064 $t.find('.entry').val('');
1055 1065 $t.find('.homonym-number').val('');
1056 1066 }
... ... @@ -1110,7 +1120,7 @@ var execute_actions = function () {
1110 1120 url: $dj.ajax_execute_actions,
1111 1121 data: {filter: filter, actions: actions},
1112 1122 callback: function () {
1113   - $t.dialog("close");
  1123 + $t.dialog('close');
1114 1124 slickgrid.loader.setFilter(filter);
1115 1125 }
1116 1126 });
... ...
dictionary/static/js/lexeme-view.js
1   -/* global $dj, slickgrid, edit, Slick */
  1 +/* global $dj, slickgrid, edit, Slick, gettext */
2 2  
3 3 var text_ops = ['eq', 'ne', 'bw', 'bn', 'ew', 'en', 'cn', 'nc', 're', 'nr'];
4 4 var eqne = ['eq', 'ne'];
... ... @@ -9,7 +9,7 @@ var extra_attr_filter_fields = {};
9 9 $.each($dj.extra_attributes, function(i, attr) {
10 10 "use strict";
11 11 var filter_field = {
12   - name: 'Atrybut: ' + attr.name,
  12 + name: gettext("Atrybut") + ': ' + attr.name,
13 13 gender: 'm'
14 14 };
15 15 if (attr.closed) {
... ... @@ -64,114 +64,130 @@ $.extend(slickgrid, {
64 64 loader: new Slick.Data.RemoteModel(
65 65 $dj.ajax_get_page, $dj.ajax_search_index,
66 66 {visible_vocabs: visible_vocab_ids}),
67   - grid_caption: "Leksemy",
  67 + grid_caption: gettext("Leksemy"),
68 68 grid_element_id: 'lexeme-grid',
69 69 main_field: 'entry',
70 70 initial_columns: $dj.initial_columns,
71 71 initial_sort_rules: ['a_fronte'],
72 72 all_columns: {
73   - id: {id: "id", name: "Nr", field: "id"},
74   - entry: {id: "entry", name: "Hasło", field: "entry"},
75   - pos: {id: "pos", name: "Część mowy", field: "pos"},
76   - patterns: {id: "patterns", name: "Wzory", field: "patterns"},
77   - genders: {id: "genders", name: "Rodzaj/aspekt", field: "genders"},
78   - vocabs: {id: "vocabs", name: "Słowniki", field: "vocabs"},
79   - owner: {id: "owner", name: "Sł. właściciel", field: "owner"},
80   - status: {id: "status", name: "Status", field: "status"},
81   - qualifiers: {id: "qualifiers", name: "Kwal.", field: "qualifiers"}
  73 + id: {id: 'id', name: gettext("Nr"), field: 'id'},
  74 + entry: {id: 'entry', name: gettext("Hasło"), field: 'entry'},
  75 + pos: {id: 'pos', name: gettext("Część mowy"), field: 'pos'},
  76 + patterns: {id: 'patterns', name: gettext("Wzory"), field: 'patterns'},
  77 + genders: {
  78 + id: 'genders',
  79 + name: gettext("Rodzaj/aspekt"),
  80 + field: 'genders'
  81 + },
  82 + vocabs: {id: 'vocabs', name: gettext("Słowniki"), field: 'vocabs'},
  83 + owner: {id: 'owner', name: gettext("Sł. właściciel"), field: 'owner'},
  84 + status: {id: 'status', name: gettext("Status"), field: 'status'},
  85 + qualifiers: {
  86 + id: 'qualifiers',
  87 + name: gettext("Kwal."),
  88 + field: 'qualifiers'
  89 + }
82 90 },
83 91 filter_fields: $.extend({
84   - entry: {name: 'Hasło', gender: 'n', ops: text_ops},
  92 + entry: {name: gettext("Hasło"), gender: 'n', ops: text_ops},
85 93 part_of_speech: {
86   - name: 'Część mowy',
  94 + name: gettext("Część mowy"),
87 95 gender: 'f',
88 96 ops: eqne,
89 97 options: $dj.parts_of_speech
90 98 },
91   - pattern_name: {name: 'Wzór', gender: 'm', ops: text_ops},
92   - pattern_count: {name: 'Liczba wzorów', gender: 'f', ops: count_ops},
  99 + pattern_name: {name: gettext("Wzór"), gender: 'm', ops: text_ops},
  100 + pattern_count: {
  101 + name: gettext("Liczba wzorów"),
  102 + gender: 'f',
  103 + ops: count_ops
  104 + },
93 105 pattern_type: {
94   - name: 'Typ wzoru',
  106 + name: gettext("Typ wzoru"),
95 107 gender: 'm',
96 108 ops: eqne,
97 109 optgroups: $dj.pattern_type_options
98 110 },
99 111 gender: {
100   - name: 'Rodzaj',
  112 + name: gettext("Rodzaj"),
101 113 gender: 'm',
102 114 ops: eqne,
103 115 options: $dj.gender_options
104 116 },
105   - gender_count: {name: 'Liczba rodzajów', gender: 'f', ops: count_ops},
106   - form: {name: 'Forma', gender: 'f', ops: text_ops},
  117 + gender_count: {name: gettext("Liczba rodzajów"), gender: 'f', ops: count_ops},
  118 + form: {name: gettext("Forma"), gender: 'f', ops: text_ops},
107 119 containing_vocabulary: {
108   - name: 'Słownik',
  120 + name: gettext("Słownik"),
109 121 gender: 'm',
110 122 ops: eqne,
111 123 options: $dj.visible_vocabularies
112 124 },
113 125 owner_vocabulary: {
114   - name: 'Słownik właściciel',
  126 + name: gettext("Słownik właściciel"),
115 127 gender: 'm',
116 128 ops: eqne,
117 129 options: $dj.visible_vocabularies
118 130 },
119 131 status: {
120   - name: 'Status',
  132 + name: gettext("Status"),
121 133 gender: 'm',
122 134 ops: eqne,
123 135 options: $dj.status_options
124 136 },
125   - comment: {name: 'Komentarz', gender: 'm', ops: text_ops},
  137 + comment: {name: gettext("Komentarz"), gender: 'm', ops: text_ops},
126 138 lexeme_qualifier: {
127   - name: 'Kwal. leksemu',
  139 + name: gettext("Kwal. leksemu"),
128 140 gender: 'm',
129 141 ops: eqne,
130 142 options: $dj.lexeme_qualifier_options
131 143 },
132 144 lip_qualifier: {
133   - name: 'Kwal. odmieniasia',
  145 + name: gettext("Kwal. odmieniasia"),
134 146 gender: 'm',
135 147 ops: eqne,
136 148 options: $dj.form_qualifier_options
137 149 },
138 150 qualifier: {
139   - name: 'Kwal. przy dow. formie',
  151 + name: gettext("Kwal. przy dow. formie"),
140 152 gender: 'm',
141 153 ops: eqne,
142 154 options: $dj.qualifier_options
143 155 },
144 156 qualifiers_dor: {
145   - name: 'Kwal. z Dor.', gender: 'm', ops: text_ops},
  157 + name: gettext("Kwal. z Dor."), gender: 'm', ops: text_ops},
146 158 qualifiers_style: {
147   - name: 'Kwal. styl.', gender: 'm', ops: text_ops},
  159 + name: gettext("Kwal. styl."), gender: 'm', ops: text_ops},
148 160 qualifiers_scope: {
149   - name: 'Kwal. zakr.', gender: 'm', ops: text_ops},
  161 + name: gettext("Kwal. zakr."), gender: 'm', ops: text_ops},
150 162 classification_value: {
151   - name: 'Wartość klasyfikacji',
  163 + name: gettext("Wartość klasyfikacji"),
152 164 gender: 'f',
153 165 ops: eqne,
154 166 options: $dj.cv_options
155 167 },
156 168 borrowing_source: {
157   - name: 'Źródło zapożyczenia',
  169 + name: gettext("Źródło zapożyczenia"),
158 170 gender: 'n',
159 171 ops: eqne,
160 172 options: $dj.bs_options
161 173 },
162   - gloss: {name: 'Glosa', gender: 'f', ops: text_ops},
163   - note: {name: 'Nota', gender: 'f', ops: text_ops},
164   - extended_note: {name: 'Nota rozszerzona', gender: 'f', ops: text_ops},
165   - pronunciation: {name: 'Wymowa', gender: 'f', ops: text_ops},
166   - valence: {name: 'Łączliwość', gender: 'f', ops: text_ops},
  174 + gloss: {name: gettext("Glosa"), gender: 'f', ops: text_ops},
  175 + note: {name: gettext("Nota"), gender: 'f', ops: text_ops},
  176 + extended_note: {
  177 + name: gettext("Nota rozszerzona"),
  178 + gender: 'f',
  179 + ops: text_ops
  180 + },
  181 + pronunciation: {name: gettext("Wymowa"), gender: 'f', ops: text_ops},
  182 + valence: {name: gettext("Łączliwość"), gender: 'f', ops: text_ops},
167 183 cr_type: {
168   - name: 'Typ odsyłacza',
  184 + name: gettext("Typ odsyłacza"),
169 185 gender: 'm',
170 186 ops: eqne,
171 187 options: $dj.cr_type_options
172 188 },
173 189 responsible: {
174   - name: 'Autor ostatniej zmiany',
  190 + name: gettext("Autor ostatniej zmiany"),
175 191 gender: 'm',
176 192 ops: eqne,
177 193 options: $dj.user_options
... ...
dictionary/static/js/slickgrid.js
1   -/* global $dj, Slick, edit, layout, common, getBusyOverlay */
  1 +/* global $dj, Slick, edit, layout, common, getBusyOverlay, gettext */
2 2  
3 3 var slickgrid = {
4 4 loader: new Slick.Data.RemoteModel(
... ... @@ -9,18 +9,18 @@ var slickgrid = {
9 9 last_active_row: undefined,
10 10  
11 11 op_names: {
12   - eq: ["równy", "równa", "równe"],
13   - ne: ["różny od", "różna od", "różne od"],
14   - le: ["mniejszy lub równy", "mniejsza lub równa", "mniejsze lub równe"],
15   - ge: ["większy lub równy", "większa lub równa", "większe lub równe"],
16   - bw: "zaczyna się od",
17   - bn: "nie zaczyna się od",
18   - ew: "kończy się na",
19   - en: "nie kończy się na",
20   - cn: "zawiera",
21   - nc: "nie zawiera",
22   - re: "pasuje do wzorca",
23   - nr: "nie pasuje do wzorca"
  12 + eq: gettext("równy|równa|równe"),
  13 + ne: gettext("różny od|różna od|różne od"),
  14 + le: gettext("mniejszy lub równy|mniejsza lub równa|mniejsze lub równe"),
  15 + ge: gettext("większy lub równy|większa lub równa|większe lub równe"),
  16 + bw: gettext("zaczyna się od"),
  17 + bn: gettext("nie zaczyna się od"),
  18 + ew: gettext("kończy się na"),
  19 + en: gettext("nie kończy się na"),
  20 + cn: gettext("zawiera"),
  21 + nc: gettext("nie zawiera"),
  22 + re: gettext("pasuje do wzorca"),
  23 + nr: gettext("nie pasuje do wzorca")
24 24 },
25 25  
26 26 search_string: function() {
... ... @@ -133,9 +133,9 @@ function update_filter_row(row) {
133 133 $.each(field_info.ops, function(i, op) {
134 134 var op_name;
135 135 var op_name_info = slickgrid.op_names[op];
136   - if (typeof op_name_info !== "string") {
  136 + if (op_name_info.indexOf('|') !== -1) {
137 137 var gender = 'mfn'.indexOf(field_info.gender);
138   - op_name = op_name_info[gender];
  138 + op_name = op_name_info.split('|')[gender];
139 139 } else {
140 140 op_name = op_name_info;
141 141 }
... ... @@ -364,13 +364,13 @@ $(function() {
364 364 });
365 365  
366 366 slickgrid.loader.onAjaxError.subscribe(function() {
367   - common.error_alert("Załadowanie strony nie powiodło się.");
  367 + common.error_alert(gettext("Załadowanie strony nie powiodło się."));
368 368 loading_off();
369 369 });
370 370  
371 371 // wyszukiwanie
372 372 var search_timeout_handler;
373   - $("#text-search").keyup(function (e) {
  373 + $('#text-search').keyup(function (e) {
374 374 if (e.which === 13) {
375 375 clearTimeout(search_timeout_handler);
376 376 slickgrid.search_enter();
... ... @@ -398,19 +398,19 @@ $(function() {
398 398 modal: false,
399 399 buttons: [
400 400 {
401   - text: "Czyść",
  401 + text: gettext("Czyść"),
402 402 click: function() {
403 403 $('#filter-table').empty();
404 404 add_filter_rule(slickgrid.main_field);
405   - apply_filter({group_op: "AND", rules: []}, false);
  405 + apply_filter({group_op: 'AND', rules: []}, false);
406 406 }
407 407 },
408 408 {
409   - text: "Zapisz filtr",
  409 + text: gettext("Zapisz filtr"),
410 410 click: save_filter
411 411 },
412 412 {
413   - text: "Załaduj filtr",
  413 + text: gettext("Załaduj filtr"),
414 414 click: function () {
415 415 $.ajaxJSON({
416 416 method: 'get',
... ... @@ -423,7 +423,7 @@ $(function() {
423 423 }
424 424 },
425 425 {
426   - text: 'Filtruj',
  426 + text: gettext("Filtruj"),
427 427 click: function() {
428 428 apply_filter();
429 429 }
... ... @@ -463,16 +463,16 @@ $(function() {
463 463 modal: true,
464 464 buttons: [
465 465 {
466   - text: "Anuluj",
  466 + text: gettext("Anuluj"),
467 467 click: function () {
468   - $(this).dialog("close");
  468 + $(this).dialog('close');
469 469 }
470 470 },
471 471 {
472   - text: "Zatwierdź",
  472 + text: gettext("Zatwierdź"),
473 473 click: function() {
474 474 set_columns();
475   - $(this).dialog("close");
  475 + $(this).dialog('close');
476 476 }
477 477 }
478 478 ]
... ...
export/locale/en/LC_MESSAGES/djangojs.po 0 → 100644
  1 +# export.js:7
  2 +msgid "kwalifikatorów"
  3 +msgstr "qualifiers"
  4 +
  5 +# export.js:55
  6 +msgid "Wybierz nazwę"
  7 +msgstr "Enter name"
  8 +
  9 +# export.js:65
  10 +msgid "Zapisanie ustawień"
  11 +msgstr "Settings save"
  12 +
  13 +# export.js:70
  14 +msgid "Ta nazwa jest zajęta. Nadpisać?"
  15 +msgstr "This name is already used. Overwrite?"
  16 +
  17 +# export.js:130
  18 +msgid "Usunąć eksport"
  19 +msgstr "Delete export settings"
  20 +
  21 +# export.js:135
  22 +msgid "Usunięcie ustawień eksportu"
  23 +msgstr "Export settings deletion"
  24 +
  25 +# export.js:160
  26 +msgid "Pobranie zapisanych eksportów"
  27 +msgstr "Export settings load"
  28 +
  29 +# export.js:169
  30 +msgid "Wybierz słowniki"
  31 +msgstr "Choose dictionaries"
  32 +
  33 +# export.js:170
  34 +msgid "# słowników"
  35 +msgstr "# dictionaries"
0 36 \ No newline at end of file
... ...
export/static/js/export.js
1   -/* global $dj */
  1 +/* global $dj, gettext */
2 2  
3 3 // straszna i zła copypasta
4 4 function selected_qualifiers_text(num, total, checked) {
5 5 "use strict";
6 6 if (num >= 4)
7   - return num + ' kwalifikatorów';
  7 + return num + ' ' + gettext("kwalifikatorów");
8 8 var grouped = {};
9 9 $.each(checked, function (i, elem) {
10 10 var id = elem.value;
... ... @@ -52,7 +52,7 @@ var remove_qualifier_row = function () {
52 52 function save_export_data() {
53 53 "use strict";
54 54 var name, post_data;
55   - name = window.prompt('Wybierz nazwę');
  55 + name = window.prompt(gettext("Wybierz nazwę"));
56 56 if (name) {
57 57 post_data = {
58 58 name: name,
... ... @@ -62,11 +62,12 @@ function save_export_data() {
62 62 method: 'post',
63 63 url: $dj.ajax_save_export_data,
64 64 data: post_data,
65   - description: 'Zapisanie ustawień'
  65 + description: gettext("Zapisanie ustawień")
66 66 };
67 67 $.ajaxJSON($.extend(save_data, {
68 68 callback: function (data) {
69   - if (data.exists && window.confirm('Ta nazwa jest zajęta. Nadpisać?')) {
  69 + if (data.exists && window.confirm(
  70 + gettext("Ta nazwa jest zajęta. Nadpisać?"))) {
70 71 $.ajaxJSON($.extend(save_data, {
71 72 data: $.extend(post_data, {force: true})
72 73 }));
... ... @@ -108,8 +109,8 @@ function put_data(json) {
108 109 $('#id_copyright').val(item.value);
109 110 }
110 111 });
111   - $('#id_vocabs').val(vocabs).multiselect2("refresh");
112   - $('#id_antivocabs').val(antivocabs).multiselect2("refresh");
  112 + $('#id_vocabs').val(vocabs).multiselect2('refresh');
  113 + $('#id_antivocabs').val(antivocabs).multiselect2('refresh');
113 114 $.each(qualifier_rows, function (id, item) {
114 115 add_qualifier_row(item.qualifier, item.regex);
115 116 });
... ... @@ -125,12 +126,13 @@ function export_choice(ajax_data) {
125 126 var delete_button = $('<span/>')
126 127 .addClass('remove ui-icon ui-icon-closethick');
127 128 delete_button.click(function () {
128   - if (window.confirm('Usunąć eksport "' + data.name + '"?')) {
  129 + if (window.confirm(
  130 + gettext("Usunąć eksport") + ' "' + data.name + '"?')) {
129 131 $.ajaxJSON({
130 132 method: 'post',
131 133 url: $dj.ajax_delete_export_data,
132 134 data: {data_id: data.id},
133   - description: 'Usunięcie ustawień eksportu',
  135 + description: gettext("Usunięcie ustawień eksportu"),
134 136 callback: function () {
135 137 item.remove();
136 138 }
... ... @@ -142,11 +144,11 @@ function export_choice(ajax_data) {
142 144 item.append(data.name);
143 145 item.click(function () {
144 146 put_data(data.json);
145   - $("#load-data-dialog").dialog('close');
  147 + $('#load-data-dialog').dialog('close');
146 148 });
147 149 list.append(item);
148 150 });
149   - $("#load-data-dialog").dialog('open');
  151 + $('#load-data-dialog').dialog('open');
150 152 }
151 153  
152 154 function load_export_data() {
... ... @@ -155,7 +157,7 @@ function load_export_data() {
155 157 method: 'get',
156 158 url: $dj.ajax_get_export_data,
157 159 data: {},
158   - description: 'Pobranie zapisanych eksportów',
  160 + description: gettext("Pobranie zapisanych eksportów"),
159 161 callback: export_choice
160 162 });
161 163 return false;
... ... @@ -164,8 +166,8 @@ function load_export_data() {
164 166 $(function () {
165 167 "use strict";
166 168 var opts = {
167   - noneSelectedText: 'Wybierz słowniki',
168   - selectedText: '# słowników',
  169 + noneSelectedText: gettext("Wybierz słowniki"),
  170 + selectedText: gettext("# słowników"),
169 171 selectedList: 4,
170 172 header: false
171 173 };
... ... @@ -177,7 +179,7 @@ $(function () {
177 179 $('#add-magic-qualifier-row').click(add_qualifier_row);
178 180 $('button.save').click(save_export_data);
179 181 $('button.load').click(load_export_data);
180   - $("#load-data-dialog").dialog({
  182 + $('#load-data-dialog').dialog({
181 183 autoOpen: false,
182 184 height: 'auto',
183 185 width: 'auto',
... ...
history/locale/en/LC_MESSAGES/djangojs.po 0 → 100644
  1 +# history-view.js:7
  2 +msgid "pl"
  3 +msgstr "en"
0 4 \ No newline at end of file
... ...
history/static/js/history-view.js
1   -/* global paginer */
  1 +/* global paginer, gettext */
2 2  
3 3 paginer.init_widget.lexeme_history = {
4 4 time: function (row) {
5 5 "use strict";
6   - row.find('input.datepicker').datepicker($.datepicker.regional.pl);
  6 + row.find('input.datepicker').datepicker(
  7 + $.datepicker.regional[gettext('pl')]);
7 8 }
8 9 };
9 10  
10 11 paginer.init_widget.pattern_history = {
11 12 time: function (row) {
12 13 "use strict";
13   - row.find('input.datepicker').datepicker($.datepicker.regional.pl);
  14 + row.find('input.datepicker').datepicker(
  15 + $.datepicker.regional[gettext('pl')]);
14 16 }
15 17 };
16 18 \ No newline at end of file
... ...
management/locale/en/LC_MESSAGES/djangojs.po 0 → 100644
  1 +# manager-view.js:16
  2 +msgid "Dodanie słownika"
  3 +msgstr "Dictionary creation"
0 4 \ No newline at end of file
... ...
management/static/js/manager-view.js
1   -/* global $dj */
  1 +/* global $dj, gettext */
2 2  
3 3 $(function () {
4 4 "use strict";
... ... @@ -13,7 +13,7 @@ $(function () {
13 13 callback: function () {
14 14 location.reload(); // porządniejszy by był zwykły formularz...
15 15 },
16   - description: 'Dodanie słownika'
  16 + description: gettext("Dodanie słownika")
17 17 });
18 18 });
19 19 $('.user-privileges').find('input[type=checkbox]').change(function () {
... ... @@ -33,11 +33,14 @@ $(function () {
33 33 on: $t.is(':checked')
34 34 }
35 35 });
36   - var view_checkbox = $('#view-' + user_id + '-' + index), change_checkbox = $('#change-' + user_id + '-' + index);
37   - if (type === 'change' && $t.is(':checked') && !view_checkbox.is(':checked')) {
  36 + var view_checkbox = $('#view-' + user_id + '-' + index),
  37 + change_checkbox = $('#change-' + user_id + '-' + index);
  38 + if (type === 'change' && $t.is(':checked') &&
  39 + !view_checkbox.is(':checked')) {
38 40 view_checkbox.prop('checked', true).change();
39 41 }
40   - if (type === 'view' && !$t.is(':checked') && change_checkbox.is(':checked')) {
  42 + if (type === 'view' && !$t.is(':checked') &&
  43 + change_checkbox.is(':checked')) {
41 44 change_checkbox.prop('checked', false).change();
42 45 }
43 46 });
... ...
paginer/locale/pl/LC_MESSAGES/djangojs.po 0 → 100644
  1 +# paginer.js:90
  2 +msgid "No selection"
  3 +msgstr "Niczego nie zaznaczono"
  4 +
  5 +# paginer.js:155
  6 +msgid "Page load"
  7 +msgstr "Pobranie strony"
0 8 \ No newline at end of file
... ...
paginer/static/js/paginer.js
1   -/* global $dj, common */
  1 +/* global $dj, common, gettext */
2 2  
3 3 // paginer[id] ma format: [typ, parametry, akcja]
4 4 // parametry mają format:
... ... @@ -83,11 +83,11 @@ var perform_group_action = function () {
83 83 id = container.id;
84 84 action = this.id.replace(id + '-', '');
85 85 ajax_url = window['ajax_' + action];
86   - row_ids = $('.checkrow:checked', container).map(function () {
  86 + row_ids = $('.checkrow:checked', container).map(function() {
87 87 return this.id.replace(id + '-', '');
88 88 }).get();
89 89 if (row_ids.length === 0)
90   - common.error_alert("Niczego nie zaznaczono");
  90 + common.error_alert(gettext("No selection"));
91 91 $.each(row_ids, function (i, row_id) {
92 92 $.ajaxJSON({
93 93 method: 'post',
... ... @@ -114,7 +114,6 @@ var update_filters = function () {
114 114  
115 115 var update_order = function () {
116 116 "use strict";
117   - var sort_choices = this.parentNode;
118 117 var list_id = get_list_id(this);
119 118 var sign = $('.sort-direction', this).text() > 0 ? '' : '-';
120 119 var field_name = $('.sort-field-name', this).text();
... ... @@ -153,7 +152,7 @@ function change_page(id, nr, protect_hash) {
153 152 method: 'post',
154 153 url: $dj.ajax_paginer,
155 154 data: param,
156   - description: "Pobranie strony",
  155 + description: gettext("Page load"),
157 156 dest: $('#' + id + '.paginer'),
158 157 callback: paginer_ajax_callback,
159 158 callback_args: [id]
... ... @@ -171,7 +170,7 @@ function new_filter_row_html(list_id) {
171 170 url: $dj.ajax_new_filter_row,
172 171 data: {list_type: $dj.paginer[list_id][0]},
173 172 async: false
174   - }).responseText.replace(/NUM/g, filter_row_counter);
  173 + }).responseText.replace(/NUM/g, filter_row_counter.toString());
175 174 filter_row_counter++;
176 175 return new_row_html;
177 176 }
... ...
patterns/locale/en/LC_MESSAGES/djangojs.po 0 → 100644
  1 +# pattern-view.js:7
  2 +msgid "Wzory"
  3 +msgstr "Patterns"
  4 +
  5 +# pattern-view.js:13
  6 +msgid "Id"
  7 +msgstr "Id"
  8 +
  9 +# pattern-view.js:14
  10 +msgid "Typ"
  11 +msgstr "Type"
  12 +
  13 +# pattern-view.js:15
  14 +msgid "Cz. mowy"
  15 +msgstr "Infl. type"
  16 +
  17 +# pattern-view.js:16
  18 +msgid "Przykład"
  19 +msgstr "Example"
  20 +
  21 +# pattern-view.js:19
  22 +msgid "Nazwa"
  23 +msgstr "Name"
  24 +
  25 +# pattern-view.js:20
  26 +msgid "Stara nazwa"
  27 +msgstr "Old name"
  28 +
  29 +# pattern-view.js:22
  30 +msgid "Część mowy"
  31 +msgstr "Inflection type"
  32 +
  33 +# pattern-view.js:33
  34 +msgid "Efobaz"
  35 +msgstr "Base form label"
  36 +
  37 +# pattern-edit.js:133
  38 +msgid "Zapisanie zmian"
  39 +msgstr "Save"
  40 +
  41 +# pattern-edit.js:158
  42 +msgid "Utworzenie wzoru"
  43 +msgstr "Pattern creation"
  44 +
  45 +# pattern-edit.js:171
  46 +msgid "Sklonowanie wzoru"
  47 +msgstr "Pattern cloning"
0 48 \ No newline at end of file
... ...
patterns/static/js/pattern-edit.js
1   -/* global $dj, edit, common, slickgrid */
  1 +/* global $dj, edit, common, slickgrid, gettext */
2 2  
3 3 var deleted;
4 4  
... ... @@ -11,7 +11,7 @@ function get_new_row_html() {
11 11 data: {pattern_id: edit.get_id()},
12 12 async: false // w zasadzie się tak nie powinno robić
13 13 }).responseText;
14   - var row_html = new_row_html.replace(/NUM/g, new_row_counter);
  14 + var row_html = new_row_html.replace(/NUM/g, new_row_counter.toString());
15 15 new_row_counter++;
16 16 return row_html;
17 17 }
... ... @@ -130,7 +130,7 @@ $.extend(edit, {
130 130 data: {
131 131 form_data: form_data
132 132 },
133   - description: "Zapisanie zmian",
  133 + description: gettext("Zapisanie zmian"),
134 134 callback: function () {
135 135 edit.hide_changed();
136 136 // odświeżyć?
... ... @@ -155,7 +155,7 @@ function add_pattern() {
155 155 method: 'post',
156 156 url: $dj.ajax_create_pattern,
157 157 data: {},
158   - description: "Utworzenie wzoru",
  158 + description: gettext("Utworzenie wzoru"),
159 159 callback: function(data) {
160 160 edit.load_content(data.id, true);
161 161 }
... ... @@ -168,7 +168,7 @@ function clone_pattern() {
168 168 method: 'post',
169 169 url: $dj.ajax_clone_pattern,
170 170 data: {pattern_id: edit.get_id()},
171   - descripton: "Sklonowanie wzoru",
  171 + descripton: gettext("Sklonowanie wzoru"),
172 172 callback: function(data) {
173 173 slickgrid.reload_data();
174 174 slickgrid.row_index(data.new_id);
... ...
patterns/static/js/pattern-view.js
1   -/* global $dj, slickgrid, edit */
  1 +/* global $dj, slickgrid, edit, gettext */
2 2  
3 3 var text_ops = ['eq', 'ne', 'bw', 'bn', 'ew', 'en', 'cn', 'nc', 're', 'nr'];
4 4 var eqne = ['eq', 'ne'];
5 5  
6 6 $.extend(slickgrid, {
7   - grid_caption: "Wzory",
  7 + grid_caption: gettext("Wzory"),
8 8 grid_element_id: 'pattern-grid',
9 9 main_field: 'name',
10 10 initial_columns: $dj.initial_columns,
11 11 initial_sort_rules: [],
12 12 all_columns: {
13   - 'name': {id: 'name', name: 'Id', field: 'name'},
14   - 'type': {id: 'type', name: 'Typ', field: 'type'},
15   - 'pos': {id: 'pos', name: 'Cz. mowy', field: 'lexical_class'},
16   - 'example': {id: 'example', name: 'Przykład', field: 'example'}
  13 + 'name': {id: 'name', name: gettext("Id"), field: 'name'},
  14 + 'type': {id: 'type', name: gettext("Typ"), field: 'type'},
  15 + 'pos': {id: 'pos', name: gettext("Cz. mowy"), field: 'lexical_class'},
  16 + 'example': {id: 'example', name: gettext("Przykład"), field: 'example'}
17 17 },
18 18 filter_fields: {
19   - 'name': {name: 'Nazwa', gender: 'f', ops: text_ops},
20   - 'old_name': {name: 'Stara nazwa', gender: 'f', ops: text_ops},
  19 + 'name': {name: gettext("Nazwa"), gender: 'f', ops: text_ops},
  20 + 'old_name': {name: gettext("Stara nazwa"), gender: 'f', ops: text_ops},
21 21 'lexical_class': {
22   - name: 'Część mowy',
  22 + name: gettext("Część mowy"),
23 23 gender: 'f',
24 24 ops: eqne,
25 25 options: $dj.lexical_class_options
26 26 },
27 27 'type': {
28   - name: 'Typ',
  28 + name: gettext("Typ"),
29 29 gender: 'm',
30 30 ops: eqne,
31 31 optgroups: $dj.pattern_type_options
32 32 },
33   - 'base_form_label': {name: 'Efobaz', gender: 'm', ops: eqne}
  33 + 'base_form_label': {name: gettext("Efobaz"), gender: 'm', ops: eqne}
34 34 },
35 35 load_content: function(id) {
36 36 "use strict";
... ...
settings.py
... ... @@ -61,6 +61,17 @@ USE_I18N = True
61 61 # calendars according to the current locale
62 62 USE_L10N = True
63 63  
  64 +LOCALE_PATHS = (
  65 + # os.path.join(BASE_DIR, "locale"),
  66 + os.path.join(BASE_DIR, "common/locale"),
  67 + os.path.join(BASE_DIR, "dictionary/locale"),
  68 + os.path.join(BASE_DIR, "export/locale"),
  69 + os.path.join(BASE_DIR, "history/locale"),
  70 + os.path.join(BASE_DIR, "management/locale"),
  71 + os.path.join(BASE_DIR, "paginer/locale"),
  72 + os.path.join(BASE_DIR, "patterns/locale"),
  73 +)
  74 +
64 75 STATIC_ROOT = os.path.join(BASE_DIR, 'static')
65 76  
66 77 STATIC_URL = SITE_PREFIX + '/static/'
... ... @@ -157,4 +168,4 @@ LOGGING = {
157 168 'propagate': True,
158 169 },
159 170 }
160   -}
161 171 \ No newline at end of file
  172 +}
... ...
templates/base.html
... ... @@ -18,6 +18,7 @@
18 18 <script type="text/javascript">
19 19 $.fn.multiselect2 = $.fn.multiselect;
20 20 </script>
  21 + <script type="text/javascript" src="{% url 'jsi18n' %}"></script>
21 22 <script type="text/javascript"
22 23 src="{% static 'js/base-layout.js' %}"></script>
23 24 <script type="text/javascript" src="{% static 'js/common.js' %}"></script>
... ...