#12511 closed defect (fixed)
Untranslated buttons in spam filter admin panel — at Version 3
Reported by: | Jun Omae | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | plugin - spam-filter |
Component: | general | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Fixed regression in [14814,14815] that led to untranslated button in the admin panels. |
||
API Changes: | |||
Internal Changes: |
Description (last modified by )
After [14814,14815], labels in the buttons of spam filter admin are untranslated.
The gettext
in tracspamfilter.api
is not the same as gettext
in trac.util.translation
. Instead, we should use dgettext
and dngettext
with tracspamfilter
catalog like this:
- <input type="submit" name="cleantemp" value="${ngettext('Remove %(num)s temporary session', + <input type="submit" name="cleantemp" value="${dngettext('tracspamfilter', 'Remove %(num)s temporary session',
Those translation methods can easily be replaced by sed
.
for i in tracspamfilter/templates/*.html; do sed -i \ -e "s/\<_(/dgettext('tracspamfilter', /g" \ -e "s/\<gettext(/dgettext('tracspamfilter', /g" \ -e "s/\<ngettext(/dngettext('tracspamfilter', /g" \ $i done
Change History (4)
by , 8 years ago
Attachment: | untranslated-buttons.png added |
---|
comment:1 by , 8 years ago
Description: | modified (diff) |
---|
comment:2 by , 8 years ago
comment:3 by , 8 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Fixed in [14842].
Note:
See TracTickets
for help on using tickets.
Thanks for spotting. I'll apply your fix today.