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:
commit
e1a433956e
2
news/170.bugfix
Normal file
2
news/170.bugfix
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Reuse existing translation for the "Save" button in the Edit comment form.
|
||||||
|
[vincentfretin]
|
@ -75,7 +75,7 @@ class EditCommentForm(CommentForm):
|
|||||||
target = portal_state.portal_url()
|
target = portal_state.portal_url()
|
||||||
self.request.response.redirect(target)
|
self.request.response.redirect(target)
|
||||||
|
|
||||||
@button.buttonAndHandler(_(u'edit_comment_form_button',
|
@button.buttonAndHandler(_(u'label_save',
|
||||||
default=u'Save'), name='comment')
|
default=u'Save'), name='comment')
|
||||||
def handleComment(self, action):
|
def handleComment(self, action):
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ _('Recall')
|
|||||||
_('Approve')
|
_('Approve')
|
||||||
_('Reject')
|
_('Reject')
|
||||||
_('Spam')
|
_('Spam')
|
||||||
|
PMF = _
|
||||||
|
|
||||||
|
|
||||||
class TranslationHelper(BrowserView):
|
class TranslationHelper(BrowserView):
|
||||||
@ -37,7 +38,8 @@ class TranslationHelper(BrowserView):
|
|||||||
return _(text)
|
return _(text)
|
||||||
|
|
||||||
def translate_comment_review_state(self, rs):
|
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):
|
class View(BrowserView):
|
||||||
|
Loading…
Reference in New Issue
Block a user