Merge pull request #1877 from emanuelschuetze/translationFix

Add Translation strings and updated po files
This commit is contained in:
Norman Jäckel 2016-01-24 22:17:56 +01:00
commit 673a761f6d
6 changed files with 580 additions and 443 deletions

View File

@ -1,27 +1,35 @@
Instruction to update translation for OpenSlides:
-------------------------------------------------
Instruction to update translations for OpenSlides (JavaScipt and Django):
-------------------------------------------------------------------------
1. Go to the openslides directory (which contains the 'locale' directory):
1. Update English resource files:
a) for JavaScript run:
$ ./node_modules/.bin/gulp pot
-> updates 'openslides/locale/angular-gettext/template-en.pot'
b) for Django:
$ cd openslides
$ django-admin.py makemessages -l en
-> updates 'openslides/locale/en/LC_MESSAGES/django.po'
2. Commit and merge the following files into OpenSlides master repo:
a) openslides/locale/angular-gettext/template-en.pot
b) openslides/locale/en/LC_MESSAGES/django.po
Transifex will update both resource files once a day by pulling from GitHub.
3. Translate both files in transifex into desired languages.
https://www.transifex.com/openslides/
4. Download translated po files for each language and override it:
a) openslides/locale/angular-gettext/{LANG-CODE}.po
b) openslides/locale/{LANG-CODE}/LC_MESSAGES/django.po
5. Create mo file for each language (only for django po files required)
$ cd openslides
2. Update the German po file (locale/de/LC_MESSAGES/django.po):
$ django-admin.py makemessages -l de
$ django-admin.py makemessages -l de -d djangojs
3. Edit the German po file: locale/de/LC_MESSAGES/django.po
Don't forget the js-file: locale/de/LC_MESSAGES/djangojs.po
(Search for "fuzzy" and empty msgstr entries.)
4. Update the German mo file (locale/de/LC_MESSAGES/django.mo):
$ django-admin.py compilemessages
5. Restart server:
$ python manage.py runserver
--
Additional hints for internationalization (i18n) in Django:
https://docs.djangoproject.com/en/dev/topics/i18n/
Note: gettext is required to extract message IDs or compile message files.
For gettext on Windows read:
https://docs.djangoproject.com/en/dev/topics/i18n/translation/#gettext-on-windows
6. Commit and merge for each language the following files:
a) openslides/locale/angular-gettext/{LANG-CODE}.po
b) openslides/locale/{LANG-CODE}/LC_MESSAGES/django.po
openslides/locale/{LANG-CODE}/LC_MESSAGES/django.mo

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-01-13 11:44+0100\n"
"POT-Creation-Date: 2016-01-22 21:13+0100\n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -187,12 +187,12 @@ msgstr ""
msgid "You have to submit data for %d candidates."
msgstr ""
#: assignments/serializers.py:140 motions/serializers.py:168
#: assignments/serializers.py:140 motions/serializers.py:176
#, python-format
msgid "You have to submit data for %d vote values."
msgstr ""
#: assignments/serializers.py:144 motions/serializers.py:172
#: assignments/serializers.py:144 motions/serializers.py:180
#, python-format
msgid "Vote value %s is invalid."
msgstr ""
@ -331,7 +331,7 @@ msgstr ""
#: assignments/views.py:175
msgid ""
"You can not delete someones candidature to this election because it is "
"You can not delete someone's candidature to this election because it is "
"finished."
msgstr ""
@ -677,7 +677,7 @@ msgstr ""
#: motions/signals.py:86 motions/signals.py:98 motions/signals.py:108
#: motions/signals.py:120 motions/signals.py:133 motions/signals.py:142
#: motions/signals.py:153 motions/signals.py:162 motions/signals.py:170
#: motions/views.py:351 motions/views.py:411
#: motions/views.py:357 motions/views.py:417
msgid "Motion"
msgstr ""
@ -706,7 +706,7 @@ msgstr ""
msgid "State"
msgstr ""
#: motions/pdf.py:91 motions/views.py:151 motions/views.py:163
#: motions/pdf.py:91 motions/views.py:157 motions/views.py:169
msgid "Version"
msgstr ""
@ -714,7 +714,7 @@ msgstr ""
msgid "Vote result"
msgstr ""
#: motions/pdf.py:121 motions/views.py:351
#: motions/pdf.py:121 motions/views.py:357
msgid "Vote"
msgstr ""
@ -745,11 +745,11 @@ msgstr ""
msgid "Workflow %(pk)d does not exist."
msgstr ""
#: motions/serializers.py:127 poll/models.py:262
#: motions/serializers.py:129 poll/models.py:262
msgid "majority"
msgstr ""
#: motions/serializers.py:129 poll/models.py:264 poll/models.py:266
#: motions/serializers.py:131 poll/models.py:264 poll/models.py:266
msgid "undocumented"
msgstr ""
@ -828,7 +828,7 @@ msgstr ""
msgid "Voting and ballot papers"
msgstr ""
#: motions/signals.py:150 motions/views.py:404
#: motions/signals.py:150 motions/views.py:410
msgid "Motions"
msgstr ""
@ -844,175 +844,83 @@ msgstr ""
msgid "Show paragraph numbering (only in PDF)"
msgstr ""
#: motions/signals.py:184
msgid "Simple Workflow"
msgstr ""
#: motions/signals.py:185
msgid "submitted"
msgstr ""
#: motions/signals.py:190 motions/signals.py:219
msgid "accepted"
msgstr ""
#: motions/signals.py:192 motions/signals.py:221
msgid "Accept"
msgstr ""
#: motions/signals.py:194 motions/signals.py:224
msgid "rejected"
msgstr ""
#: motions/signals.py:196 motions/signals.py:226
msgid "Reject"
msgstr ""
#: motions/signals.py:198
msgid "not decided"
msgstr ""
#: motions/signals.py:200
msgid "Do not decide"
msgstr ""
#: motions/signals.py:206
msgid "Complex Workflow"
msgstr ""
#: motions/signals.py:207
msgid "published"
msgstr ""
#: motions/signals.py:212 motions/views.py:153
msgid "permitted"
msgstr ""
#: motions/signals.py:214
msgid "Permit"
msgstr ""
#: motions/signals.py:229
msgid "withdrawed"
msgstr ""
#: motions/signals.py:231
msgid "Withdraw"
msgstr ""
#: motions/signals.py:234
msgid "adjourned"
msgstr ""
#: motions/signals.py:236
msgid "Adjourn"
msgstr ""
#: motions/signals.py:239
msgid "not concerned"
msgstr ""
#: motions/signals.py:241
msgid "Do not concern"
msgstr ""
#: motions/signals.py:244
msgid "commited a bill"
msgstr ""
#: motions/signals.py:246
msgid "Commit a bill"
msgstr ""
#: motions/signals.py:249
msgid "needs review"
msgstr ""
#: motions/signals.py:251
msgid "Needs review"
msgstr ""
#: motions/signals.py:254
msgid "rejected (not authorized)"
msgstr ""
#: motions/signals.py:256
msgid "Reject (not authorized)"
msgstr ""
#: motions/views.py:85
msgid "Motion created"
msgstr ""
#: motions/views.py:121
#: motions/views.py:127
msgid "Motion updated"
msgstr ""
#: motions/views.py:125
#: motions/views.py:131
msgid "All supporters removed"
msgstr ""
#: motions/views.py:155
#: motions/views.py:159
msgid "permitted"
msgstr ""
#: motions/views.py:161
#, python-format
msgid "Version %d permitted successfully."
msgstr ""
#: motions/views.py:160
#: motions/views.py:166
msgid "You can not delete the active version of a motion."
msgstr ""
#: motions/views.py:165
#: motions/views.py:171
msgid "deleted"
msgstr ""
#: motions/views.py:167
#: motions/views.py:173
#, python-format
msgid "Version %d deleted successfully."
msgstr ""
#: motions/views.py:188
#: motions/views.py:194
msgid "You can not support this motion."
msgstr ""
#: motions/views.py:190
#: motions/views.py:196
msgid "Motion supported"
msgstr ""
#: motions/views.py:191
#: motions/views.py:197
msgid "You have supported this motion successfully."
msgstr ""
#: motions/views.py:196
#: motions/views.py:202
msgid "You can not unsupport this motion."
msgstr ""
#: motions/views.py:198
#: motions/views.py:204
msgid "Motion unsupported"
msgstr ""
#: motions/views.py:199
#: motions/views.py:205
msgid "You have unsupported this motion successfully."
msgstr ""
#: motions/views.py:222
#: motions/views.py:228
msgid "Invalid data. State must be an integer."
msgstr ""
#: motions/views.py:225
#: motions/views.py:231
#, python-format
msgid "You can not set the state to %(state_id)d."
msgstr ""
#: motions/views.py:233
#: motions/views.py:239
#, python-format
msgid "The state of the motion was set to %s."
msgstr ""
#: motions/views.py:237
#: motions/views.py:243
msgid "State set to"
msgstr ""
#: motions/views.py:252
#: motions/views.py:258
msgid "Vote created successfully."
msgstr ""

