Commit f63dc191898f2fc4e99266755bd868369e513933

Authored by Katarzyna Krasnowska
1 parent 520ae6bd

added preliminary English version + filter forms fixes/updates

common/static/common/js/init.js 0 → 100644
  1 +"use strict";
  2 +
  3 +var lang;
  4 +
  5 +$(document).ready(function() {
  6 +
  7 + $('.nav-item > a[href$="' + window.location.pathname + '"]').addClass('active');
  8 +
  9 + lang = $('html').attr('lang');
  10 +
  11 +});
... ...
common/templates/base.html
1 1 <!doctype html>
2 2  
  3 +{% load i18n %}
3 4 {% load static %}
4 5  
5   -<html lang="pl">
  6 +{% get_current_language as LANGUAGE_CODE %}
  7 +
  8 +<html lang="{{ LANGUAGE_CODE }}">
6 9 <head>
7 10 <meta charset="utf-8">
8 11 <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
... ... @@ -15,8 +18,11 @@
15 18 <!--might be needed for resizeable panels, causes errors if included after Popper-->
16 19 <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
17 20 <!--Bootstrap’s tooltips require Popper-->
18   - <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
19   - <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
  21 + <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
  22 + <script type="text/javascript" src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
  23 + <script type="text/javascript" src="{% static 'common/js/init.js' %}"></script>
  24 + <!-- translations: https://docs.djangoproject.com/en/2.2/topics/i18n/translation/#using-the-javascript-translation-catalog -->
  25 + <script type="text/javascript" src="{% url 'javascript-catalog' %}"></script>
20 26 {% block scripts %}{% endblock %}
21 27 </head>
22 28  
... ... @@ -33,22 +39,22 @@
33 39 <ul class="navbar-nav mr-auto">
34 40 <li class="nav-item" id="nav-entries">
35 41 <a class="nav-link" href="{% url 'entries:entries' %}">
36   - Hasła
  42 + {% trans "Hasła" %}
37 43 </a>
38 44 </li>
39 45 <li class="nav-item" id="nav-phrases">
40 46 <a class="nav-link" href="{% url 'phrase_expansions:phrase_expansions' %}">
41   - Typy fraz
  47 + {% trans "Typy fraz" %}
42 48 </a>
43 49 </li>
44 50 <li class="nav-item" id="nav-stats">
45 51 <a class="nav-link" href="{% url 'dictionary_statistics:dictionary_statistics' %}">
46   - Statystyki
  52 + {% trans "Statystyki" %}
47 53 </a>
48 54 </li>
49 55 <li class="nav-item" id="nav-download">
50 56 <a class="nav-link" href="{% url 'download:download' %}">
51   - Pobierz słownik
  57 + {% trans "Pobierz słownik" %}
52 58 </a>
53 59 </li>
54 60 <li class="nav-item" id="nav-test">
... ... @@ -63,6 +69,12 @@
63 69 </li>
64 70 </ul>
65 71 </div>
  72 + <a
  73 + class="btn btn-sm btn-outline-light"
  74 + href="{% if LANGUAGE_CODE == "pl" %}/en{% else %}/pl{% endif %}{{ request.path|slice:"3:" }}"
  75 + >
  76 + <b>{% trans "EN" %}</b>
  77 + </a>
66 78 </nav>
67 79  
68 80 <main class="container-fluid flex-grow-1 overflow-auto" role="main">
... ...
compile_translations.sh 0 → 100755
  1 +django-admin compilemessages
... ...
entries/form_fields/specialised_fields.py
... ... @@ -2,6 +2,8 @@ from django import forms
2 2  
3 3 from django.db.models import Q
4 4  
  5 +from django.utils.translation import gettext_lazy as _
  6 +
