Edgewall Software

Opened 8 years ago

Last modified 8 years ago

#12511 closed defect

Untranslated buttons in spam filter admin panel — at Version 1

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:
API Changes:
Internal Changes:

Description (last modified by Jun Omae)

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 (2)

by Jun Omae, 8 years ago

Attachment: untranslated-buttons.png added

comment:1 by Jun Omae, 8 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.