Edgewall Software
Modify

Opened 16 years ago

Closed 16 years ago

Last modified 9 years ago

#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 Ryan J Ollos)

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:1 by rubik, 16 years ago

seems like Genshi's problem

Traceback (most recent call last):
  File "e:\python24\lib\site-packages\Trac-0.11b1-py2.4-win32.egg\trac\web\api.py", line 339, in send_error
    'text/html')
  File "e:\python24\lib\site-packages\Trac-0.11b1-py2.4-win32.egg\trac\web\chrome.py", line 683, in render_template
    return stream.render(method, doctype=doctype)
  File "E:\Python24\lib\site-packages\genshi-0.4.4-py2.4.egg\genshi\core.py", line 154, in render
  File "E:\Python24\lib\site-packages\genshi-0.4.4-py2.4.egg\genshi\output.py", line 45, in encode
  File "E:\Python24\lib\site-packages\genshi-0.4.4-py2.4.egg\genshi\output.py", line 274, in __call__
  File "E:\Python24\lib\site-packages\genshi-0.4.4-py2.4.egg\genshi\output.py", line 519, in __call__
  File "E:\Python24\lib\site-packages\genshi-0.4.4-py2.4.egg\genshi\output.py", line 691, in __call__
  File "E:\Python24\lib\site-packages\genshi-0.4.4-py2.4.egg\genshi\core.py", line 405, in escape
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe7 in position 0: ordinal not in range(128)
Last edited 9 years ago by Ryan J Ollos (previous) (diff)

comment:2 by rubik, 16 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 anonymous, 16 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 Emmanuel Blot, 16 years ago

Resolution: invalid
Status: newclosed

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 ibn, 16 years ago

Resolution: invalid
Status: closedreopened

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.

Last edited 9 years ago by Ryan J Ollos (previous) (diff)

comment:6 by Jeroen Ruigrok van der Werven, 16 years ago

Resolution: invalid
Status: reopenedclosed

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:7 by anonymous, 16 years ago

Trac in Chinese,zh_CN, not i18n http://trac.ikeeper.cn/

comment:8 by Ryan J Ollos, 9 years ago

Description: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.