On 9/2/2010 1:58 PM, victorjabur wrote:
Hello,I install the Babel, the Trac is setting the language according to my browser (firefox), if i set english the trac shows english, if i set portuguese my trac shows portuguese. I have only more one question ? How can i set the portuguese brazilian language independently of the web browser. I resolve this setting this: On file: /usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/ trac/web/main.py Editing the line: 313 def _get_locale(self, req): if Locale: available = [locale_id.replace('_', '-') for locale_id in translation.get_available_locales()] preferred = req.session.get('language', req.languages) if not isinstance(preferred, list): preferred = [preferred] negotiated = Locale.negotiate(preferred, available, sep='-') negotiated = 'pt_BR' self.log.debug("Negotiated locale oba: %s -> %s",preferred, negotiated) return negotiated I force the language pt_BR, inserting this line " negotiated = 'pt_BR' " But, i known that this is not elegant way to solve this issue: What is the better way to do this ?
Coming soon in the next version (hopefully this month), see http://trac.edgewall.org/ticket/8117
I guess that this answer is setting the trac.local environment variable:
No, we try to get away depending on setting the locale, as it can introduce all sorts of problems. Once #2182 is fixed, there will be no more need for us to call setlocale and hence the trac.local setting will be ignored.
-- Christian -- You received this message because you are subscribed to the Google Groups "Trac Users" 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-users?hl=en.