View File

@ -1,6 +1,6 @@
from django.core.validators import MinValueValidator
from django.utils.translation import ugettext as _
from django.utils.translation import pgettext, ugettext_lazy, ugettext_noop
from django.utils.translation import pgettext, ugettext_lazy
from openslides.core.config import ConfigVariable
from openslides.poll.models import PERCENT_BASE_CHOICES
@ -181,79 +181,79 @@ def create_builtin_workflows(sender, **kwargs):
# If there is at least one workflow, then do nothing.
return
workflow_1 = Workflow.objects.create(name=ugettext_noop('Simple Workflow'))
state_1_1 = State.objects.create(name=ugettext_noop('submitted'),
workflow_1 = Workflow.objects.create(name='Simple Workflow')
state_1_1 = State.objects.create(name='submitted',
workflow=workflow_1,
allow_create_poll=True,
allow_support=True,
allow_submitter_edit=True)
state_1_2 = State.objects.create(name=ugettext_noop('accepted'),
state_1_2 = State.objects.create(name='accepted',
workflow=workflow_1,
action_word=ugettext_noop('Accept'),
action_word='Accept',
css_class='success')
state_1_3 = State.objects.create(name=ugettext_noop('rejected'),
state_1_3 = State.objects.create(name='rejected',
workflow=workflow_1,
action_word=ugettext_noop('Reject'),
action_word='Reject',
css_class='danger')
state_1_4 = State.objects.create(name=ugettext_noop('not decided'),
state_1_4 = State.objects.create(name='not decided',
workflow=workflow_1,
action_word=ugettext_noop('Do not decide'),
action_word='Do not decide',
css_class='default')
state_1_1.next_states.add(state_1_2, state_1_3, state_1_4)
workflow_1.first_state = state_1_1
workflow_1.save()
workflow_2 = Workflow.objects.create(name=ugettext_noop('Complex Workflow'))
state_2_1 = State.objects.create(name=ugettext_noop('published'),
workflow_2 = Workflow.objects.create(name='Complex Workflow')
state_2_1 = State.objects.create(name='published',
workflow=workflow_2,
allow_support=True,
allow_submitter_edit=True,
dont_set_identifier=True)
state_2_2 = State.objects.create(name=ugettext_noop('permitted'),
state_2_2 = State.objects.create(name='permitted',
workflow=workflow_2,
action_word=ugettext_noop('Permit'),
action_word='Permit',
allow_create_poll=True,
allow_submitter_edit=True,
versioning=True,
leave_old_version_active=True)
state_2_3 = State.objects.create(name=ugettext_noop('accepted'),
state_2_3 = State.objects.create(name='accepted',
workflow=workflow_2,
action_word=ugettext_noop('Accept'),
action_word='Accept',
versioning=True,
css_class='success')
state_2_4 = State.objects.create(name=ugettext_noop('rejected'),
state_2_4 = State.objects.create(name='rejected',
workflow=workflow_2,
action_word=ugettext_noop('Reject'),
action_word='Reject',
versioning=True,
css_class='danger')
state_2_5 = State.objects.create(name=ugettext_noop('withdrawed'),
state_2_5 = State.objects.create(name='withdrawed',
workflow=workflow_2,
action_word=ugettext_noop('Withdraw'),
action_word='Withdraw',
versioning=True,
css_class='default')
state_2_6 = State.objects.create(name=ugettext_noop('adjourned'),
state_2_6 = State.objects.create(name='adjourned',
workflow=workflow_2,
action_word=ugettext_noop('Adjourn'),
action_word='Adjourn',
versioning=True,
css_class='default')
state_2_7 = State.objects.create(name=ugettext_noop('not concerned'),
state_2_7 = State.objects.create(name='not concerned',
workflow=workflow_2,
action_word=ugettext_noop('Do not concern'),
action_word='Do not concern',
versioning=True,
css_class='default')
state_2_8 = State.objects.create(name=ugettext_noop('commited a bill'),
state_2_8 = State.objects.create(name='commited a bill',
workflow=workflow_2,
action_word=ugettext_noop('Commit a bill'),
action_word='Commit a bill',
versioning=True,
css_class='default')
state_2_9 = State.objects.create(name=ugettext_noop('needs review'),
state_2_9 = State.objects.create(name='needs review',
workflow=workflow_2,
action_word=ugettext_noop('Needs review'),
action_word='Needs review',
versioning=True,
css_class='default')
state_2_10 = State.objects.create(name=ugettext_noop('rejected (not authorized)'),
state_2_10 = State.objects.create(name='rejected (not authorized)',
workflow=workflow_2,
action_word=ugettext_noop('Reject (not authorized)'),
action_word='Reject (not authorized)',
versioning=True,
css_class='default')
state_2_1.next_states.add(state_2_2, state_2_5, state_2_10)

View File

@ -312,5 +312,45 @@ angular.module('OpenSlidesApp.motions', ['OpenSlidesApp.users'])
'Motion',
'Category',
function(Motion, Category) {}
])
// Mark all motion workflow state strings for translation in JavaScript.
// (see motions/signals.py)
.config([
'gettext',
function (gettext) {
// workflow 1
gettext('Simple Workflow')
gettext('submitted')
gettext('accepted')
gettext('Accept')
gettext('rejected')
gettext('Reject')
gettext('not decided')
gettext('Do not decide')
// workflow 2
gettext('Complex Workflow')
gettext('published')
gettext('permitted')
gettext('Permit')
gettext('accepted')
gettext('Accept')
gettext('rejected')
gettext('Reject')
gettext('withdrawed')
gettext('Withdraw')
gettext('adjourned')
gettext('Adjourn')
gettext('not concerned')
gettext('Do not concern')
gettext('commited a bill')
gettext('Commit a bill')
gettext('needs review')
gettext('Needs review')
gettext('rejected (not authorized)')
gettext('Reject (not authorized)')
}
]);
}());

View File

@ -3,7 +3,7 @@
<div id="sidebox">
<!-- State -->
<h3 translate>State</h3>
{{ motion.state.name }}
{{ motion.state.name | translate }}
<!-- Submitters -->
<h3 ng-if="motion.submitters.length > 0" translate>Submitters</h3>