Opened 15 years ago
Closed 15 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 , 15 years ago
| Description: | modified (diff) | 
|---|
comment:2 by , 15 years ago
| Owner: | set to | 
|---|---|
| Status: | new → assigned | 
comment:3 by , 15 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 , 15 years ago
Ok, updated the branch.
WikiMacroBase.get_macro_description()returns(self._domain, self._description),_domainand_descriptionare specified in the subclasses. When_domainand_descriptinoare None, it returns the class docstring for pre-0.12 compatibility.- The subclasses of 
WikiMacroBaseno longer use the class docstring. 
BTW, should we move WikiMacroBase from trac.wiki.macro to trac.wiki.api in 0.13?
comment:5 by , 15 years ago
| Milestone: | 0.14 → 0.13 | 
|---|
comment:6 by , 15 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]].WikiMacroBasedoc_domainvariable to translate with the domain. If speicfied,get_macro_descriptionreturns a tuple ofself.doc_domainand docstring of the subclass. If not specified, it returns simply docstring of the subclass.Increase +14 messages.