diff --git a/openslides/agenda/models.py b/openslides/agenda/models.py index b0476273e..9ef997b45 100644 --- a/openslides/agenda/models.py +++ b/openslides/agenda/models.py @@ -300,7 +300,7 @@ class SpeakerManager(models.Manager): """ if self.filter(user=user, item=item, begin_time=None).exists(): raise OpenSlidesError( - _('%(user)s is already on the list of speakers of item %(id)s.') + _('%(user)s is already on the list of speakers of %(id)s.') % {'user': user, 'id': item.id}) if isinstance(user, AnonymousUser): raise OpenSlidesError( diff --git a/openslides/agenda/static/templates/agenda/item-list.html b/openslides/agenda/static/templates/agenda/item-list.html index 420d9037f..7e1b2c7d6 100644 --- a/openslides/agenda/static/templates/agenda/item-list.html +++ b/openslides/agenda/static/templates/agenda/item-list.html @@ -76,7 +76,7 @@
- Hide internal agenda items + Hide internal items Hide closed items @@ -132,7 +132,7 @@ - + @@ -190,7 +190,7 @@
diff --git a/openslides/assignments/models.py b/openslides/assignments/models.py index de70092fc..37927bf40 100644 --- a/openslides/assignments/models.py +++ b/openslides/assignments/models.py @@ -359,9 +359,9 @@ class AssignmentPoll(RESTModelMixin, CollectDefaultVotesMixin, def get_vote_values(self): if self.yesnoabstain: - return [ugettext_noop('Yes'), ugettext_noop('No'), ugettext_noop('Abstain')] + return ['Yes', 'No', 'Abstain'] else: - return [ugettext_noop('Votes')] + return ['Votes'] def get_ballot(self): return self.assignment.polls.filter(id__lte=self.pk).count() diff --git a/openslides/assignments/static/js/assignments/site.js b/openslides/assignments/static/js/assignments/site.js index 617dcdf46..67d22f165 100644 --- a/openslides/assignments/static/js/assignments/site.js +++ b/openslides/assignments/static/js/assignments/site.js @@ -346,6 +346,9 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments']) $scope.alert = { type: 'danger', msg: data.detail, show: true }; }); }; + + // Just mark some vote value strings for translation. + gettext('Yes'), gettext('No'), gettext('Abstain'); } ]) diff --git a/openslides/assignments/static/templates/assignments/assignment-detail.html b/openslides/assignments/static/templates/assignments/assignment-detail.html index 7d54c8bfd..f3ecbfe40 100644 --- a/openslides/assignments/static/templates/assignments/assignment-detail.html +++ b/openslides/assignments/static/templates/assignments/assignment-detail.html @@ -114,14 +114,18 @@
- {{ option.candidate.get_full_name() }} -
-
- {{ vote.value}}: {{ vote.weight}} -
+
+ {{ option.candidate.get_full_name() }}
+ {{ option.votes[0].value | translate }}: {{ option.votes[0].weight }}
+ {{ option.votes[1].value | translate }}: {{ option.votes[1].weight }}
+ {{ option.votes[2].value | translate }}: {{ option.votes[2].weight }} +
+
+
+ {{ option.candidate.get_full_name() }}: {{ option.votes[0].weight}} +
-
Valid votes: {{ poll.votesvalid }}
Invalid votes: {{ poll.votesinvalid }}
Votes cast: {{ poll.votescast }} diff --git a/openslides/assignments/views.py b/openslides/assignments/views.py index 3ef769ea0..3d7afe639 100644 --- a/openslides/assignments/views.py +++ b/openslides/assignments/views.py @@ -215,10 +215,10 @@ class AssignmentViewSet(ModelViewSet): """ assignment = self.get_object() if not assignment.candidates.exists(): - raise ValidationError({'detail': _('Can not create poll because there are no candidates.')}) + raise ValidationError({'detail': _('Can not create ballot because there are no candidates.')}) with transaction.atomic(): assignment.create_poll() - return Response({'detail': _('Poll created successfully.')}) + return Response({'detail': _('Ballot created successfully.')}) class AssignmentPollViewSet(UpdateModelMixin, DestroyModelMixin, GenericViewSet): @@ -522,7 +522,7 @@ class AssignmentPollPDF(PDFView): {'circle': circle, 'yes': _("Yes"), 'no': _("No"), - 'abstain': _("Abstention")}, + 'abstain': _("Abstain")}, stylesheet['Ballot_option_circle_YNA'])) if counter == 13: cellcolumnA = cell diff --git a/openslides/locale/angular-gettext/template-en.pot b/openslides/locale/angular-gettext/template-en.pot index 1031aca04..9b6801f3c 100644 --- a/openslides/locale/angular-gettext/template-en.pot +++ b/openslides/locale/angular-gettext/template-en.pot @@ -26,7 +26,8 @@ msgstr "" msgid "About me" msgstr "" -#: assignments/static/js/assignments/site.js:437 +#: assignments/static/js/assignments/site.js:351 +#: assignments/static/js/assignments/site.js:440 #: motions/static/templates/motions/motion-detail.html:135 #: motions/static/templates/motions/motion-detail.html:136 #: motions/static/templates/motions/motion-detail.html:186 @@ -191,7 +192,7 @@ msgid "Comment" msgstr "" #: assignments/static/js/assignments/site.js:120 -#: assignments/static/js/assignments/site.js:487 +#: assignments/static/js/assignments/site.js:490 msgid "Comment on the ballot paper" msgstr "" @@ -450,7 +451,7 @@ msgstr "" #: agenda/static/templates/agenda/item-list.html:135 #: agenda/static/templates/agenda/item-list.html:193 -msgid "Hidden agenda item" +msgid "Hidden item" msgstr "" #: agenda/static/templates/agenda/item-list.html:82 @@ -458,7 +459,7 @@ msgid "Hide closed items" msgstr "" #: agenda/static/templates/agenda/item-list.html:79 -msgid "Hide internal agenda items" +msgid "Hide internal items" msgstr "" #: core/static/js/core/site.js:86 @@ -654,19 +655,20 @@ msgstr "" msgid "New password" msgstr "" -#: motions/static/templates/motions/motion-detail.html:222 -msgid "New poll" -msgstr "" - #: core/static/templates/core/tag-form.html:10 msgid "New tag" msgstr "" +#: motions/static/templates/motions/motion-detail.html:222 +msgid "New vote" +msgstr "" + #: agenda/static/templates/agenda/item-detail.html:67 msgid "Next speakers:" msgstr "" -#: assignments/static/js/assignments/site.js:428 +#: assignments/static/js/assignments/site.js:351 +#: assignments/static/js/assignments/site.js:431 #: motions/static/templates/motions/motion-detail.html:130 #: motions/static/templates/motions/motion-detail.html:131 #: motions/static/templates/motions/motion-detail.html:177 @@ -1137,18 +1139,18 @@ msgstr "" msgid "Vote" msgstr "" -#: assignments/static/js/assignments/site.js:477 +#: assignments/static/js/assignments/site.js:480 #: motions/static/templates/motions/motion-detail.html:150 #: motions/static/templates/motions/motion-detail.html:151 #: motions/static/templates/motions/motion-detail.html:214 msgid "Votes cast" msgstr "" -#: assignments/static/js/assignments/site.js:469 +#: assignments/static/js/assignments/site.js:472 msgid "Votes invalid" msgstr "" -#: assignments/static/js/assignments/site.js:461 +#: assignments/static/js/assignments/site.js:464 msgid "Votes valid" msgstr "" @@ -1161,7 +1163,8 @@ msgid "Workflow" msgstr "" #: assignments/static/js/assignments/site.js:127 -#: assignments/static/js/assignments/site.js:419 +#: assignments/static/js/assignments/site.js:351 +#: assignments/static/js/assignments/site.js:422 #: motions/static/templates/motions/motion-detail.html:125 #: motions/static/templates/motions/motion-detail.html:126 #: motions/static/templates/motions/motion-detail.html:168 diff --git a/openslides/locale/en/LC_MESSAGES/django.po b/openslides/locale/en/LC_MESSAGES/django.po index 51559a44b..356ce261f 100644 --- a/openslides/locale/en/LC_MESSAGES/django.po +++ b/openslides/locale/en/LC_MESSAGES/django.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-11-30 20:59+0100\n" +"POT-Creation-Date: 2015-12-07 13:31+0100\n" "Language: en\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -228,24 +228,6 @@ msgstr "" msgid "Comment on the ballot paper" msgstr "" -#: assignments/models.py:362 assignments/views.py:523 motions/models.py:691 -#: motions/pdf.py:125 motions/pdf.py:270 -msgid "Yes" -msgstr "" - -#: assignments/models.py:362 assignments/views.py:524 motions/models.py:691 -#: motions/pdf.py:125 motions/pdf.py:272 -msgid "No" -msgstr "" - -#: assignments/models.py:362 motions/models.py:691 -msgid "Abstain" -msgstr "" - -#: assignments/models.py:364 -msgid "Votes" -msgstr "" - #: assignments/serializers.py:119 #, python-format msgid "You have to submit data for %d candidates." @@ -437,11 +419,11 @@ msgid "User %s was successfully unelected." msgstr "" #: assignments/views.py:218 -msgid "Can not create poll because there are no candidates." +msgid "Can not create ballot because there are no candidates." msgstr "" -#: assignments/views.py:221 motions/views.py:252 -msgid "Poll created successfully." +#: assignments/views.py:221 +msgid "Ballot created successfully." msgstr "" #: assignments/views.py:275 @@ -504,8 +486,16 @@ msgid_plural "%d available posts" msgstr[0] "" msgstr[1] "" +#: assignments/views.py:523 motions/pdf.py:125 motions/pdf.py:270 +msgid "Yes" +msgstr "" + +#: assignments/views.py:524 motions/pdf.py:125 motions/pdf.py:272 +msgid "No" +msgstr "" + #: assignments/views.py:525 motions/pdf.py:125 motions/pdf.py:274 -msgid "Abstention" +msgid "Abstain" msgstr "" #: core/config.py:28 core/config.py:59 @@ -803,7 +793,7 @@ msgstr "" msgid "Vote result" msgstr "" -#: motions/pdf.py:121 +#: motions/pdf.py:121 motions/views.py:351 msgid "Vote" msgstr "" @@ -1097,8 +1087,8 @@ msgstr "" msgid "State set to" msgstr "" -#: motions/views.py:351 -msgid "Poll" +#: motions/views.py:252 +msgid "Vote created successfully." msgstr "" #: poll/models.py:71 @@ -1113,10 +1103,6 @@ msgstr "" msgid "Disabled (no percents)" msgstr "" -#: poll/models.py:152 -msgid "votes" -msgstr "" - #: users/models.py:99 users/pdf.py:114 msgid "Username" msgstr "" diff --git a/openslides/motions/models.py b/openslides/motions/models.py index d72543035..8c23154b6 100644 --- a/openslides/motions/models.py +++ b/openslides/motions/models.py @@ -687,8 +687,7 @@ class MotionPoll(RESTModelMixin, CollectDefaultVotesMixin, BasePoll): option_class = MotionOption """The option class, witch links between this object the the votes.""" - vote_values = [ - ugettext_noop('Yes'), ugettext_noop('No'), ugettext_noop('Abstain')] + vote_values = ['Yes', 'No', 'Abstain'] """The possible anwers for the poll. 'Yes, 'No' and 'Abstain'.""" def __str__(self): diff --git a/openslides/motions/pdf.py b/openslides/motions/pdf.py index 5d4f12e77..524ccb12d 100644 --- a/openslides/motions/pdf.py +++ b/openslides/motions/pdf.py @@ -122,7 +122,7 @@ def motion_to_pdf(pdf, motion): stylesheet['Bold'])) cell6b.append(Paragraph( "%s: %s
%s: %s
%s: %s
%s %s %s" % - (_("Yes"), yes, _("No"), no, _("Abstention"), abstain, valid, invalid, votescast), + (_("Yes"), yes, _("No"), no, _("Abstain"), abstain, valid, invalid, votescast), stylesheet['Normal'])) cell6b.append(Spacer(0, 0.2 * cm)) motion_data.append([cell6a, cell6b]) @@ -271,7 +271,7 @@ def motion_poll_to_pdf(pdf, poll): cell.append(Paragraph("%s %s" % (circle, _("No")), stylesheet['Ballot_option'])) cell.append(Paragraph("%s %s" - % (circle, _("Abstention")), stylesheet['Ballot_option'])) + % (circle, _("Abstain")), stylesheet['Ballot_option'])) data = [] # get ballot papers config values ballot_papers_selection = config["motions_pdf_ballot_papers_selection"] diff --git a/openslides/motions/static/templates/motions/motion-detail.html b/openslides/motions/static/templates/motions/motion-detail.html index 9f796c0ab..9399b5f57 100644 --- a/openslides/motions/static/templates/motions/motion-detail.html +++ b/openslides/motions/static/templates/motions/motion-detail.html @@ -219,7 +219,7 @@
diff --git a/openslides/motions/views.py b/openslides/motions/views.py index 7e734fca1..a44afaa46 100644 --- a/openslides/motions/views.py +++ b/openslides/motions/views.py @@ -249,7 +249,7 @@ class MotionViewSet(ModelViewSet): motion.create_poll() except WorkflowError as e: raise ValidationError({'detail': e}) - return Response({'detail': _('Poll created successfully.')}) + return Response({'detail': _('Vote created successfully.')}) class MotionPollViewSet(UpdateModelMixin, DestroyModelMixin, GenericViewSet): @@ -348,7 +348,7 @@ class PollPDFView(PDFView): """ Return the filename for the PDF. """ - return u'%s%s_%s' % (_("Motion"), str(self.get_object().poll_number), _("Poll")) + return u'%s%s_%s' % (_("Motion"), str(self.get_object().poll_number), _("Vote")) def get_template(self, buffer): return SimpleDocTemplate( diff --git a/openslides/poll/models.py b/openslides/poll/models.py index 92345ae54..327881f87 100644 --- a/openslides/poll/models.py +++ b/openslides/poll/models.py @@ -3,7 +3,7 @@ import locale from django.core.exceptions import ObjectDoesNotExist from django.db import models from django.utils.translation import ugettext as _ -from django.utils.translation import ugettext_lazy, ugettext_noop +from django.utils.translation import ugettext_lazy from openslides.utils.models import MinMaxIntegerField @@ -149,7 +149,7 @@ class BasePoll(models.Model): """ Base poll class. """ - vote_values = [ugettext_noop('votes')] + vote_values = ['Votes'] class Meta: abstract = True