Ok. By referring to http://docs.turbogears.org/2.0/RoughDocs/1.1Migration,
I was able to adapt the code you just provided to TG2. But the
function that I found in tg.i18n (get_lang) still does not give me the
"chosen" language for the page to render. It gives all of the accepted
languages sent by the browser in an array (i.e. same thing as
tg.locale).


On Oct 13, 5:31 pm, Christopher Arndt <[email protected]> wrote:
> gizli schrieb:
>
> > My specific question is
> > what function should I call from within the template to get the actual
> > locale of the request?
>
> > My generic question is: Is there a better way of doing this? In the
> > end, I want to have this javascript file included in my template:
>
> TurboGears by default determines the locale to use for a specific
> request with the 'turbogears.i18.utils._get_locale' function.
>
> I just updated the configuration reference to include the relevant
> configuration settings for i18n:
>
> http://docs.turbogears.org/1.1/Configuration#internationalization
>
> You can use the 'i18n.get_locale' config setting to specify our own
> custom function to determine the locale but usually the default function
> should be fine.
>
> You could inject this function into your template name space using the
> 'view.variable_providers' mechanism. Or you create a custom widget which
> creates a JSLink to the JS file with the translations appropriate for
> your locale and include this in the 'tg.include_widgets' setting.
>
> http://docs.turbogears.org/1.0/stdvars#custom-additionshttp://docs.turbogears.org/1.1/Internationalization#localization-of-j...http://docs.turbogears.org/1.0/WidgetsWithJSAndCSS
>
> Chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to