Hi Greg Thanks for the info. When you say "the editbar and other tags already do the translation job by using the user's language" could you save me some time and a) point me to the template b) or show me how this is done tag-wise? Do you still use the same i18n tag and add an argument? If this really works then a "i18nAdmin" object would definitely be unnecessary.
Thanks! -will On 24.01.2011, at 14:35, Grégory Joseph wrote: > > On 24 Jan 2011, at 12:09, Will Scheidegger wrote: >>>> >>>> We're trying to set the language for the edit bars etc. >>>> - The user's language is set correctly (IMO this is all there should be to >>>> it) > > That *should* indeed be the case. > >> Thanks for the feedback. I could resolve the problem by setting the fallback >> locale for both content and system to "de". Anyway, I would have expected >> the local to be set to whatever you define in the stk site. >> >> Still there is a general problem with the languages, and (IIRC) it has been >> discussed on the list before: The user's language might not be the same as >> the content's language. But there is only the one i18n object provided by >> the freemarker helper class which _should_ be set to the content locale if >> I'm not mistaken. > > That's indeed the intention. As far as I can see, the locale you get there is > the one passed by the renderer, which is in turn the one given from the > AggregationState. > Have you noticed it wasn't the case ? > >> What I propose (and what I actually already added to my FreemarkerHelper >> class is a second messages wrapper object called "i18nAdmin" which has its >> locale set to the users locale (i.e. MgnlContext.getLocale()). This would >> allow you to use two separate localization mechanisms in the same template. >> What do you think? > > I think part of the problem is that (some? all?) templates incorrectly use > this i18n object. They shouldn't: iirc, the editbar and other tags already do > the translation job, by (correctly - hopefully!) using the user's language. > But there might be reasons some templates do this (i.e passing parameters to > translated messages, or some of the tags might not behave as > expected/wanted). If you have a minute to look into this, that'd be > appreciated. If not, maybe report it on jira and we'll investigate further.. > when time permits. > > Adding a second messages wrapper would probably only be half the solution, > since all templates would still need to be updated. > > There is another "problem" related to this - the message bundle > (i18nBasename) we use is currently the same for dialogs/editbars than for the > "content" messages (the little messages such as "read on"). > > WDYT ? > > -g > >> On 24.01.2011, at 10:14, Antti Hietala wrote: >> >>>> - The user's language is set correctly (IMO this is all there should be to >>>> it) >>> >>> Yes, that should be enough. Are you seeing _any_ translated labels in edit >>> bars or are just some of them falling back to the default language? >>> >>> While AdminCentral UI is translated to a high degree, STK is missing >>> translations for many labels. You are likely to see "Edit Opener", "Edit >>> Section Header", "New Extras" etc. on the page even if you have set the >>> users language correctly because these labels have not been translated to >>> your target language yet. Take a look at the >>> messages_<lang_code>.properties files inside the STK module. >>> >>> --Antti >>> >>> On Jan 23, 2011, at 6:34 PM, Will Scheidegger wrote: >>> >>>> >>>> Dear Magnolians >>>> >>>> We're trying to set the language for the edit bars etc. >>>> - The user's language is set correctly (IMO this is all there should be to >>>> it) >>>> - config:/module/standard-templating-kit/config/site/i18n/locale is also >>>> set accordingly >>>> - the messages file is there >>>> >>>> Still, I get the english labels. Any ideas where to look next?! >>>> >>>> -will > > > > > ---------------------------------------------------------------- > For list details see > http://www.magnolia-cms.com/home/community/mailing-lists.html > To unsubscribe, E-mail to: <[email protected]> > ---------------------------------------------------------------- ---------------------------------------------------------------- For list details see http://www.magnolia-cms.com/home/community/mailing-lists.html To unsubscribe, E-mail to: <[email protected]> ----------------------------------------------------------------
