#6756 closed defect (invalid)
can not translate main menu
Reported by: | rubik | Owned by: | Jonas Borgström |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | general | Version: | 0.11b1 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
e.g. in 0.10.4 I just change wiki/web_ui.py
's function
get_navigation_items to display it in Chinese
but in 0.11b1 it always cannot work!
WHat's the difference?
I see that in both versions it's in UTF-8 encoding, why not working now?
def get_navigation_items(self, req): if 'WIKI_VIEW' in req.perm('wiki'): yield ('mainnav', 'wiki', tag.a(_('Wiki'), href=req.href.wiki(), accesskey=1)) yield ('metanav', 'help', tag.a(_('Help/Guide'), href=req.href.wiki('TracGuide'), accesskey=6))
Attachments (0)
Change History (8)
comment:2 by , 17 years ago
now I have changed everything of 0.11b1 into Chinese, except for those in .py
so, i18n's not in the trunk, sure?
comment:3 by , 17 years ago
svn co http://svn.edgewall.com/repos/trac/sandbox/i18n
how to use these files?
tyied setup.py install, not work
comment:4 by , 17 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Please post a message to the MailingList and ask for help, rather than flooding ticket comments ;-)
- i18n is scheduled for 0.12
- i18n support will be based on Genshi and Babel
- some work efforts have already been made to support Chinese (and many other languages), so you may want to search for tickets related to chinese, and the MailingList archive for help about installing Babel and the required Unicode dependencies
comment:5 by , 17 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
after looking into the python codes, I just found that it's a problem of Genshi.
to solve this problem, use function to_unicode from util/text.py
e.g. in trac/search/web_ui.py
add this line: from trac.util.text import to_unicode
and change get_navigation_items to yield using function to_unicode
def get_navigation_items(self, req): if 'SEARCH_VIEW' in req.perm: yield ('mainnav', 'search', tag.a(_('''to_unicode('search in your language')'''), href=req.href.search(), accesskey=4))
it just works for me , to change main menu into Chinese.
comment:6 by , 17 years ago
Resolution: | → invalid |
---|---|
Status: | reopened → closed |
python setup.py install does not work, since you need to compile the catalogs. See the —help-commands of setup.py.
Anyway, closing again.
comment:8 by , 10 years ago
Description: | modified (diff) |
---|
seems like Genshi's problem