[Hippo-cms7-user] HippoNode.getLocalizedName()

Francesco Chicchiriccò francesco.chicchiricco at everett.it
Fri May 7 14:03:02 CEST 2010


On 07/may/10, at 09:30, Ard Schrijvers wrote:

> Hello Francesco,
>
> You should use the getLocalizedName() and not the way it works in  
> the cms.
>
> Furthermore, are you having multiple translation nodes below a folder?
> Afaik, currently, most likely indeed always the first translation is
> returned for
>
> ((HippoNode) hippoBean.getNode()).getLocalizedName()
>
> Do you mean you have multiple translations for a folder?
>
> Currently, afaik there is no support for getting the correct
> translated folder name when you have multiple translations for it.

Hi Ard,
at the moment I have more hippo:translation nodes for some folders.

Is there any bugfix / workaround possible for not getting always the  
first translation by mean of getLocalizedName()? Should this be filed  
on JIRA?

> Furthermore, I am curious after your data structure setup, and how you
> are handling multilinguality as this is an area we still need to
> improve on.

It's still a work in progress, but the basic idea about multilingual  
is that we have a folder for each multilingual document; in each  
folder documents are created with the name of the corresponding  
language ("it", "en", "es"...).

In addition to this, folders are (or better should be... ;-))  
translated as well.

If there is no way / plan to fix the behaviour of getLocalizedName()  
for folder, I think we will need to switch back to the "CMS way" :-(

Cheers.

> 2010/5/6 Francesco Chicchiriccò <francesco.chicchiricco at everett.it>:
>> Hi there,
>> I am using the latest tag from 7.3 (2.12.09) and I am experiencing  
>> something
>> strange related to HippoNode.getLocalizedName().
>>
>> As far as I've understood, this method is meant to be called every  
>> time that
>> you have a node that has "hippo:translated" as mixin, with one or  
>> more
>> "hippo:translation" child nodes.
>> The expected behaviour should be - if I've understood correctly -  
>> that when
>> I do something like
>>
>> ((HippoNode) hippoBean).getLocalizedName()
>>
>> I got the translation of that node's label in Locale.getDefault()  
>> or English
>> as fallback.
>>
>> This thing seems to work fine for documents but has some troubles  
>> with
>> folders: in my tests the first hippo:translation child node is always
>> returned as localized label.
>>
>> Moreover, I've checked at [1], from row 120, that the CMS  
>> application does
>> not use the provided HippoNode.getLocalizedName(), but does a manual
>> discover of available translations.
>>
>> Now my question is: what is the recommended approach? Is there  
>> something
>> relevant why getLocalizedName() is not working for folders?
>>
>> Thanks.
>>
>> [1]
>> http://svn.hippocms.org/repos/hippo/hippo-ecm/tags/Tag-HREPTWO-v2_12_09/frontend/engine/src/main/java/org/hippoecm/frontend/i18n/model/NodeTranslator.java
>> _______________________________________________
>> Hippo-cms7-user mailing list and forums
>> http://www.onehippo.org/cms7/support/forums.html
>>
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html




More information about the Hippo-cms7-user mailing list