Opened 14 years ago
Closed 14 years ago
#10038 closed enhancement (fixed)
Descriptions of wiki macros should be translated
Reported by: | Jun Omae | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 1.0 |
Component: | i18n | Version: | |
Severity: | normal | Keywords: | i18n macro |
Cc: | Branch: | ||
Release Notes: |
The macro documents are translated in the language settings. |
||
API Changes: |
trac.wiki.api: |
||
Internal Changes: |
Description (last modified by )
extract_messages
extracts all descriptions of wiki macros and [[MacroList]]
macro shows the translated messages.
Attachments (0)
Change History (6)
comment:1 by , 14 years ago
Description: | modified (diff) |
---|
comment:2 by , 14 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:3 by , 14 years ago
Nice! Works great. I even think we should push this further: the macro documentation should be placed only in the get_macro_description()
, and no longer as the class docstring. That way, we could use the docstrings as developer specific documentation if needed. The user facing documentation would not be that useful in the ApiDoc, and anyway gets badly formatted because of the wiki syntax.
It seems cleandoc_
can be useful in other places if we'd like to get long messages translated, but maybe we should replace existing ones carefully in order to play well with the update.
comment:4 by , 14 years ago
Ok, updated the branch.
WikiMacroBase.get_macro_description()
returns(self._domain, self._description)
,_domain
and_description
are specified in the subclasses. When_domain
and_descriptino
are None, it returns the class docstring for pre-0.12 compatibility.- The subclasses of
WikiMacroBase
no longer use the class docstring.
BTW, should we move WikiMacroBase
from trac.wiki.macro
to trac.wiki.api
in 0.13?
comment:5 by , 14 years ago
Milestone: | 0.14 → 0.13 |
---|
comment:6 by , 14 years ago
API Changes: | modified (diff) |
---|---|
Release Notes: | modified (diff) |
Resolution: | → fixed |
Status: | assigned → closed |
Commited in [10617]. We can translate the macro documents.
I worked the issue, https://github.com/jun66j5/trac/compare/t10038-i18n-macro-doc.
cleandoc_
N_
, however it returns cleandoc'ed text and the extractor extracts cleandoc'ed text.IWikiMacroProvider.get_macro_description
[[MacroList]]
.WikiMacroBase
doc_domain
variable to translate with the domain. If speicfied,get_macro_description
returns a tuple ofself.doc_domain
and docstring of the subclass. If not specified, it returns simply docstring of the subclass.Increase +14 messages.