5 7 from syntax.models_phrase import PhraseTypeModel
6 8  
7 9 from semantics.models import (
... ... @@ -31,7 +33,7 @@ class PhraseTypeFilter(ModelChoiceFilter):
31 33 def __init__(self, lex=False, **kwargs):
32 34  
33 35 super().__init__(
34   - label=('Typ frazeologizmu' if lex else 'Typ frazy'),
  36 + label=(_('Typ frazeologizmu') if lex else _('Typ frazy')),
35 37 queryset=PhraseTypeModel.objects.filter(main_phrase_types__lex_phrases__isnull=(not lex)).distinct(),
36 38 key='name',
37 39 #lookup='phrase_types__main_type',
... ... @@ -39,12 +41,12 @@ class PhraseTypeFilter(ModelChoiceFilter):
39 41 lookup=DUMMY_LOOKUP,
40 42 # we will want to identify the selected phrase type by name later
41 43 to_field_name='name',
42   - empty_label='wybierz',
  44 + empty_label=_('wybierz'),
43 45 **kwargs,
44 46 )
45 47 def label_from_instance(self, obj):
46 48 pt = obj.name
47   - return '{} ({})'.format(pt, PHRASE_TYPE.get(pt, '...'))
  49 + return '{} ({})'.format(pt, PHRASE_TYPE().get(pt, '...'))
48 50  
49 51 '''
50 52 class ArgumentFilter(ComboFilter):
... ... @@ -162,8 +164,8 @@ class PhraseoFilter(forms.ChoiceField, RadiosLayoutField):
162 164  
163 165 def __init__(self):
164 166 super().__init__(
165   - label='Frazeologia',
166   - choices=(('2', 'dowolnie'), ('1', 'zawiera'), ('0', 'nie zawiera')),
  167 + label=_('Frazeologia'),
  168 + choices=(('2', _('dowolnie')), ('1', _('zawiera')), ('0', _('nie zawiera'))),
167 169 initial='2',
168 170 required=False,
169 171 )
... ...
entries/forms.py
... ... @@ -4,6 +4,10 @@ from django import forms
4 4  
5 5 from django.db.models import OneToOneField, ForeignKey, CharField, ManyToManyField, Q
6 6  
  7 +from django.utils.translation import gettext_lazy as _
  8 +
  9 +from django.utils import translation
  10 +
7 11 from crispy_forms.helper import FormHelper
8 12 import crispy_forms.bootstrap as bootstrap
9 13 import crispy_forms.layout as layout
... ... @@ -45,6 +49,17 @@ from importer.PhraseAttributes import attrs_helpers
45 49  
46 50 from . import polish_strings
47 51  
  52 +'''
  53 +from django.utils import translation
  54 +from django.utils.translation import gettext_lazy as _
  55 +
  56 +def _(x):
  57 + print(translation.get_language())
  58 + print('***************', x)
  59 + y = gettext_lazy(x)
  60 + print('*************', y)
  61 + return y
  62 + '''
48 63  
49 64 class QueryForm(forms.Form):
50 65  
... ... @@ -82,24 +97,23 @@ class QueryForm(forms.Form):
82 97 field_object = cls.base_fields[field_name]
83 98 return field_object.layout(field_name)
84 99  
85   -def or_button(button_label):
86   - return bootstrap.StrictButton('+ Lub ({})'.format(button_label), css_class='or-button btn-sm btn-info')
  100 +def or_button(button_label, add_button_id):
  101 + return bootstrap.StrictButton('+ {} ({})'.format(_('Lub'), button_label), css_class='or-button btn-sm btn-info', data_add_id=add_button_id)
87 102  
88 103 def remove_button(label):
89 104 return bootstrap.StrictButton(label, css_class='remove-button btn-sm btn-warning')
90 105  
91   -def and_or_form_creator(button_label, field_name=None, data_add=None, *args, **kwargs):
  106 +def and_or_form_creator(button_label, button_id, field_name=None, data_add=None, *args, **kwargs):
92 107 add_button = None
93 108 data_add = 'switch' if data_add is None else data_add
94 109 if field_name is not None:
95   - add_button = bootstrap.FieldWithButtons(field_name, bootstrap.StrictButton('+ Dodaj', css_class='add-button btn-sm btn-success', data_add=data_add, *args, **kwargs))
  110 + add_button = bootstrap.FieldWithButtons(field_name, bootstrap.StrictButton('+ {}'.format('Add'), css_id=button_id, css_class='add-button btn-sm btn-success', data_add=data_add, *args, **kwargs))
96 111 else:
97   - add_button = bootstrap.StrictButton('+ {}'.format(button_label), css_class='add-button btn-sm btn-success', data_add=data_add, *args, **kwargs)
  112 + add_button = bootstrap.StrictButton('+ {}'.format(button_label), css_id=button_id, css_class='add-button btn-sm btn-success', data_add=data_add, *args, **kwargs)
98 113 return [
99   - #layout.HTML('<div class="and-or-forms py-1 pl-1 mb-1 border-top border-bottom border-danger" data-formtype="{}">'.format(data_add)),
100 114 layout.HTML('<div class="and-or-forms py-1 pl-1" data-formtype="{}">'.format(data_add)),
101 115 add_button,
102   - or_button(button_label),
  116 + or_button(button_label, button_id),
103 117 layout.HTML('</div>'),
104 118 ]
105 119  
... ... @@ -124,41 +138,41 @@ class EntryForm(QueryForm):
124 138 schema_components = [
125 139 self.make_field('num_schemata'),
126 140 ] + \
127   - and_or_form_creator('Schemat', data_add='schema') + \
  141 + and_or_form_creator(_('Schemat'), 'add-schema-0', data_add='schema') + \
128 142 [
129 143 self.make_field('filter_schemata'),
130 144 ] + \
131   - and_or_form_creator('Fraza', field_name='phrase_type', data_prefix='phrase_')
  145 + and_or_form_creator(_('Fraza'), 'add-phrase-0', field_name='phrase_type', data_prefix='phrase_')
132 146  
133 147 frame_components = [
134 148 self.make_field('num_frames'),
135 149 ] + \
136   - and_or_form_creator('Rama', data_add='frame') + \
  150 + and_or_form_creator(_('Rama'), 'add-frame-0', data_add='frame') + \
137 151 [
138 152 self.make_field('filter_frames'),
139 153 ]
140 154  
141 155 components = [
142   - #layout.Fieldset('Własności haseł', *entry_components),
143   - layout.Fieldset('Własności składniowe', *schema_components),
144   - layout.Fieldset('Własności semantyczne', *frame_components),
145   - layout.Submit('main-submit', 'Filtruj'),
146   - layout.Reset('main-reset', 'Wyczyść'),
  156 + layout.Fieldset(_('Własności hasła'), *entry_components),
  157 + layout.Fieldset(_('Własności składniowe'), *schema_components),
  158 + layout.Fieldset(_('Własności semantyczne'), *frame_components),
  159 + layout.Submit('main-submit', _('Filtruj')),
  160 + layout.Reset('main-reset', _('Wyczyść')),
147 161 ]
148 162  
149 163 self.helper.layout = layout.Layout(*components)
150 164  
151 165 lemma = RegexFilter(
152   - label='Lemat',
  166 + label=_('Lemat'),
153 167 lookup='name',
154 168 max_length=200,
155 169 autocomplete='lemma',
156 170 )
157 171 pos = ModelMultipleChoiceFilter(
158   - label='Część mowy',
  172 + label=_('Część mowy'),
159 173 queryset=POS.objects.exclude(tag='unk'),
160 174 key='tag',
161   - human_values=polish_strings.POS,
  175 + human_values=polish_strings.POS(),
162 176 lookup='pos',
163 177 )
164 178 phraseology = PhraseoFilter()
... ... @@ -169,16 +183,16 @@ class EntryForm(QueryForm):
169 183 lookup='status',
170 184 )
171 185 num_schemata = RangeFilter(
172   - label='Liczba schematów',
  186 + label=_('Liczba schematów'),
173 187 lookup='schemata_count',
174 188 )
175 189 num_frames = RangeFilter(
176   - label='Liczba ram',
  190 + label=_('Liczba ram'),
177 191 lookup='frames_count',
178 192 )
179   - phrase_type = PhraseTypeFilter(help_text='Typ frazy występujący w haśle.')
180   - filter_schemata = SwitchField('Ukryj niepasujące schematy')
181   - filter_frames = SwitchField('Ukryj niepasujące ramy')
  193 + phrase_type = PhraseTypeFilter(help_text=_('Typ frazy występujący w haśle.'))
  194 + filter_schemata = SwitchField(_('Ukryj niepasujące schematy'))
  195 + filter_frames = SwitchField(_('Ukryj niepasujące ramy'))
182 196  
183 197 @staticmethod
184 198 def get_child_form_prefix(child_form):
... ... @@ -217,7 +231,7 @@ class FormFactory(object):
217 231 @staticmethod
218 232 def make_layout(title, components):
219 233 return layout.Layout(layout.Fieldset(
220   - '{} <span class="collapsed-info"></span> <button class="btn collapse-button btn-sm btn-secondary" data-collapsed="false" type="button">zwiń</button><button class="btn remove-button btn-sm btn-warning" type="button">Usuń</button>'.format(title),
  234 + '{} <span class="collapsed-info"></span> <button class="btn collapse-button btn-sm btn-secondary" data-collapsed="false" type="button">{}</button><button class="btn remove-button btn-sm btn-warning" type="button">{}</button>'.format(title, _('Zwiń'), _('Usuń')),
221 235 *components
222 236 ))
223 237  
... ... @@ -252,7 +266,7 @@ class FormFactory(object):
252 266 'get_child_form_prefix' : lambda self, child_form: cls.get_child_form_prefix(child_form),
253 267 })
254 268  
255   - form_class.base_fields[cls.unique_name('negated', unique_number)] = SwitchField('Zaneguj', css_class='negate-switch')
  269 + form_class.base_fields[cls.unique_name('negated', unique_number)] = SwitchField(_('Zaneguj'), css_class='negate-switch')
256 270 for field_name, field_maker, layout_maker in cls.field_makers:
257 271 if field_name is not None:
258 272 form_class.base_fields[FormFactory.unique_name(field_name, unique_number)] = field_maker()
... ... @@ -266,16 +280,16 @@ class SchemaFormFactory(FormFactory):
266 280 form_class_name = 'SchemaForm'
267 281 form_model = Schema
268 282 form_formtype = 'schema'
269   - form_header = 'Schemat składniowy'
  283 + form_header = _('Schemat składniowy')
270 284  
271 285 field_makers = (
272 286 (
273 287 'opinion',
274 288 lambda: ModelMultipleChoiceFilter(
275   - label='Opinia o schemacie',
  289 + label=_('Opinia o schemacie'),
276 290 queryset=SchemaOpinion.objects.filter(schemata__isnull=False).distinct(),
277 291 key='key',
278   - human_values=polish_strings.SCHEMA_OPINION,
  292 + human_values=polish_strings.SCHEMA_OPINION(),
279 293 lookup='opinion',
280 294 #initial=SchemaOpinion.objects.filter(key__in=('col', 'vul')),
281 295 ),
... ... @@ -284,8 +298,8 @@ class SchemaFormFactory(FormFactory):
284 298 (
285 299 'type',
286 300 lambda: MultipleChoiceFilter(
287   - label='Typ',
288   - choices=((False, 'zwykły'), (True, 'frazeologiczny'),),
  301 + label=_('Typ'),
  302 + choices=((False, _('zwykły')), (True, _('frazeologiczny')),),
289 303 lookup='phraseologic',
290 304 ),
291 305 None,
... ... @@ -293,7 +307,7 @@ class SchemaFormFactory(FormFactory):
293 307 (
294 308 'sie',
295 309 lambda: ModelMultipleChoiceFilter(
296   - label='Zwrotność',
  310 + label=_('Zwrotność'),
297 311 queryset=InherentSie.objects.all().order_by('-priority'),
298 312 key='name',
299 313 human_values=polish_strings.TRUE_FALSE_YES_NO,
... ... @@ -333,7 +347,7 @@ class SchemaFormFactory(FormFactory):
333 347 # label='Aspekt',
334 348 # queryset=Aspect.objects.exclude(name='').exclude(name='_').order_by('-priority'),
335 349 # key='name',
336   - # human_values=polish_strings.ASPECT,
  350 + # human_values=polish_strings.ASPECT(),
337 351 # entry_lookup='subentries__aspect',
338 352 # # both Schema and Entry have the same related name for Subentry:
339 353 # # can use the same lookup path
... ... @@ -366,7 +380,7 @@ class SchemaFormFactory(FormFactory):
366 380 #),
367 381 (
368 382 None, None,
369   - lambda n: and_or_form_creator('Pozycja', data_add='position'),
  383 + lambda n: and_or_form_creator(_('Pozycja'), 'add-position-{}'.format(n), data_add='position'),
370 384 ),
371 385 )
372 386  
... ... @@ -382,43 +396,43 @@ class PositionFormFactory(FormFactory):
382 396 form_class_name = 'PositionForm'
383 397 form_model = Position
384 398 form_formtype = 'position'
385   - form_header = 'Pozycja schematu'
  399 + form_header = _('Pozycja składniowa')
386 400  
387 401 field_makers = (
388 402 (
389 403 'gram_function',
390 404 lambda: ModelMultipleChoiceFilter(
391   - label='Funkcja gramatyczna',
  405 + label=_('Funkcja gramatyczna'),
392 406 queryset=SyntacticFunction.objects.all(),
393 407 key='name',
394   - human_values=polish_strings.GRAM_FUNCTION,
  408 + human_values=polish_strings.GRAM_FUNCTION(),
395 409 lookup='function',
396 410 ), None,
397 411 ),
398 412 (
399 413 'control',
400 414 lambda: ModelMultipleChoiceFilter(
401   - label='Kontrola',
  415 + label=_('Kontrola'),
402 416 queryset=Control.objects.filter(positions__isnull=False).distinct(),
403 417 key='name',
404   - human_values=polish_strings.CONTROL,
  418 + human_values=polish_strings.CONTROL(),
405 419 lookup='control',
406 420 ), None,
407 421 ),
408 422 (
409 423 'pred_control',
410 424 lambda: ModelMultipleChoiceFilter(
411   - label='Kontrola predykatywna',
  425 + label=_('Kontrola predykatywna'),
412 426 queryset=PredicativeControl.objects.all(),
413 427 key='name',
414   - human_values=polish_strings.CONTROL,
  428 + human_values=polish_strings.CONTROL(),
415 429 lookup='pred_control',
416 430 ), None,
417 431 ),
418 432 (
419 433 'phrase_type',
420   - lambda: PhraseTypeFilter(help_text='Typ frazy występujący na pozycji.'),
421   - lambda n: and_or_form_creator('Fraza', field_name=(FormFactory.unique_name('phrase_type', n)), data_prefix='phrase_'),
  434 + lambda: PhraseTypeFilter(help_text=_('Typ frazy występujący na pozycji.')),
  435 + lambda n: and_or_form_creator(_('Fraza'), 'add-phrase-{}'.format(n), field_name=(FormFactory.unique_name('phrase_type', n)), data_prefix='phrase_'),
422 436 ),
423 437 )
424 438  
... ... @@ -429,18 +443,62 @@ class PositionFormFactory(FormFactory):
429 443 raise KeyError(type(child_form))
430 444  
431 445  
  446 +class LemmaFormFactory(FormFactory):
  447 +
  448 + form_class_name = 'LemmaForm'
  449 + form_model = Lemma
  450 + form_formtype = 'lemma'
  451 + form_header = _('Lemat')
  452 +
  453 + field_makers = (
  454 + (
  455 + 'lemma',
  456 + lambda: RegexFilter(
  457 + label=_('Lemat'),
  458 + max_length=32,
  459 + lookup='name',
  460 + autocomplete='lex_lemma'
  461 + ), None,
  462 + ),
  463 + )
  464 +
  465 +
432 466 class LexFormFactory(FormFactory):
433 467  
434 468 form_class_name = 'LexForm'
435 469 form_model = PhraseType
436 470 form_formtype = 'phrase_lex'
437   - form_header = 'Frazeologizm'
  471 + form_header = _('Frazeologizm')
438 472  
439 473 field_makers = (
440 474 (
  475 + 'lemma_operator',
  476 + lambda: ModelMultipleChoiceFilter(
  477 + label=_('Wybór lematów'),
  478 + queryset=LemmaOperator.objects.all(),
  479 + key='name',
  480 + human_values=polish_strings.LEMMA_OPERATOR(),
  481 + lookup='lemma_operator',
  482 + ), None,
  483 + ),
  484 + (
  485 + 'lemma_cooccur',
  486 + lambda: ModelMultipleChoiceFilter(
  487 + label=_('Łączenie lematów'),
  488 + queryset=LemmaCooccur.objects.all(),
  489 + key='name',
  490 + human_values=polish_strings.LEMMA_COOCCUR(),
  491 + lookup='lemma_cooccur',
  492 + ), None,
  493 + ),
  494 + (
  495 + None, None,
  496 + lambda n: and_or_form_creator(_('Lemat'), 'add-lemma-{}'.format(n), data_add='lemma'),
  497 + ),
  498 + (
441 499 'lex_type',
442   - lambda: PhraseTypeFilter(lex=True, help_text='Typ składniowy frazeologizmu.'),
443   - lambda n: and_or_form_creator('Typ frazeologizmu', field_name=FormFactory.unique_name('lex_type', n), data_prefix='phrase_lex')
  500 + lambda: PhraseTypeFilter(lex=True, help_text=_('Typ składniowy frazeologizmu.')),
  501 + lambda n: and_or_form_creator(_('Typ frazeologizmu'), 'add-lex-{}'.format(n), field_name=FormFactory.unique_name('lex_type', n), data_prefix='phrase_lex')
444 502 ),
445 503 )
446 504  
... ... @@ -448,62 +506,46 @@ class LexFormFactory(FormFactory):
448 506 def get_child_form_prefix(child_form):
449 507 if child_form.model_class == PhraseType:
450 508 return 'id__in'
  509 + if child_form.model_class == Lemma:
  510 + return 'lemmata__in'
451 511 raise KeyError(type(child_form))
452 512  
453   -class LemmaFormFactory(FormFactory):
454   -
455   - form_class_name = 'LemmaForm'
456   - form_model = Lemma
457   - form_formtype = 'lemma'
458   - form_header = 'Lemat'
459   -
460   - field_makers = (
461   - (
462   - 'lemma',
463   - lambda: RegexFilter(
464   - label='Lemat',
465   - max_length=32,
466   - lookup='name',
467   - autocomplete='lex_lemma'
468   - ), None,
469   - ),
470   - )
471 513  
472 514 class FrameFormFactory(FormFactory):
473 515  
474 516 form_class_name = 'FrameForm'
475 517 form_model = Frame
476 518 form_formtype = 'frame'
477   - form_header = 'Rama semantyczna'
  519 + form_header = _('Rama semantyczna')
478 520  
479 521 field_makers = (
480 522 (
481 523 'opinion',
482 524 lambda: ModelMultipleChoiceFilter(
483   - label='Opinia',
  525 + label=_('Opinia'),
484 526 queryset=FrameOpinion.objects.exclude(key='unk').filter(frame__isnull=False).distinct(),
485 527 key='key',
486   - human_values=polish_strings.FRAME_OPINION,
  528 + human_values=polish_strings.FRAME_OPINION(),
487 529 lookup='opinion',
488 530 ), None,
489 531 ),
490 532 (
491 533 'num_arguments',
492 534 lambda: RangeFilter(
493   - label='Liczba argumentów',
  535 + label=_('Liczba argumentów'),
494 536 lookup='arguments_count',
495 537 ), None
496 538 ),
497 539 (
498 540 'num_preferences',
499 541 lambda: RangeFilter(
500   - label='Liczba preferencyj selekcyjnych argumentu',
  542 + label=_('Liczba preferencyj selekcyjnych argumentu'),
501 543 lookup='argument__preferences_count',
502 544 ), None
503 545 ),
504 546 (
505 547 None, None,
506   - lambda n: and_or_form_creator('Argument', data_add='argument'),
  548 + lambda n: and_or_form_creator(_('Argument'), 'add-argument-{}'.format(n), data_add='argument'),
507 549 ),
508 550 )
509 551  
... ... @@ -513,13 +555,13 @@ class ArgumentFormFactory(FormFactory):
513 555 form_class_name = 'ArgumentForm'
514 556 form_model = Argument
515 557 form_formtype = 'argument'
516   - form_header = 'Argument ramy'
  558 + form_header = _('Argument semantyczny')
517 559  
518 560 field_makers = (
519 561 (
520 562 'role',
521 563 lambda: ModelMultipleChoiceFilter(
522   - label='Rola',
  564 + label=_('Rola'),
523 565 queryset=SemanticRole.objects.filter(argumentrole__argument__isnull=False).distinct(),
524 566 key='role',
525 567 lookup='role__role',
... ... @@ -528,7 +570,7 @@ class ArgumentFormFactory(FormFactory):
528 570 (
529 571 'role_attribute',
530 572 lambda: ModelMultipleChoiceFilter(
531   - label='Atrybut roli',
  573 + label=_('Atrybut roli'),
532 574 queryset=RoleAttribute.objects.filter(argumentrole__argument__isnull=False).distinct(),
533 575 key='attribute',
534 576 lookup='role__attribute',
... ... @@ -537,20 +579,20 @@ class ArgumentFormFactory(FormFactory):
537 579 (
538 580 'preference_type',
539 581 lambda: forms.ChoiceField(
540   - label='Preferencja selekcyjna',
541   - choices=(('predefined', 'Predefinowana grupa znaczeń'), ('relational', 'Wyrażona przez relację'), ('synset', 'Wyrażona przez jednostkę leksykalną Słowosieci')),
  582 + label=_('Preferencja selekcyjna'),
  583 + choices=(('predefined', _('Predefiniowana grupa znaczeń')), ('relational', _('Wyrażona przez relację')), ('synset', _('Wyrażona przez jednostkę leksykalną Słowosieci'))),
542 584 required=False,
543 585 ),
544   - lambda n: and_or_form_creator('Preferencja selekcyjna', field_name=FormFactory.unique_name('preference_type', n))
  586 + lambda n: and_or_form_creator(_('Preferencja selekcyjna'), 'add-preference-{}'.format(n), field_name=FormFactory.unique_name('preference_type', n))
545 587 ),
546 588 (
547 589 None, None,
548   - lambda n: and_or_form_creator('Pozycja', data_add='position'),
  590 + lambda n: and_or_form_creator(_('Pozycja'), 'add-position-{}'.format(n), data_add='position'),
549 591 ),
550 592 (
551 593 'phrase_type',
552   - lambda: PhraseTypeFilter(help_text='Typ frazy, przez którą może być realizowany argument.'),
553   - lambda n: and_or_form_creator('Fraza', field_name=FormFactory.unique_name('phrase_type', n), data_prefix='phrase_'),
  594 + lambda: PhraseTypeFilter(help_text=_('Typ frazy, przez którą może być realizowany argument.')),
  595 + lambda n: and_or_form_creator(_('Fraza'), 'add-phrase-{}'.format(n), field_name=FormFactory.unique_name('phrase_type', n), data_prefix='phrase_'),
554 596 ),
555 597 )
556 598  
... ... @@ -560,7 +602,7 @@ class PredefinedPreferenceFormFactory(FormFactory):
560 602 form_class_name = 'PredefinedPreferenceForm'
561 603 form_model = PredefinedSelectionalPreference
562 604 form_formtype = 'predefined'
563   - form_header = 'Preferencja predefiniowana'
  605 + form_header = _('Preferencja predefiniowana')
564 606  
565 607 field_makers = (
566 608 (
... ... @@ -581,13 +623,13 @@ class RelationalPreferenceFormFactory(FormFactory):
581 623 form_class_name = 'RelationalPreferenceForm'
582 624 form_model = RelationalSelectionalPreference
583 625 form_formtype = 'relational'
584   - form_header = 'Preferencja – relacja'
  626 + form_header = _('Preferencja – relacja')
585 627  
586 628 field_makers = (
587 629 (
588 630 'relation',
589 631 lambda: ModelMultipleChoiceFilter(
590   - label='Relacja',
  632 + label=_('Relacja'),
591 633 queryset=SelectionalPreferenceRelation.objects.all(),
592 634 key='key',
593 635 # TODO
... ... @@ -597,7 +639,7 @@ class RelationalPreferenceFormFactory(FormFactory):
597 639 (
598 640 'to_role',
599 641 lambda : ModelMultipleChoiceFilter(
600   - label='Do: rola',
  642 + label=_('Do: rola'),
601 643 queryset=SemanticRole.objects.all(),
602 644 key='role',
603 645 lookup='to__role__role',
... ... @@ -606,7 +648,7 @@ class RelationalPreferenceFormFactory(FormFactory):
606 648 (
607 649 'to_attribute',
608 650 lambda: ModelMultipleChoiceFilter(
609   - label='Do: atrybut',
  651 + label=_('Do: atrybut'),
610 652 queryset=RoleAttribute.objects.all(),
611 653 key='attribute',
612 654 lookup='to__role__attribute',
... ... @@ -621,13 +663,13 @@ class SynsetPreferenceFormFactory(FormFactory):
621 663 # TODO
622 664 form_model = Synset
623 665 form_formtype = 'synset'
624   - form_header = 'Preferencja – Słowosieć'
  666 + form_header = _('Preferencja – Słowosieć')
625 667  
626 668 field_makers = (
627 669 (
628 670 'synset',
629 671 lambda: RegexFilter(
630   - label='Jednostka leksykalna',
  672 + label=_('Jednostka leksykalna'),
631 673 max_length=200,
632 674 lookup='lexical_units__text_rep',
633 675 autocomplete='lu'
... ... @@ -661,26 +703,21 @@ class PhraseAttributesFormFactory(FormFactory):
661 703 self.model_class = PhraseType
662 704  
663 705 components = [self.make_field(cls.unique_name('negated', n))]
664   - for _, name in all_fields:
  706 + for field, name in all_fields:
665 707 uniq_name = cls.unique_name(name, n)
666 708 if name.endswith('_lexes'):
667   - flds = and_or_form_creator('Fraza', field_name=uniq_name, data_prefix='phrase_lex')
  709 + flds = and_or_form_creator(_('Fraza'), 'add-phrase-1-{}'.format(n), field_name=uniq_name, data_prefix='phrase_lex')
668 710 elif name.endswith('_lex'):
669   - flds = and_or_form_creator('Fraza', field_name=uniq_name, data_prefix='phrase_lex')
  711 + flds = and_or_form_creator(_('Fraza'), 'add-phrase-2-{}'.format(n), field_name=uniq_name, data_prefix='phrase_lex')
670 712 elif name.endswith('_phrase'):
671   - flds = and_or_form_creator('Fraza', field_name=uniq_name, data_prefix='phrase_')
  713 + flds = and_or_form_creator(_('Fraza'), 'add-phrase-3-{}'.format(n), field_name=uniq_name, data_prefix='phrase_')
672 714 else:
673 715 flds = [self.make_field(uniq_name)]
674 716 components += flds
675   - if lex_model:
676   - components += [
677   - self.make_field(cls.unique_name('lex_lemma_operator', n)),
678   - self.make_field(cls.unique_name('lex_lemma_cooccur', n)),
679   - ] + and_or_form_creator('Lemat', data_add='lemma')
680   - pt = polish_strings.PHRASE_TYPE[phrase_type]
  717 + pt = polish_strings.PHRASE_TYPE()[phrase_type]
681 718 header = pt.capitalize() if phrase_type in polish_strings.NO_PHRASE_NAME else 'Fraza {}'.format(pt)
682 719 if lex_model:
683   - header += ' (frazeologizm)'
  720 + header += ' ({})'.format(_('frazeologizm'))
684 721 self.helper.layout = cls.make_layout(
685 722 header,
686 723 components
... ... @@ -691,26 +728,20 @@ class PhraseAttributesFormFactory(FormFactory):
691 728 pt_q = Q(('{}main_type__name'.format('lexicalized_phrase__' if lex_phrase else ''), phrase_type))
692 729 return super().get_queries() + [pt_q]
693 730  
694   - @staticmethod
695   - def get_child_form_prefix(child_form):
696   - if child_form.model_class == Lemma:
697   - return 'lemmata__in'
698   - raise KeyError(type(child_form))
699   -
700 731 AttributesForm.base_fields[cls.unique_name('negated', n)] = SwitchField('Zaneguj', css_class='negate-switch')
701 732 for field, name in all_fields:
702 733 print('***', name, field.name, type(field))
703 734 if field.name == 'lexes':
704   - form_field = PhraseTypeFilter(help_text='Fraza składowa frazeologizmu porównawczego.', lex=True)
  735 + form_field = PhraseTypeFilter(help_text=_('Fraza składowa frazeologizmu porównawczego.'), lex=True)
705 736 elif field.name == 'lex':
706   - form_field = PhraseTypeFilter(help_text='Fraza realizująca frazeologizm.')
  737 + form_field = PhraseTypeFilter(help_text=_('Fraza realizująca frazeologizm.'))
707 738 elif field.name == 'phrase':
708   - form_field = PhraseTypeFilter(help_text='Typ składniowy frazeologizmu.')
  739 + form_field = PhraseTypeFilter(help_text=_('Typ składniowy frazeologizmu.'))
709 740 elif type(field) == CharField:
710 741 # TODO other autocompletes?
711 742 autocomplete = 'fixed' if field.name == 'text' else None
712 743 form_field = RegexFilter(
713   - label=polish_strings.PHRASE_ATTRIBUTE.get(field.name, field.name),
  744 + label=polish_strings.PHRASE_ATTRIBUTE().get(field.name, field.name),
714 745 lookup='attributes__{}attributes__{}'.format(phrase_type, field.name),
715 746 max_length=200,
716 747 autocomplete=autocomplete,
... ... @@ -718,11 +749,13 @@ class PhraseAttributesFormFactory(FormFactory):
718 749 else:
719 750 lex_attr = name.startswith('lex')
720 751 queryset_q = Q(('{}{}attributes__isnull'.format('lex' if lex_attr else '', phrase_type), False))
  752 + queryset = type(field.related_model()).objects.filter(queryset_q).distinct()
721 753 form_field = ModelMultipleChoiceFilter(
722   - label=polish_strings.PHRASE_ATTRIBUTE.get(field.name, field.name),
723   - queryset=type(field.related_model()).objects.filter(queryset_q).distinct(),
  754 + label=polish_strings.PHRASE_ATTRIBUTE().get(field.name, field.name),
  755 + queryset=queryset,
724 756 key='name',
725   - human_values=polish_strings.PHRASE_ATTRIBUTE_VALUE,
  757 + human_values=polish_strings.PHRASE_ATTRIBUTE_VALUE(),
  758 + checkboxes=(len(queryset) <= 8),
726 759 lookup='{}attributes__{}{}attributes__{}'.format(
727 760 'lexicalized_phrase__' if lex_phrase and not lex_attr else '',
728 761 'lexphrasetypeattributes__lex' if lex_attr else '',
... ... @@ -731,19 +764,6 @@ class PhraseAttributesFormFactory(FormFactory):
731 764 ),
732 765 )
733 766 AttributesForm.base_fields[cls.unique_name(name, n)] = form_field
734   - if lex_model:
735   - AttributesForm.base_fields[cls.unique_name('lex_lemma_operator', n)] = ModelMultipleChoiceFilter(
736   - label='Operator lematów',
737   - queryset=LemmaOperator.objects.all(),
738   - key='name',
739   - lookup='lemma_operator',
740   - )
741   - AttributesForm.base_fields[cls.unique_name('lex_lemma_cooccur', n)] = ModelMultipleChoiceFilter(
742   - label='Łączenie lematów',
743   - queryset=LemmaCooccur.objects.all(),
744   - key='name',
745   - lookup='lemma_cooccur',
746   - )
747 767  
748 768 return AttributesForm
749 769  
... ...
entries/polish_strings.py
1   -POS = {
2   - 'adj' : 'przymiotnik',
3   - 'adv' : 'przysłówek',
4   - 'noun' : 'rzeczownik',
5   - 'verb' : 'czasownik',
6   -}
  1 +from django.utils.translation import gettext_lazy as _
7 2  
8   -ASPECT = { 'perf' : 'dokonany', 'imperf' : 'niedokonany', }
  3 +def POS():
  4 + return {
  5 + 'adj' : _('przymiotnik'),
  6 + 'adv' : _('przysłówek'),
  7 + 'noun' : _('rzeczownik'),
  8 + 'verb' : _('czasownik'),
  9 + }
9 10  
10   -NEGATION = { 'neg' : 'zanegowany', 'aff' : 'niezanegowany', '_' : 'dowolny', }
  11 +ASPECT = { 'perf' : _('dokonany'), 'imperf' : _('niedokonany'), }
11 12  
12   -TRUE_FALSE_YES_NO = { 'true' : 'tak', 'false' : 'nie', }
  13 +NEGATION = { 'neg' : _('zanegowany'), 'aff' : _('niezanegowany'), '_' : _('dowolny'), }
13 14  
14   -SCHEMA_OPINION = {
15   - 'vul' : 'wulgarny',
16   - 'col' : 'potoczny',
17   - 'dat' : 'archaiczny',
18   - 'bad' : 'zły',
19   - 'unc' : 'wątpliwy',
20   - 'cer' : 'pewny',
21   -}
  15 +TRUE_FALSE_YES_NO = { 'true' : _('tak'), 'false' : _('nie'), }
22 16  
23   -FRAME_OPINION = {
24   - 'vul' : 'wulgarna',
25   - 'col' : 'potoczna',
26   - 'dat' : 'archaiczna',
27   - 'bad' : 'zła',
28   - 'unc' : 'niepewna',
29   - 'cer' : 'pewna',
30   - 'rar' : 'sporadyczna',
31   - 'dom' : 'dziedzinowa',
32   - 'met' : 'metaforyczna',
33   - 'unk' : 'nieznana',
34   -}
  17 +def SCHEMA_OPINION():
  18 + return {
  19 + 'vul' : _('wulgarny'),
  20 + 'col' : _('potoczny'),
  21 + 'dat' : _('archaiczny'),
  22 + 'bad' : _('zły'),
  23 + 'unc' : _('wątpliwy'),
  24 + 'cer' : _('pewny'),
  25 + }
35 26  
36   -GRAM_FUNCTION = {
37   - 'subj' : 'podmiot',
38   - 'obj' : 'dopełnienie',
39   - 'head' : 'centrum',
40   -}
  27 +def FRAME_OPINION():
  28 + return {
  29 + 'vul' : _('wulgarna'),
  30 + 'col' : _('potoczna'),
  31 + 'dat' : _('archaiczna'),
  32 + 'bad' : _('zła'),
  33 + 'unc' : _('niepewna'),
  34 + 'cer' : _('pewna'),
  35 + 'rar' : _('sporadyczna'),
  36 + 'dom' : _('dziedzinowa'),
  37 + 'met' : _('metaforyczna'),
  38 + 'unk' : _('nieznana'),
  39 + }
41 40  
42   -CONTROL = {
43   - 'controller' : 'kontrolujący',
44   - 'controllee' : 'kontrolowany',
45   - 'controller2' : 'kontrolujący #2',
46   - 'controllee2' : 'kontrolowany #2',
47   - 'pred_controller' : 'kontrolujący',
48   - 'pred_controllee' : 'kontrolowany',
49   -}
  41 +def GRAM_FUNCTION():
  42 + return {
  43 + 'subj' : _('podmiot'),
  44 + 'obj' : _('dopełnienie'),
  45 + 'head' : _('centrum'),
  46 + }
50 47  
51   -PHRASE_ATTRIBUTE = {
52   - 'case' : 'Przypadek',
53   - 'num' : 'Liczba',
54   - 'gend' : 'Rodzaj',
55   - 'deg' : 'Stopień',
56   - 'prep' : 'Przyimek',
57   - 'comprep' : 'Przyimek złożony',
58   - 'inhsie' : 'Inherentne <i>się</i>',
59   - 'cptype' : 'Typ frazy zdaniowej',
60   - 'cpreals' : 'Realizacje',
61   - 'aspect' : 'Aspekt',
62   - 'advcat' : 'Typ okolicznika',
63   - 'comparcat' : 'Typ frazy porównawczej',
64   - 'text' : 'Postać frazeologizmu',
65   -}
  48 +def CONTROL():
  49 + return {
  50 + 'controller' : _('kontrolujący'),
  51 + 'controllee' : _('kontrolowany'),
  52 + 'controller2' : _('kontrolujący #2'),
  53 + 'controllee2' : _('kontrolowany #2'),
  54 + 'pred_controller' : _('kontrolujący'),
  55 + 'pred_controllee' : _('kontrolowany'),
  56 + }
66 57  
67   -PHRASE_ATTRIBUTE_VALUE = {
68   - 'str' : 'strukturalny',
69   - 'nom' : 'mianownik',
70   - 'gen' : 'dopełniacz',
71   - 'dat' : 'celownik',
72   - 'acc' : 'biernik',
73   - 'inst' : 'narzędnik',
74   - 'loc' : 'miejscownik',
75   - 'pred' : 'predykatywny',
76   - 'part' : 'partytytwny',
77   - 'postp' : 'poprzyimkowy',
78   - 'agr' : 'uzgodnienie',
79   - '_' : 'dowolnie',
80   - 'sg' : 'pojedyncza',
81   - 'pl' : 'mnoga',
82   - 'm1' : 'męski osobowy',
83   - 'm2' : 'męski żywotny',
84   - 'm3' : 'męski nieżywotny',
85   - 'f' : 'żenski',
86   - 'n' : 'nijaki',
87   - 'pos' : 'równy',
88   - 'com' : 'wyższy',
89   - 'sup' : 'najwyższy',
90   -}
  58 +def PHRASE_ATTRIBUTE():
  59 + return {
  60 + 'case' : _('Przypadek'),
  61 + 'num' : _('Liczba'),
  62 + 'gend' : _('Rodzaj'),
  63 + 'deg' : _('Stopień'),
  64 + 'prep' : _('Przyimek'),
  65 + 'comprep' : _('Przyimek złożony'),
  66 + 'inhsie' : _('Inherentne <i>się</i>'),
  67 + 'neg' : _('Zanegowanie'),
  68 + 'cptype' : _('Typ frazy zdaniowej'),
  69 + 'cpreals' : _('Realizacje'),
  70 + 'aspect' : _('Aspekt'),
  71 + 'advcat' : _('Typ okolicznika'),
  72 + 'comparcat' : _('Typ frazy porównawczej'),
  73 + 'text' : _('Postać frazeologizmu'),
  74 + }
91 75  
92   -PHRASE_TYPE = {
93   - 'adjp' : 'przymiotnikowa',
94   - 'advp' : 'przysłówkowa',
95   - 'compar' : 'porównawcza',
96   - 'comprepnp' : 'przyimkowa z przyimkiem złożonym',
97   - 'cp' : 'zdaniowa',
98   - 'distrp' : 'dystrybutywna',
99   - # TODO
100   - 'E' : 'podmiot czasownika wymagającego bezokolicznika',
101   - 'fixed' : 'frazeologizm zamrożony',
102   - 'infp' : 'bezokolicznikowa',
103   - 'lex' : 'frazeologizm',
104   - 'ncp' : 'zdaniowa z korelatem',
105   - 'nonch' : 'niechromatyczna',
106   - 'np' : 'rzeczownikowa',
107   - 'nump' : 'liczebnikowa',
108   - 'or' : 'mowa niezależna',
109   - 'possp' : 'posesywna',
110   - 'ppasp' : 'imiesłowowa',
111   - 'prepadjp' : 'przyimkowo-przymotnikowa',
112   - 'prepgerp' : 'przyimkowo-odsłownikowa',
113   - 'prepncp' : 'zdaniowa z korelatem przyimkowym',
114   - 'prepnp' : 'przyimkowo-rzeczownikowa',
115   - 'prepnump' : 'przyimkowo-liczebnikowa',
116   - 'prepppasp' : 'przyimkowo-imiesłowowa',
117   - 'qub' : 'partykuła',
118   - 'recip' : 'wzajemnościowa partykuła się',
119   - 'refl' : 'zwrotna partykuła się',
120   - 'xp' : 'okolicznikowa',
121   -}
  76 +def PHRASE_ATTRIBUTE_VALUE():
  77 + return {
  78 + 'str' : _('strukturalny'),
  79 + 'nom' : _('mianownik'),
  80 + 'gen' : _('dopełniacz'),
  81 + 'dat' : _('celownik'),
  82 + 'acc' : _('biernik'),
  83 + 'inst' : _('narzędnik'),
  84 + 'loc' : _('miejscownik'),
  85 + 'pred' : _('predykatywny'),
  86 + 'part' : _('partytytwny'),
  87 + 'postp' : _('poprzyimkowy'),
  88 + 'agr' : _('uzgodnienie'),
  89 + '_' : _('dowolnie'),
  90 + 'sg' : _('pojedyncza'),
  91 + 'pl' : _('mnoga'),
  92 + 'm1' : _('męski osobowy'),
  93 + 'm2' : _('męski żywotny'),
  94 + 'm3' : _('męski nieżywotny'),
  95 + 'f' : _('żeński'),
  96 + 'n' : _('nijaki'),
  97 + 'pos' : _('równy'),
  98 + 'com' : _('wyższy'),
  99 + 'sup' : _('najwyższy'),
  100 + }
  101 +
  102 +def PHRASE_TYPE():
  103 + return {
  104 + 'adjp' : _('przymiotnikowa'),
  105 + 'advp' : _('przysłówkowa'),
  106 + 'compar' : _('porównawcza'),
  107 + 'comprepnp' : _('przyimkowa z przyimkiem złożonym'),
  108 + 'cp' : _('zdaniowa'),
  109 + 'distrp' : _('dystrybutywna'),
  110 + # TODO
  111 + 'E' : _('podmiot czasownika wymagającego bezokolicznika'),
  112 + 'fixed' : _('frazeologizm zamrożony'),
  113 + 'infp' : _('bezokolicznikowa'),
  114 + 'lex' : _('frazeologizm'),
  115 + 'ncp' : _('zdaniowa z korelatem'),
  116 + 'nonch' : _('niechromatyczna'),
  117 + 'np' : _('rzeczownikowa'),
  118 + 'nump' : _('liczebnikowa'),
  119 + 'or' : _('mowa niezależna'),
  120 + 'possp' : _('posesywna'),
  121 + 'ppasp' : _('imiesłowowa'),
  122 + 'prepadjp' : _('przyimkowo-przymiotnikowa'),
  123 + 'prepgerp' : _('przyimkowo-odsłownikowa'),
  124 + 'prepncp' : _('zdaniowa z korelatem przyimkowym'),
  125 + 'prepnp' : _('przyimkowo-rzeczownikowa'),
  126 + 'prepnump' : _('przyimkowo-liczebnikowa'),
  127 + 'prepppasp' : _('przyimkowo-imiesłowowa'),
  128 + 'qub' : _('partykuła'),
  129 + 'recip' : _('wzajemnościowa partykuła się'),
  130 + 'refl' : _('zwrotna partykuła się'),
  131 + 'xp' : _('okolicznikowa'),
  132 + }
122 133  
123 134 # phrase types that should not be displayed as “Fraza xyz”, but “Xyz”
124 135 NO_PHRASE_NAME = (
125 136 'E', 'fixed', 'lex', 'or', 'qub', 'recip', 'refl',
126 137 )
  138 +
  139 +def LEMMA_OPERATOR():
  140 + return {
  141 + 'or' : _('lub'),
  142 + 'xor' : _('wyłącznie'),
  143 + }
  144 +
  145 +def LEMMA_COOCCUR():
  146 + return {
  147 + 'concat' : _('szeregowo (bez spójnika)'),
  148 + 'coord' : _('koordynacja (ze spójnikiem)'),
  149 + }
... ...
entries/static/entries/js/entries.js
... ... @@ -57,7 +57,7 @@ function hide_form_errors() {
57 57 }
58 58  
59 59 function show_form_errors(errors) {
60   - show_warning_text('Formularz filtrowania zawiera błędy.');
  60 + show_warning_text(gettext('Formularz filtrowania zawiera błędy.'));
61 61 for (var field in errors) {
62 62 var field_element = $('#id_' + field);
63 63 field_element.after('<p class="bg-warning form-error">' + errors[field] + '</p>');
... ... @@ -98,12 +98,12 @@ function bind_collapse_subforms(selector) {
98 98 if ($(this).data('collapsed')) {
99 99 $(this).closest('legend').nextAll().show();
100 100 $(this).closest('legend').find('.collapsed-info').html('');
101   - $(this).html('zwiń');
  101 + $(this).html(gettext('zwiń'));
102 102 $(this).data('collapsed', false);
103 103 } else {
104 104 $(this).closest('legend').nextAll().hide();
105 105 $(this).closest('legend').find('.collapsed-info').html('[...]');
106   - $(this).html('rozwiń');
  106 + $(this).html(gettext('rozwiń'));
107 107 $(this).data('collapsed', true);
108 108 }
109 109 });
... ... @@ -122,14 +122,16 @@ function bind_negations(selector) {
122 122  
123 123 function bind_ors(selector) {
124 124 selector.find('.or-button').click(function() {
125   - // if there is no subform yet, nothing will be inserted
126 125 // prevAll: the elements are returned in order beginning with the closest sibling
127 126 var insert_after = $(this).prevAll('.subform').first();
  127 + // if there is no subform yet, nothing will be inserted
  128 + if (insert_after.length == 0) {
  129 + return;
  130 + }
128 131 // if there is already an ‘or’ there, nothing will be inserted
129 132 if (insert_after.next().hasClass('form-or')) {
130 133 return;
131 134 }
132   - insert_after.after('<div class="form-or mb-1 ml-3"><span class="btn btn-primary btn-sm disabled">LUB</span><button type="button" class="btn remove-or-button btn-sm btn-warning">Usuń</div>');
133 135 selector.find('.remove-or-button').mouseenter(function() {
134 136 $(this).closest('div').addClass('to-remove');
135 137 }).mouseleave(function() {
... ... @@ -137,6 +139,10 @@ function bind_ors(selector) {
137 139 }).click(function() {
138 140 $(this).closest('div').remove();
139 141 });
  142 + // add the ‘or’
  143 + insert_after.after('<div class="form-or mb-1 ml-3"><span class="btn btn-primary btn-sm disabled">' + gettext('LUB') + '</span><button type="button" class="btn remove-or-button btn-sm btn-warning">' + gettext('Usuń') + '</div>');
  144 + // add a subform
  145 + add_subform($('#' + $(this).data('add-id')));
140 146 });
141 147 }
142 148  
... ... @@ -147,7 +153,7 @@ function bind_autocompletes(selector) {
147 153 source: function(request, autocompleter) {
148 154 $.ajax({
149 155 type : 'get',
150   - url : '/entries/autocomplete/',
  156 + url : '/' + lang + '/entries/autocomplete/',
151 157 dataType : 'json',
152 158 data : {'what' : autocompleted.data('autocomplete'), 'text' : request.term},
153 159 success : function(response) {
... ... @@ -190,7 +196,7 @@ function insert_subform(subform_type, inserter) {
190 196 // to be inserted into the DOM before doing further stuff with it
191 197 async : false,
192 198 type : 'get',
193   - url : '/entries/get_subform/',
  199 + url : '/' + lang + '/entries/get_subform/',
194 200 data : {'subform_type' : subform_type},
195 201 dataType : 'json',
196 202 success : function(response) {
... ... @@ -206,46 +212,6 @@ function insert_subform(subform_type, inserter) {
206 212 }
207 213  
208 214 function initialize_main_form() {
209   -
210   - /*
211   - // accordion variant – only one panel expanded at one time
212   - //$('#main-form').prepend('<div class="accordion" id="main-form-accordion"></div>');
213   - // independent collapsibles variant – any cobination of panels expanded at one time
214   - $('#main-form').prepend('<div id="main-form-accordion"></div>');
215   - var inserter = function(form_type, header, expanded) {
216   - return function(form_html) {
217   - $('#main-form-accordion').append(
218   - '<div class="card">\
219   - <div class="card-header" id="heading-form-' + form_type + '"><h2 class="mb-0">\
220   - <button class="btn btn-link' + (expanded ? '' : ' collapsed') + '" type="button" data-toggle="collapse" data-target="#collapse-form-' + form_type + '" aria-expanded="' + (expanded ? 'true' : 'false') +'" aria-controls="collapse=form-' + form_type + '">' +
221   - header +
222   - ' [<span class="collapse-form-state">' + (expanded ? 'Zwiń' : 'Rozwiń') +'</span>]' +
223   - '</button></h2>\
224   - </div>\
225   - <div id="collapse-form-' + form_type + '" class="collapse form-collapse' + (expanded ? ' show' : '') + '" aria-labelledby="heading-form-' + form_type +
226   - // uncomment for accordion variant (all other collapsibles under this parent will be collapsed on expansion)
227   - //'" data-parent="#main-form-accordion">' +
228   - '<div class="card-body" id="main-form-' + form_type + '">' +
229   - form_html +
230   - '</div>\
231   - </div>\
232   - </div>')
233   - return $('#main-form-accordion').children().last();
234   - };
235   - };
236   -
237   - //insert_subform('entry', inserter('entry', 'Po właściwościach haseł', false));
238   - //insert_subform('schema', inserter('schema', 'Po właściwościach schematów', true));
239   - insert_subform('schema', inserter('schema', 'Po właściwościach schematów', false));
240   - //insert_subform('frame', inserter('frame', 'Po właściwościach ram', true));
241   - insert_subform('frame', inserter('frame', 'Po właściwościach ram', false));
242   -
243   - $('.form-collapse').on('show.bs.collapse', function() {
244   - $(this).prev().find('.collapse-form-state').html('Zwiń');
245   - }).on('hide.bs.collapse', function(){
246   - $(this).prev().find('.collapse-form-state').html('Rozwiń');
247   - });
248   - */
249 215  
250 216 bind_form_events($('#main-form'));
251 217  
... ... @@ -261,8 +227,8 @@ function initialize_main_form() {
261 227 hide_form_errors();
262 228 var data = { 'forms' : serialize_forms($(this)) };
263 229 $.ajax({
264   - type : 'post',//$(this).attr('method'),
265   - url : $(this).attr('action'),
  230 + type : 'post',
  231 + url : '/' + lang + '/entries/get_entries/',
266 232 dataType : 'json',
267 233 data : data,
268 234 timeout : 60000,
... ... @@ -329,8 +295,8 @@ function add_subform(button) {
329 295  
330 296 function make_opinion_row(item, span, width) {
331 297 var opinion_row = document.createElement('tr');
332   - opinion_row.innerHTML = '<td class="py-2 px-1" style="width: ' + width + 'em;">Opinia:</td>';
333   - opinion_row.innerHTML += '<td class="py-2 px-1" colspan="' + span + '">[' + item.id + '] ' + item.opinion + '</td>';
  298 + opinion_row.innerHTML = '<td class="py-2 px-1" style="width: ' + width + 'em;">' + gettext('Opinia') + ':</td>';
  299 + opinion_row.innerHTML += '<td class="py-2 px-1" colspan="' + span + '">' + item.opinion + '</td>';
334 300 return opinion_row;
335 301 }
336 302  
... ... @@ -344,7 +310,7 @@ function schema2dom(schema) {
344 310 var div = document.createElement('div');
345 311 div.className = 'schema';
346 312 var table = document.createElement('table');
347   - table.className = 'table table-borderless border border-primary';
  313 + table.className = 'table table-borderless border border-secondary';
348 314 var tbody = document.createElement('tbody');
349 315  
350 316 // opinion
... ... @@ -352,14 +318,14 @@ function schema2dom(schema) {
352 318  
353 319 // position props and phrase types
354 320 var props_row = document.createElement('tr');
355   - props_row.innerHTML = '<td class="py-2 px-1">Funkcja:</td>';
  321 + props_row.innerHTML = '<td class="py-2 px-1">' + gettext('Funkcja') + ':</td>';
356 322 var phrases_row = document.createElement('tr');
357   - var phrases_html = '<td class="py-2 px-1">Typy fraz:</td>';
  323 + var phrases_html = '<td class="py-2 px-1">' + gettext('Typy fraz') + ':</td>';
358 324 for (var i in schema.positions) {
359 325 var position = schema.positions[i];
360 326 // position props: function, control, predicative control
361 327 var props_td = document.createElement('td');
362   - props_td.className = 'py-2 px-1 border-top border-left border-primary';
  328 + props_td.className = 'py-2 px-1 border-top border-left border-secondary';
363 329 var props_spans = [];
364 330 if (position.func.str !== '') {
365 331 props_spans.push(tooltipped_span(position.func.str, position.func.desc));
... ... @@ -373,10 +339,10 @@ function schema2dom(schema) {
373 339 props_td.innerHTML = props_spans.join(',');
374 340 props_row.append(props_td);
375 341 // don’t append to phrases_row.innerHTML since it automatically closes tags *** (?)
376   - phrases_html += '<td class="px-1 border-top border-left border-primary text-break">';
  342 + phrases_html += '<td class="px-1 border-top border-left border-secondary text-break">';
377 343 for (var j in position.phrases) {
378 344 var phrase = position.phrases[j];
379   - var cls = j > 0 ? ' border-top border-primary' : '';
  345 + var cls = j > 0 ? ' border-top border-secondary' : '';
380 346 for (var k in phrase.arguments) {
381 347 cls += ' argument-' + phrase.arguments[k];
382 348 }
... ... @@ -414,7 +380,7 @@ function subentries2dom(subentries) {
414 380 fragment.append(subentry_div);
415 381 }
416 382 if (fragment.childNodes.length === 0) {
417   - return '<p>(brak schematów)</p>';
  383 + return '<p>(' + gettext('brak schematów') + ')</p>';
418 384 }
419 385 return fragment;
420 386 }
... ... @@ -436,7 +402,7 @@ function frame2dom(frame) {
436 402 var div = document.createElement('div');
437 403 div.className = 'frame';
438 404 var table = document.createElement('table');
439   - table.className = 'table table-borderless border border-primary';
  405 + table.className = 'table table-borderless border border-secondary';
440 406 var tbody = document.createElement('tbody');
441 407  
442 408 // opinion
... ... @@ -444,9 +410,9 @@ function frame2dom(frame) {
444 410  
445 411 // roles and selectional preferences
446 412 var roles_row = document.createElement('tr');
447   - roles_row.innerHTML = '<td class="py-2 px-1">Rola:</td>';
  413 + roles_row.innerHTML = '<td class="py-2 px-1">' + gettext('Rola') + ':</td>';
448 414 var preferences_row = document.createElement('tr');
449   - var preferences_html = '<td class="py-2 px-1">Preferencje selekcyjne:</td>';
  415 + var preferences_html = '<td class="py-2 px-1">' + gettext('Preferencje selekcyjne') + ':</td>';
450 416 for (var i in frame.arguments) {
451 417 var argument = frame.arguments[i];
452 418 var cls = '';
... ... @@ -454,12 +420,12 @@ function frame2dom(frame) {
454 420 cls += ' phrase-' + argument.phrases[j];
455 421 }
456 422 var data = ' data-argument_id="' + argument.id + '"';
457   - roles_row.innerHTML += '<td class="py-2 px-1 border-top border-left border-primary' + cls + '"' + data + '>' + argument.str + '</td>';
  423 + roles_row.innerHTML += '<td class="py-2 px-1 border-top border-left border-secondary' + cls + '"' + data + '>' + argument.str + '</td>';
458 424  
459 425 // don’t append to preferences_html.innerHTML since it automatically closes tags *** (?)
460   - preferences_html += '<td class="px-1 border-top border-left border-primary text-break' + cls + '"' + data + '>'
  426 + preferences_html += '<td class="px-1 border-top border-left border-secondary text-break' + cls + '"' + data + '>'
461 427 for (var j in argument.preferences) {
462   - var cls = j > 0 ? ' border-top border-primary' : '';
  428 + var cls = j > 0 ? ' border-top border-secondary' : '';
463 429 preferences_html += '<div class="preference py-2' + cls + '">' + argument.preferences[j] + '</div>';
464 430 }
465 431 // *** and we want to close the <td> here
... ... @@ -483,7 +449,7 @@ function frames2dom(frames) {
483 449 fragment.append(frame2dom(frames[i]));
484 450 }
485 451 if (fragment.childNodes.length == 0) {
486   - return '<p>(brak ram)</p>';
  452 + return '<p>(' + gettext('brak ram') + ')</p>';
487 453 }
488 454 return fragment;
489 455 }
... ... @@ -504,7 +470,7 @@ function get_schemata_and_frames(entry_id) {
504 470 var data = { 'forms' : serialize_forms($('#main-form')), 'entry' : entry_id };
505 471 $.ajax({
506 472 type : 'post',
507   - url : '/entries/get_entry/',
  473 + url : '/' + lang + '/entries/get_entry/',
508 474 dataType : 'json',
509 475 data : data,
510 476 timeout : 60000,
... ... @@ -530,7 +496,7 @@ function show_entries(entries) {
530 496 if (html != '') {
531 497 $('#entries').html(html);
532 498 } else {
533   - $('#entries').html('<tr><td>(brak haseł)</td></tr>');
  499 + $('#entries').html('<tr><td>(' + gettext('brak haseł') + ')</td></tr>');
534 500 }
535 501 $('.entry').click(function() {
536 502 var selected_entry = $(this).data('entry');
... ...
entries/templates/entries.html
1 1 {% extends "base.html" %}
2 2  
  3 +{% load i18n %}
3 4 {% load static %}
4 5 {% load crispy_forms_tags %}
5 6  
... ... @@ -33,7 +34,7 @@
33 34 <!-- left panel: list of entries -->
34 35 <div id="entries-list" class="col-2 h-100 overflow-auto border-right border-primary">
35 36 <button type="button" id='filter-button' class="btn btn-primary" data-toggle="modal" data-target="#entry-filters">
36   - Filtrowanie
  37 + {% trans "Filtrowanie" %}
37 38 </button>
38 39 {% include "entries_list.html" %}
39 40 </div>
... ... @@ -53,7 +54,7 @@
53 54 <div class="modal-dialog modal-xl" role="document">
54 55 <div class="modal-content">
55 56 <div class="modal-header">
56   - <h5 class="modal-title" id="entry-filtersLabel">Filtrowanie haseł</h5>
  57 + <h5 class="modal-title" id="entry-filtersLabel">{% trans "Filtrowanie haseł" %}</h5>
57 58 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
58 59 <span aria-hidden="true">&times;</span>
59 60 </button>
... ...
entries/templates/entry_display.html
  1 +{% load i18n %}
  2 +
1 3 <ul class="nav nav-tabs nav-justified sticky-top bg-light" id="entryTabs" role="tablist">
2 4 <li class="nav-item">
3 5 <a class="nav-link active" id="semantics-tab" data-toggle="tab" href="#semantics" role="tab" aria-controls="semantics" aria-selected="true">
4   - Semantyka (ramy + schematy)
  6 + {% trans "Semantyka (ramy + schematy)" %}
5 7 </a>
6 8 </li>
7 9 <li class="nav-item">
8 10 <a class="nav-link" id="syntax-tab" data-toggle="tab" href="#syntax" role="tab" aria-controls="syntax" aria-selected="false">
9   - Składnia (schematy)
  11 + {% trans "Składnia (schematy)" %}
10 12 </a>
11 13 </li>
12 14 <li class="nav-item">
13 15 <a class="nav-link" id="examples-tab" data-toggle="tab" href="#examples" role="tab" aria-controls="examples" aria-selected="false">
14   - Przykłady niedopasowane
  16 + {% trans "Przykłady niedopasowane" %}
15 17 </a>
16 18 </li>
17 19 </ul>
... ...
entries/views.py
... ... @@ -254,7 +254,7 @@ def get_phrase_desc(phrase, position, negativity):
254 254  
255 255 def schema2dict(schema, phr2arg, negativity):
256 256 return {
257   - 'opinion' : SCHEMA_OPINION[schema.opinion.key],
  257 + 'opinion' : SCHEMA_OPINION()[schema.opinion.key],
258 258 'id' : str(schema.id),
259 259 'positions' : [
260 260 {
... ... @@ -281,7 +281,7 @@ def get_prefs_list(argument):
281 281  
282 282 def frame2dict(frame, arg2phr):
283 283 return {
284   - 'opinion' : FRAME_OPINION[frame.opinion.key],
  284 + 'opinion' : FRAME_OPINION()[frame.opinion.key],
285 285 'id' : str(frame.id),
286 286 'arguments' : [
287 287 {
... ...
locale/en/LC_MESSAGES/django.mo 0 → 100644
No preview for this file type
locale/en/LC_MESSAGES/django.po 0 → 100644
  1 +# SOME DESCRIPTIVE TITLE.
  2 +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
  3 +# This file is distributed under the same license as the PACKAGE package.
  4 +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
  5 +#
  6 +#, fuzzy
  7 +msgid ""
  8 +msgstr ""
  9 +"Project-Id-Version: PACKAGE VERSION\n"
  10 +"Report-Msgid-Bugs-To: \n"
  11 +"POT-Creation-Date: 2020-10-13 18:07+0200\n"
  12 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  13 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  14 +"Language-Team: LANGUAGE <LL@li.org>\n"
  15 +"Language: \n"
  16 +"MIME-Version: 1.0\n"
  17 +"Content-Type: text/plain; charset=UTF-8\n"
  18 +"Content-Transfer-Encoding: 8bit\n"
  19 +"Plural-Forms: nplurals=2; plural=(n != 1);\n"
  20 +
  21 +#: common/templates/base.html:42
  22 +msgid "Hasła"
  23 +msgstr "Entries"
  24 +
  25 +#: common/templates/base.html:47
  26 +msgid "Typy fraz"
  27 +msgstr "Phrase types"
  28 +
  29 +#: common/templates/base.html:52
  30 +msgid "Statystyki"
  31 +msgstr "Statistics"
  32 +
  33 +#: common/templates/base.html:57
  34 +msgid "Pobierz słownik"
  35 +msgstr "Download dictionary"
  36 +
  37 +#: common/templates/base.html:76
  38 +msgid "EN"
  39 +msgstr "PL"
  40 +
  41 +#: entries/form_fields/specialised_fields.py:36 entries/forms.py:501
  42 +msgid "Typ frazeologizmu"
  43 +msgstr "Phraseologism type"
  44 +
  45 +#: entries/form_fields/specialised_fields.py:36
  46 +msgid "Typ frazy"
  47 +msgstr "Phrase type"
  48 +
  49 +#: entries/form_fields/specialised_fields.py:44
  50 +msgid "wybierz"
  51 +msgstr "choose"
  52 +
  53 +#: entries/form_fields/specialised_fields.py:167
  54 +msgid "Frazeologia"
  55 +msgstr "Phraseology"
  56 +
  57 +#: entries/form_fields/specialised_fields.py:168 entries/polish_strings.py:89
  58 +msgid "dowolnie"
  59 +msgstr "any"
  60 +
  61 +#: entries/form_fields/specialised_fields.py:168
  62 +msgid "zawiera"
  63 +msgstr "contains"
  64 +
  65 +#: entries/form_fields/specialised_fields.py:168
  66 +msgid "nie zawiera"
  67 +msgstr "doesn’t contain"
  68 +
  69 +#: entries/forms.py:101
  70 +msgid "Lub"
  71 +msgstr "Or"
  72 +
  73 +#: entries/forms.py:141
  74 +msgid "Schemat"
  75 +msgstr "Schema"
  76 +
  77 +#: entries/forms.py:145 entries/forms.py:435 entries/forms.py:595
  78 +#: entries/forms.py:709 entries/forms.py:711 entries/forms.py:713
  79 +msgid "Fraza"
  80 +msgstr "Phrase"
  81 +
  82 +#: entries/forms.py:150
  83 +msgid "Rama"
  84 +msgstr "Frame"
  85 +
  86 +#: entries/forms.py:156
  87 +msgid "Własności hasła"
  88 +msgstr "Entry properties"
  89 +
  90 +#: entries/forms.py:157
  91 +msgid "Własności składniowe"
  92 +msgstr "Syntactic properties"
  93 +
  94 +#: entries/forms.py:158
  95 +msgid "Własności semantyczne"
  96 +msgstr "Semantic properties"
  97 +
  98 +#: entries/forms.py:159
  99 +msgid "Filtruj"
  100 +msgstr "Filter"
  101 +
  102 +#: entries/forms.py:160
  103 +msgid "Wyczyść"
  104 +msgstr "Reset"
  105 +
  106 +#: entries/forms.py:166 entries/forms.py:451 entries/forms.py:457
  107 +#: entries/forms.py:496
  108 +msgid "Lemat"
  109 +msgstr "Lemma"
  110 +
  111 +#: entries/forms.py:172
  112 +msgid "Część mowy"
  113 +msgstr "Part of speech"
  114 +
  115 +#: entries/forms.py:186
  116 +msgid "Liczba schematów"
  117 +msgstr "Number of schemata"
  118 +
  119 +#: entries/forms.py:190
  120 +msgid "Liczba ram"
  121 +msgstr "Number of frames"
  122 +
  123 +#: entries/forms.py:193
  124 +msgid "Typ frazy występujący w haśle."
  125 +msgstr ""
  126 +
  127 +#: entries/forms.py:194
  128 +msgid "Ukryj niepasujące schematy"
  129 +msgstr "Hide non-matching schemata"
  130 +
  131 +#: entries/forms.py:195
  132 +msgid "Ukryj niepasujące ramy"
  133 +msgstr "Hide non-matching frames"
  134 +
  135 +#: entries/forms.py:234
  136 +msgid "Zwiń"
  137 +msgstr "Collapse"
  138 +
  139 +#: entries/forms.py:234
  140 +msgid "Usuń"
  141 +msgstr "Remove"
  142 +
  143 +#: entries/forms.py:269
  144 +msgid "Zaneguj"
  145 +msgstr "Negate"
  146 +
  147 +#: entries/forms.py:283
  148 +msgid "Schemat składniowy"
  149 +msgstr "Syntactic schema"
  150 +
  151 +#: entries/forms.py:289
  152 +msgid "Opinia o schemacie"
  153 +msgstr "Schema opinion"
  154 +
  155 +#: entries/forms.py:301
  156 +msgid "Typ"
  157 +msgstr "Type"
  158 +
  159 +#: entries/forms.py:302
  160 +msgid "zwykły"
  161 +msgstr "ordinary"
  162 +
  163 +#: entries/forms.py:302
  164 +msgid "frazeologiczny"
  165 +msgstr "phraseological"
  166 +
  167 +#: entries/forms.py:310
  168 +msgid "Zwrotność"
  169 +msgstr "Reflexiveness"
  170 +
  171 +#: entries/forms.py:383 entries/forms.py:590
  172 +msgid "Pozycja"
  173 +msgstr "Position"
  174 +
  175 +#: entries/forms.py:399
  176 +msgid "Pozycja składniowa"
  177 +msgstr "Syntactic position"
  178 +
  179 +#: entries/forms.py:405
  180 +msgid "Funkcja gramatyczna"
  181 +msgstr "Grammatical function"
  182 +
  183 +#: entries/forms.py:415
  184 +msgid "Kontrola"
  185 +msgstr "Control"
  186 +
  187 +#: entries/forms.py:425
  188 +msgid "Kontrola predykatywna"
  189 +msgstr "Predicative control"
  190 +
  191 +#: entries/forms.py:434
  192 +msgid "Typ frazy występujący na pozycji."
  193 +msgstr ""
  194 +
  195 +#: entries/forms.py:471
  196 +msgid "Frazeologizm"
  197 +msgstr "Phraseologism"
  198 +
  199 +#: entries/forms.py:477
  200 +msgid "Wybór lematów"
  201 +msgstr "Lemma choice"
  202 +
  203 +#: entries/forms.py:487
  204 +msgid "Łączenie lematów"
  205 +msgstr "Lemma joining"
  206 +
  207 +#: entries/forms.py:500 entries/forms.py:739
  208 +msgid "Typ składniowy frazeologizmu."
  209 +msgstr ""
  210 +
  211 +#: entries/forms.py:519
  212 +msgid "Rama semantyczna"
  213 +msgstr "Semantic frame"
  214 +
  215 +#: entries/forms.py:525
  216 +msgid "Opinia"
  217 +msgstr "Opinion"
  218 +
  219 +#: entries/forms.py:535
  220 +msgid "Liczba argumentów"
  221 +msgstr "Number of arguments"
  222 +
  223 +#: entries/forms.py:542
  224 +msgid "Liczba preferencyj selekcyjnych argumentu"
  225 +msgstr "Number of argument’s selectional preferences"
  226 +
  227 +#: entries/forms.py:548
  228 +msgid "Argument"
  229 +msgstr "Argument"
  230 +
  231 +#: entries/forms.py:558
  232 +msgid "Argument semantyczny"
  233 +msgstr "Semantic argument"
  234 +
  235 +#: entries/forms.py:564
  236 +msgid "Rola"
  237 +msgstr "Role"
  238 +
  239 +#: entries/forms.py:573
  240 +msgid "Atrybut roli"
  241 +msgstr "Role attribute"
  242 +
  243 +#: entries/forms.py:582 entries/forms.py:586
  244 +msgid "Preferencja selekcyjna"
  245 +msgstr "Selectional preference"
  246 +
  247 +#: entries/forms.py:583
  248 +msgid "Predefiniowana grupa znaczeń"
  249 +msgstr "Predefined meanings class"
  250 +
  251 +#: entries/forms.py:583
  252 +msgid "Wyrażona przez relację"
  253 +msgstr "Expressed by relation"
  254 +
  255 +#: entries/forms.py:583
  256 +msgid "Wyrażona przez jednostkę leksykalną Słowosieci"
  257 +msgstr "Expressed by plWordnet lexical unit"
  258 +
  259 +#: entries/forms.py:594
  260 +msgid "Typ frazy, przez którą może być realizowany argument."
  261 +msgstr ""
  262 +
  263 +#: entries/forms.py:605
  264 +msgid "Preferencja predefiniowana"
  265 +msgstr "Predefined preference"
  266 +
  267 +#: entries/forms.py:626
  268 +msgid "Preferencja – relacja"
  269 +msgstr "Relational preference"
  270 +
  271 +#: entries/forms.py:632
  272 +msgid "Relacja"
  273 +msgstr "Relation"
  274 +
  275 +#: entries/forms.py:642
  276 +msgid "Do: rola"
  277 +msgstr "To: role"
  278 +
  279 +#: entries/forms.py:651
  280 +msgid "Do: atrybut"
  281 +msgstr "To: attribute"
  282 +
  283 +#: entries/forms.py:666
  284 +msgid "Preferencja – Słowosieć"
  285 +msgstr "plWordnet preference"
  286 +
  287 +#: entries/forms.py:672
  288 +msgid "Jednostka leksykalna"
  289 +msgstr "Lexical unit"
  290 +
  291 +#: entries/forms.py:720 entries/polish_strings.py:114
  292 +msgid "frazeologizm"
  293 +msgstr "phraseologism"
  294 +
  295 +#: entries/forms.py:735
  296 +msgid "Fraza składowa frazeologizmu porównawczego."
  297 +msgstr ""
  298 +
  299 +#: entries/forms.py:737
  300 +msgid "Fraza realizująca frazeologizm."
  301 +msgstr ""
  302 +
  303 +#: entries/polish_strings.py:5
  304 +msgid "przymiotnik"
  305 +msgstr "adjective"
  306 +
  307 +#: entries/polish_strings.py:6
  308 +msgid "przysłówek"
  309 +msgstr "adverb"
  310 +
  311 +#: entries/polish_strings.py:7
  312 +msgid "rzeczownik"
  313 +msgstr "noun"
  314 +
  315 +#: entries/polish_strings.py:8
  316 +msgid "czasownik"
  317 +msgstr "verb"
  318 +
  319 +#: entries/polish_strings.py:11
  320 +msgid "dokonany"
  321 +msgstr "perfect"
  322 +
  323 +#: entries/polish_strings.py:11
  324 +msgid "niedokonany"
  325 +msgstr "imperfect"
  326 +
  327 +#: entries/polish_strings.py:13
  328 +msgid "zanegowany"
  329 +msgstr "negated"
  330 +
  331 +#: entries/polish_strings.py:13
  332 +msgid "niezanegowany"
  333 +msgstr "not negated"
  334 +
  335 +#: entries/polish_strings.py:13
  336 +msgid "dowolny"
  337 +msgstr "any"
  338 +
  339 +#: entries/polish_strings.py:15
  340 +msgid "tak"
  341 +msgstr "yes"
  342 +
  343 +#: entries/polish_strings.py:15
  344 +msgid "nie"
  345 +msgstr "no"
  346 +
  347 +#: entries/polish_strings.py:19
  348 +msgid "wulgarny"
  349 +msgstr "vulgar"
  350 +
  351 +#: entries/polish_strings.py:20
  352 +msgid "potoczny"
  353 +msgstr "colloquial"
  354 +
  355 +#: entries/polish_strings.py:21
  356 +msgid "archaiczny"
  357 +msgstr "archaic"
  358 +
  359 +#: entries/polish_strings.py:22
  360 +msgid "zły"
  361 +msgstr "bad"
  362 +
  363 +#: entries/polish_strings.py:23
  364 +msgid "wątpliwy"
  365 +msgstr "uncertain"
  366 +
  367 +#: entries/polish_strings.py:24
  368 +msgid "pewny"
  369 +msgstr "certain"
  370 +
  371 +#: entries/polish_strings.py:29
  372 +msgid "wulgarna"
  373 +msgstr "vulgar"
  374 +
  375 +#: entries/polish_strings.py:30
  376 +msgid "potoczna"
  377 +msgstr "colloquial"
  378 +
  379 +#: entries/polish_strings.py:31
  380 +msgid "archaiczna"
  381 +msgstr "archaic"
  382 +
  383 +#: entries/polish_strings.py:32
  384 +msgid "zła"
  385 +msgstr "bad"
  386 +
  387 +#: entries/polish_strings.py:33
  388 +msgid "niepewna"
  389 +msgstr "uncertain"
  390 +
  391 +#: entries/polish_strings.py:34
  392 +msgid "pewna"
  393 +msgstr "certain"
  394 +
  395 +#: entries/polish_strings.py:35
  396 +msgid "sporadyczna"
  397 +msgstr "rare"
  398 +
  399 +#: entries/polish_strings.py:36
  400 +msgid "dziedzinowa"
  401 +msgstr "domain-specific"
  402 +
  403 +#: entries/polish_strings.py:37
  404 +msgid "metaforyczna"
  405 +msgstr "metaphorical"
  406 +
  407 +#: entries/polish_strings.py:38
  408 +msgid "nieznana"
  409 +msgstr "unknown"
  410 +
  411 +#: entries/polish_strings.py:43
  412 +msgid "podmiot"
  413 +msgstr "subject"
  414 +
  415 +#: entries/polish_strings.py:44
  416 +msgid "dopełnienie"
  417 +msgstr "object"
  418 +
  419 +#: entries/polish_strings.py:45
  420 +msgid "centrum"
  421 +msgstr "head"
  422 +
  423 +#: entries/polish_strings.py:50 entries/polish_strings.py:54
  424 +msgid "kontrolujący"
  425 +msgstr "controller"
  426 +
  427 +#: entries/polish_strings.py:51 entries/polish_strings.py:55
  428 +msgid "kontrolowany"
  429 +msgstr "controllee"
  430 +
  431 +#: entries/polish_strings.py:52
  432 +msgid "kontrolujący #2"
  433 +msgstr "controller #2"
  434 +
  435 +#: entries/polish_strings.py:53
  436 +msgid "kontrolowany #2"
  437 +msgstr "controllee #2"
  438 +
  439 +#: entries/polish_strings.py:60
  440 +msgid "Przypadek"
  441 +msgstr "Case"
  442 +
  443 +#: entries/polish_strings.py:61
  444 +msgid "Liczba"
  445 +msgstr "Number"
  446 +
  447 +#: entries/polish_strings.py:62
  448 +msgid "Rodzaj"
  449 +msgstr "Gender"
  450 +
  451 +#: entries/polish_strings.py:63
  452 +msgid "Stopień"
  453 +msgstr "Degree"
  454 +
  455 +#: entries/polish_strings.py:64
  456 +msgid "Przyimek"
  457 +msgstr "Preposition"
  458 +
  459 +#: entries/polish_strings.py:65
  460 +msgid "Przyimek złożony"
  461 +msgstr "Complex preposition"
  462 +
  463 +#: entries/polish_strings.py:66
  464 +msgid "Inherentne <i>się</i>"
  465 +msgstr "Inherentne <i>się</i>"
  466 +
  467 +#: entries/polish_strings.py:67
  468 +msgid "Zanegowanie"
  469 +msgstr "Negativity"
  470 +
  471 +#: entries/polish_strings.py:68
  472 +msgid "Typ frazy zdaniowej"
  473 +msgstr "Clause type"
  474 +
  475 +#: entries/polish_strings.py:69
  476 +msgid "Realizacje"
  477 +msgstr "Realisations"
  478 +
  479 +#: entries/polish_strings.py:70
  480 +msgid "Aspekt"
  481 +msgstr "Aspect"
  482 +
  483 +#: entries/polish_strings.py:71
  484 +msgid "Typ okolicznika"
  485 +msgstr "Adverbial type"
  486 +
  487 +#: entries/polish_strings.py:72
  488 +msgid "Typ frazy porównawczej"
  489 +msgstr "Comparative phrase type"
  490 +
  491 +#: entries/polish_strings.py:73
  492 +msgid "Postać frazeologizmu"
  493 +msgstr "Phraseologism text"
  494 +
  495 +#: entries/polish_strings.py:78
  496 +msgid "strukturalny"
  497 +msgstr "structural"
  498 +
  499 +#: entries/polish_strings.py:79
  500 +msgid "mianownik"
  501 +msgstr "nominative"
  502 +
  503 +#: entries/polish_strings.py:80
  504 +msgid "dopełniacz"
  505 +msgstr "genitive"
  506 +
  507 +#: entries/polish_strings.py:81
  508 +msgid "celownik"
  509 +msgstr "dative"
  510 +
  511 +#: entries/polish_strings.py:82
  512 +msgid "biernik"
  513 +msgstr "accusative"
  514 +
  515 +#: entries/polish_strings.py:83
  516 +msgid "narzędnik"
  517 +msgstr "instrumental"
  518 +
  519 +#: entries/polish_strings.py:84
  520 +msgid "miejscownik"
  521 +msgstr "locative"
  522 +
  523 +#: entries/polish_strings.py:85
  524 +msgid "predykatywny"
  525 +msgstr "predicative"
  526 +
  527 +#: entries/polish_strings.py:86
  528 +msgid "partytytwny"
  529 +msgstr "partitive"
  530 +
  531 +#: entries/polish_strings.py:87
  532 +msgid "poprzyimkowy"
  533 +msgstr "postprepositional"
  534 +
  535 +#: entries/polish_strings.py:88
  536 +msgid "uzgodnienie"
  537 +msgstr "agreement"
  538 +
  539 +#: entries/polish_strings.py:90
  540 +msgid "pojedyncza"
  541 +msgstr "singular"
  542 +
  543 +#: entries/polish_strings.py:91
  544 +msgid "mnoga"
  545 +msgstr "plural"
  546 +
  547 +#: entries/polish_strings.py:92
  548 +msgid "męski osobowy"
  549 +msgstr "masculine personal"
  550 +
  551 +#: entries/polish_strings.py:93
  552 +msgid "męski żywotny"
  553 +msgstr "masculine animate"
  554 +
  555 +#: entries/polish_strings.py:94
  556 +msgid "męski nieżywotny"
  557 +msgstr "masculine inanimate"
  558 +
  559 +#: entries/polish_strings.py:95
  560 +msgid "żeński"
  561 +msgstr "feminine"
  562 +
  563 +#: entries/polish_strings.py:96
  564 +msgid "nijaki"
  565 +msgstr "neuter"
  566 +
  567 +#: entries/polish_strings.py:97
  568 +msgid "równy"
  569 +msgstr "positive"
  570 +
  571 +#: entries/polish_strings.py:98
  572 +msgid "wyższy"
  573 +msgstr "comparative"
  574 +
  575 +#: entries/polish_strings.py:99
  576 +msgid "najwyższy"
  577 +msgstr "superlative"
  578 +
  579 +#: entries/polish_strings.py:104
  580 +msgid "przymiotnikowa"
  581 +msgstr "adjectival"
  582 +
  583 +#: entries/polish_strings.py:105
  584 +msgid "przysłówkowa"
  585 +msgstr "adverbial"
  586 +
  587 +#: entries/polish_strings.py:106
  588 +msgid "porównawcza"
  589 +msgstr "comparative"
  590 +
  591 +#: entries/polish_strings.py:107
  592 +msgid "przyimkowa z przyimkiem złożonym"
  593 +msgstr "prepositional with complex preposition"
  594 +
  595 +#: entries/polish_strings.py:108
  596 +msgid "zdaniowa"
  597 +msgstr "clause"
  598 +
  599 +#: entries/polish_strings.py:109
  600 +msgid "dystrybutywna"
  601 +msgstr "distributive"
  602 +
  603 +#: entries/polish_strings.py:111
  604 +msgid "podmiot czasownika wymagającego bezokolicznika"
  605 +msgstr ""
  606 +
  607 +#: entries/polish_strings.py:112
  608 +msgid "frazeologizm zamrożony"
  609 +msgstr "fixed phraseologism"
  610 +
  611 +#: entries/polish_strings.py:113
  612 +msgid "bezokolicznikowa"
  613 +msgstr "infinitival"
  614 +
  615 +#: entries/polish_strings.py:115
  616 +msgid "zdaniowa z korelatem"
  617 +msgstr "clause with a correlate"
  618 +
  619 +#: entries/polish_strings.py:116
  620 +msgid "niechromatyczna"
  621 +msgstr "nonchromatic"
  622 +
  623 +#: entries/polish_strings.py:117
  624 +msgid "rzeczownikowa"
  625 +msgstr "nominal"
  626 +
  627 +#: entries/polish_strings.py:118
  628 +msgid "liczebnikowa"
  629 +msgstr "numeral"
  630 +
  631 +#: entries/polish_strings.py:119
  632 +msgid "mowa niezależna"
  633 +msgstr "direct speech"
  634 +
  635 +#: entries/polish_strings.py:120
  636 +msgid "posesywna"
  637 +msgstr "possesive"
  638 +
  639 +#: entries/polish_strings.py:121
  640 +msgid "imiesłowowa"
  641 +msgstr "participal"
  642 +
  643 +#: entries/polish_strings.py:122
  644 +msgid "przyimkowo-przymiotnikowa"
  645 +msgstr "adjectival-prepositional"
  646 +
  647 +#: entries/polish_strings.py:123
  648 +msgid "przyimkowo-odsłownikowa"
  649 +msgstr "gerundial-prepositional"
  650 +
  651 +#: entries/polish_strings.py:124
  652 +msgid "zdaniowa z korelatem przyimkowym"
  653 +msgstr "clause with a prepositional correlate"
  654 +
  655 +#: entries/polish_strings.py:125
  656 +msgid "przyimkowo-rzeczownikowa"
  657 +msgstr "nominal-prepositional"
  658 +
  659 +#: entries/polish_strings.py:126
  660 +msgid "przyimkowo-liczebnikowa"
  661 +msgstr "numeral-prepositional"
  662 +
  663 +#: entries/polish_strings.py:127
  664 +msgid "przyimkowo-imiesłowowa"
  665 +msgstr "participal-prepositional"
  666 +
  667 +#: entries/polish_strings.py:128
  668 +msgid "partykuła"
  669 +msgstr "particle"
  670 +
  671 +#: entries/polish_strings.py:129
  672 +msgid "wzajemnościowa partykuła się"
  673 +msgstr "reciprocal się particle"
  674 +
  675 +#: entries/polish_strings.py:130
  676 +msgid "zwrotna partykuła się"
  677 +msgstr "reflexive się particle"
  678 +
  679 +#: entries/polish_strings.py:131
  680 +msgid "okolicznikowa"
  681 +msgstr "adverbial"
  682 +
  683 +#: entries/polish_strings.py:141
  684 +msgid "lub"
  685 +msgstr "or"
  686 +
  687 +#: entries/polish_strings.py:142
  688 +msgid "wyłącznie"
  689 +msgstr "exclusively"
  690 +
  691 +#: entries/polish_strings.py:147
  692 +msgid "szeregowo (bez spójnika)"
  693 +msgstr "concatenation (no conjunction)"
  694 +
  695 +#: entries/polish_strings.py:148
  696 +msgid "koordynacja (ze spójnikiem)"
  697 +msgstr "coordination (with conjunction)"
  698 +
  699 +#: entries/templates/entries.html:37
  700 +msgid "Filtrowanie"
  701 +msgstr "Filtering"
  702 +
  703 +#: entries/templates/entries.html:57
  704 +msgid "Filtrowanie haseł"
  705 +msgstr "Entry filtering"
  706 +
  707 +#: entries/templates/entry_display.html:6
  708 +msgid "Semantyka (ramy + schematy)"
  709 +msgstr "Semantics (frames + schemata)"
  710 +
  711 +#: entries/templates/entry_display.html:11
  712 +msgid "Składnia (schematy)"
  713 +msgstr "Syntax (schemata)"
  714 +
  715 +#: entries/templates/entry_display.html:16
  716 +msgid "Przykłady niedopasowane"
  717 +msgstr "Unmatched examples"
... ...
locale/en/LC_MESSAGES/djangojs.mo 0 → 100644
No preview for this file type
locale/en/LC_MESSAGES/djangojs.po 0 → 100644
  1 +# SOME DESCRIPTIVE TITLE.
  2 +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
  3 +# This file is distributed under the same license as the PACKAGE package.
  4 +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
  5 +#
  6 +#, fuzzy
  7 +msgid ""
  8 +msgstr ""
  9 +"Project-Id-Version: PACKAGE VERSION\n"
  10 +"Report-Msgid-Bugs-To: \n"
  11 +"POT-Creation-Date: 2020-10-13 18:07+0200\n"
  12 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  13 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  14 +"Language-Team: LANGUAGE <LL@li.org>\n"
  15 +"Language: \n"
  16 +"MIME-Version: 1.0\n"
  17 +"Content-Type: text/plain; charset=UTF-8\n"
  18 +"Content-Transfer-Encoding: 8bit\n"
  19 +"Plural-Forms: nplurals=2; plural=(n != 1);\n"
  20 +
  21 +#: entries/static/entries/js/entries.js:60
  22 +msgid "Formularz filtrowania zawiera błędy."
  23 +msgstr "The filtering form contains errors."
  24 +
  25 +#: entries/static/entries/js/entries.js:101
  26 +msgid "zwiń"
  27 +msgstr "collapse"
  28 +
  29 +#: entries/static/entries/js/entries.js:106
  30 +msgid "rozwiń"
  31 +msgstr "expand"
  32 +
  33 +#: entries/static/entries/js/entries.js:143
  34 +msgid "LUB"
  35 +msgstr "OR"
  36 +
  37 +#: entries/static/entries/js/entries.js:143
  38 +msgid "Usuń"
  39 +msgstr "Remove"
  40 +
  41 +#: entries/static/entries/js/entries.js:298
  42 +msgid "Opinia"
  43 +msgstr "Opinion"
  44 +
  45 +#: entries/static/entries/js/entries.js:321
  46 +msgid "Funkcja"
  47 +msgstr "Function"
  48 +
  49 +#: entries/static/entries/js/entries.js:323
  50 +msgid "Typy fraz"
  51 +msgstr "Phrase types"
  52 +
  53 +#: entries/static/entries/js/entries.js:383
  54 +msgid "brak schematów"
  55 +msgstr "no schemata"
  56 +
  57 +#: entries/static/entries/js/entries.js:413
  58 +msgid "Rola"
  59 +msgstr "Role"
  60 +
  61 +#: entries/static/entries/js/entries.js:415
  62 +msgid "Preferencje selekcyjne"
  63 +msgstr "Selectional preferences"
  64 +
  65 +#: entries/static/entries/js/entries.js:452
  66 +msgid "brak ram"
  67 +msgstr "no frames"
  68 +
  69 +#: entries/static/entries/js/entries.js:499
  70 +msgid "brak haseł"
  71 +msgstr "no entries"
... ...
shellvalier/urls.py
1   -"""shellvalier URL Configuration
2   -
3   -The `urlpatterns` list routes URLs to views. For more information please see:
4   - https://docs.djangoproject.com/en/2.1/topics/http/urls/
5   -Examples:
6   -Function views
7   - 1. Add an import: from my_app import views
8   - 2. Add a URL to urlpatterns: path('', views.home, name='home')
9   -Class-based views
10   - 1. Add an import: from other_app.views import Home
11   - 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
12   -Including another URLconf
13   - 1. Import the include() function: from django.urls import include, path
14   - 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
15   -"""
  1 +from django.conf.urls.i18n import i18n_patterns
16 2 from django.contrib import admin
17 3 from django.urls import include, path
18 4  
  5 +from django.views.i18n import JavaScriptCatalog
  6 +
19 7 from common.views import dash, error_400, error_404
20 8  
21   -urlpatterns = [
  9 +# prepend non default-language to the urls
  10 +urlpatterns = i18n_patterns(
22 11 path('entries/', include('entries.urls')),
23 12 path('phrase_expansions/', include('phrase_expansions.urls')),
24 13 path('dictionary_statistics/', include('dictionary_statistics.urls')),
25 14 path('download/', include('download.urls')),
  15 + path('jsi18n/', JavaScriptCatalog.as_view(), name='javascript-catalog'),
26 16 path('admin/', admin.site.urls, name='admin'),
27 17 path('', dash, name='dash'),
28   -]
  18 + # uncomment to leave default (Polish) urls unchanged
  19 + #prefix_default_language=False,
  20 +)
29 21  
30   -handler400 = error_400
31   -handler404 = error_404
  22 +#handler400 = error_400
  23 +#handler404 = error_404
... ...
update_translations.sh 0 → 100755
  1 +django-admin makemessages -a
  2 +django-admin makemessages -d djangojs -a
  3 +
  4 +echo
  5 +echo '***'
  6 +echo 'now update your translations in:'
  7 +echo ' -> locale/en/LC_MESSAGES/django.po'
  8 +echo ' -> locale/en/LC_MESSAGES/djangojs.po'
  9 +echo 'and run ./compile_translations.sh to apply them'
  10 +echo '***'
  11 +echo
... ...