Hi Grégory, thanks for you reply.
> AggregationState instance used for the current request, and that was set by > I18nContentSupportFilter, using the configured I18nContentSupport. Ok. As far as I understand, the default is it tries to detect the locale from the request path (e.g. /fr/content.html should set the fr locale). That currently does not seem to work in our case, I'll have to look at it again. Some more questions: 1. Does i18nContentSupport have to be activated in order for the filter to take any action? 2. Is it possible to override the detected locale in the AggregationState from within a freemarker template, by explicitly setting a locale? 3. Is the behaviour identical on admin and public instances? > So in your case, it should be a matter of simply defining the defaultLocale > (or "fallbackLocale") in configuration:/server/i18n/content. No, it is not the fallback that concerns me, I want do set the current locale in the template (e.g. take the value from a page property). > Out of curiosity though, if you have a single language file, I wonder why > you'd even need to specify the locale at all. What makes you think we only have a single language file? What I meant was that we do not use the *content i18n* part. Rather than using the built-in content internationalization, we have different navigation sub-trees for different languages. And we have a number of "system" strings (frequently used strings such as "next", "ok", some button texts etc.) that we would like to localize with .properties files for different locales (per sub-tree). Regards, Lutz 2011/1/3 Grégory Joseph <[email protected]>: > > Hi Lutz, > > The locale used in the MessagesWrapper class - specific to our FreeMarker > implementation details - is passed on by whatever components uses > FreemarkerHelper. When rendering pages, we're talking about > FreemarkerTemplateRenderer or FreemarkerParagraphRenderer, which both get it > from the AggregationState instance used for the current request, and that was > set by I18nContentSupportFilter, using the configured I18nContentSupport. > > So in your case, it should be a matter of simply defining the defaultLocale > (or "fallbackLocale") in configuration:/server/i18n/content. > > Out of curiosity though, if you have a single language file, I wonder why > you'd even need to specify the locale at all. > > HTH, > > -greg > > > On 30 Dec 2010, at 13:47, Lutz Hühnken wrote: > >> >> Hi all, >> >> I am trying to use the "system internationalization" in a websites >> Freemarker templates. >> >> I.e. not internationalized content, but localized strings from some >> .properties file, as you would use for AdminCentral dialogs. See >> http://documentation.magnolia-cms.com/technical-guide/i18n.html, the >> first section "System". >> >> There it says: >> >>> Similarly, you define an i18nBasename in the template or paragraph >>> definition. You would then use a key in the template script. >>> Freemarker: >>> ${i18n['link.readon']} >> >> I would like to use this in Freemarker Templates, and I would like to >> define the locale as a page property. But apart from that, no i18n is >> desired, or more specifically: content i18n support is not activated. >> >> It seems the i18n object (type >> info.magnolia.freemarker.MessagesWrapper) does not allow me to pass >> the desired locale directly as a parameter. It seems to get the locale >> from the MgnlContext, but I can't figure out where it is set. >> >> Does someone know how I can specify the locale used by the MessagesWrapper? >> >> Thanks, >> >> Lutz ---------------------------------------------------------------- For list details see http://www.magnolia-cms.com/home/community/mailing-lists.html To unsubscribe, E-mail to: <[email protected]> ----------------------------------------------------------------
