Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 3785c9e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -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]
Expand Down
14 changes: 7 additions & 7 deletions tractags/macros.py
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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:
Expand All @@ -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
Expand Down

1 comment on commit 3785c9e

@hasienda
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Please sign in to comment.