I agree.. There is also a dangerous scenario that produced a lot of pain here.. Imagine you start a site in 4 languages, default is EN. You release the site in PRE-PROD to let content writers to enter content.
When content is released, someone (maybe for good reasons!) decides to change default language, from EN to, let's say, IT. Without a (poweruser) script, you are dead, because "_it" will be ignored and the default properties contains EN texts, but Magnolia serves them for IT. Matteo -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Will Scheidegger Sent: domenica, 2. ottobre 2011 00:47 To: Magnolia User-List Subject: Re: [magnolia-user] Troubles with i18n node wrapper Hi Jan Thanks for the help... but it does not make any sense to me. If I got you correctly, the node structure should look something like this: - node - title (default language, let's say this is english) - tilte_de (german) - title_fr (french) And this would be wrong then? - title_en - title_de - title_fr This would be "broken by design" since you could not use the same node in different sites. Let's say you have shop products and you want do display them in the main site and a special country-specific site with a different default language, then you're out of luck? The proper behavior should be: 1. Look for an attribute [attribute-name]_[language-name]. 2. If it does not exist try [attribute-name]_[default-language-name]. 3. If that does not exist either, try [attribute-name]. I don't see how you could go wrong with this approach. Which class takes care of that behavior? I've looked at MessagesWrapper, MagnoliaObjectWrapper, FreemarkerUtil, FreemarkerHelper, I18NContentWrapper but could not find it - then again it's late: I might have missed it... -will On 01.10.2011, at 12:38, Jan Haderka wrote: > Most likely scenario is that the title was created when default land for your > site was english. Later you changed config so the default lang is german. > Values for default lang are always taken from the node w/o suffix. > HTH, > Jan > > Will Scheidegger <[email protected]> wrote: > > Dear Magnolians > > I have the following code in my freemarker template: > > [#assign wrappedNode = mgnl.i18n(model.categoryNode) /] > <br />locale: ${state.locale.language} > <br />${wrappedNode.title!'no title'} > <br />${wrappedNode.title_de!'no title_de'} > > And I get as output: > > locale: de > no title > Deutscher Title > > So: > - my node does have a value in a "title_de" attribute > - the language in the aggregation state is correctly set to "de" > - still wrappedNode.title does not give me the localized value! > > This is on Magnolia 4.2.3 in a freemarker paragraph template in a mostly JSP > based website (no STK). Can anyone help me debug this? > > Thanks! > -will > > > ---------------------------------------------------------------- > For list details see > http://www.magnolia-cms.com/community/mailing-lists.html > To unsubscribe, E-mail to: <[email protected]> > ---------------------------------------------------------------- > > > > > ---------------------------------------------------------------- > For list details see > http://www.magnolia-cms.com/community/mailing-lists.html > To unsubscribe, E-mail to: <[email protected]> > ---------------------------------------------------------------- ---------------------------------------------------------------- For list details see http://www.magnolia-cms.com/community/mailing-lists.html To unsubscribe, E-mail to: <[email protected]> ---------------------------------------------------------------- ---------------------------------------------------------------- For list details see http://www.magnolia-cms.com/community/mailing-lists.html To unsubscribe, E-mail to: <[email protected]> ----------------------------------------------------------------
