Merge pull request #170 from plone/i18n-reuse-existing-translation

Reuse existing translation for the "Save" button in the Edit comment form.
This commit is contained in:
Vincent Fretin
2020-06-18 13:05:32 +02:00
committed by GitHub
3 changed files with 6 additions and 2 deletions
+2
View File
@@ -0,0 +1,2 @@
Reuse existing translation for the "Save" button in the Edit comment form.
[vincentfretin]
+1 -1
View File
@@ -75,7 +75,7 @@ class EditCommentForm(CommentForm):
target = portal_state.portal_url()
self.request.response.redirect(target)
@button.buttonAndHandler(_(u'edit_comment_form_button',
@button.buttonAndHandler(_(u'label_save',
default=u'Save'), name='comment')
def handleComment(self, action):
+3 -1
View File
@@ -29,6 +29,7 @@ _('Recall')
_('Approve')
_('Reject')
_('Spam')
PMF = _
class TranslationHelper(BrowserView):
@@ -37,7 +38,8 @@ class TranslationHelper(BrowserView):
return _(text)
def translate_comment_review_state(self, rs):
return _("comment_" + rs, default=rs)
# use PMF instead of _ here so i18ndude doesn't extract "comment_"
return PMF("comment_" + rs, default=rs)
class View(BrowserView):