watho wrote:
> In my plugin I want to add a navigation-item with the add_ctxtnav()-
> method in my foreign language (german) which contains non-ASCII
> characters like ä,ö and ü.
>
> I get the following error-message:
> SyntaxError: Non-ASCII character '\xc3' in file ../src/systemsdb/
> web_ui.py on line 86, but no encoding declared; see
> http://www.python.org/peps/pep-0263.html for details (web_ui.py, line
> 86)
>
You've hit a problem with Python, not with Trac.
If you have non-ascii character in your source file, you need to define
an encoding for that file, as the error message above says (and you'll
find the details in the linked document).
> I have successfully created Unicode-Links with tag.a(to_unicode
> ('zurück'), href=self.env.href.systemsdb()))
> but i cant call: add_ctxtnav(req, tag.a(to_unicode('zurück'),
> href=self.env.href.systemsdb()))
>
Assuming you're past the first error, you need to give a backtrace here.
Anyway, that's not the way to localize your plugin.
Original strings in the source code must be language neutral (english here).
> I have looked for a common way to write localized plugins, but didn't
> find any useful.
>
>
Right, that's because support for localizing plugins has only been added
a few days ago. Some documentation will follow. Another difficulty in
your case (for the add_ctxtnav) is that the API will slightly change in
the coming days as well, in order to better support localization, so be
patient ;-)
-- Christian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---