Permalink
Browse files

Fixed showing different translated message for the user's locale once…

… description of macros is translated
  • Loading branch information...
jun66j5 committed Mar 12, 2014
1 parent 443fe05 commit 3785c9e6e9232019fd359b6aa6e2355df5ade233
Showing with 8 additions and 8 deletions.
  1. +1 −1 setup.cfg
  2. +7 −7 tractags/macros.py
View
@@ -7,7 +7,7 @@ add_comments = TRANSLATOR:
msgid_bugs_address = hoff.st@shaas.net
output_file = tractags/locale/messages.pot
#keywords = _ ngettext:1,2 N_ tag_
-keywords = _ tag_ tagn_:1,2 # nothing else used by now
+keywords = N_ _ tag_ tagn_:1,2 # nothing else used by now
width = 72
[init_catalog]
View
@@ -10,7 +10,7 @@
import re
-from genshi.builder import Markup, tag as builder
+from genshi.builder import tag as builder
from pkg_resources import resource_filename
from trac.config import BoolOption, ListOption, Option
@@ -28,7 +28,7 @@
from trac.wiki.api import IWikiMacroProvider, parse_args
from trac.wiki.formatter import format_to_oneliner
-from tractags.api import TagSystem, _
+from tractags.api import TagSystem, N_, _, gettext
try:
from trac.util import as_int
@@ -108,7 +108,7 @@ class TagWikiMacros(TagTemplateProvider):
def __init__(self):
# TRANSLATOR: Keep macro doc style formatting here, please.
- self.doc_cloud = _("""Display a tag cloud.
+ self.doc_cloud = N_("""Display a tag cloud.
Show a tag cloud for all tags on resources matching query.
@@ -124,7 +124,7 @@ def __init__(self):
See tags documentation for the query syntax.
""")
- self.doc_listtagged = _("""List tagged resources.
+ self.doc_listtagged = N_("""List tagged resources.
Usage:
@@ -143,9 +143,9 @@ def get_macros(self):
def get_macro_description(self, name):
if name == 'ListTagged':
- return self.doc_listtagged
- elif name == 'TagCloud':
- return self.doc_cloud
+ return gettext(self.doc_listtagged)
+ if name == 'TagCloud':
+ return gettext(self.doc_cloud)
def expand_macro(self, formatter, name, content):
env = self.env

1 comment on commit 3785c9e

@hasienda

This comment has been minimized.

Show comment Hide comment
@hasienda

hasienda Mar 15, 2014

fix confirmed, looks staight-forward, once you understand the issue, sure - please apply this upstream

fix confirmed, looks staight-forward, once you understand the issue, sure - please apply this upstream

Please sign in to comment.