From ab99c5d015b595eb928736d5bf4c70d3576f05e3 Mon Sep 17 00:00:00 2001 From: Vincent Fretin Date: Thu, 18 Jun 2020 11:48:31 +0200 Subject: [PATCH 1/2] Reuse existing translation for the "Save" button in the Edit comment form. --- news/170.bugfix | 2 ++ plone/app/discussion/browser/comment.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 news/170.bugfix diff --git a/news/170.bugfix b/news/170.bugfix new file mode 100644 index 0000000..c3d9f14 --- /dev/null +++ b/news/170.bugfix @@ -0,0 +1,2 @@ +Reuse existing translation for the "Save" button in the Edit comment form. +[vincentfretin] diff --git a/plone/app/discussion/browser/comment.py b/plone/app/discussion/browser/comment.py index ef75083..41beecc 100644 --- a/plone/app/discussion/browser/comment.py +++ b/plone/app/discussion/browser/comment.py @@ -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): From eb8b473610b19e9f052257aaf3169aecadcc4140 Mon Sep 17 00:00:00 2001 From: Vincent Fretin Date: Thu, 18 Jun 2020 11:58:24 +0200 Subject: [PATCH 2/2] use PMF instead of _ so i18ndude doesn't extract comment_ --- plone/app/discussion/browser/moderation.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plone/app/discussion/browser/moderation.py b/plone/app/discussion/browser/moderation.py index 05c0236..03540b2 100644 --- a/plone/app/discussion/browser/moderation.py +++ b/plone/app/discussion/browser/moderation.py @@ -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):