multilingual Sub-content and alternate locale

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

multilingual Sub-content and alternate locale

Eric DE MAULDE
Hi,

By exemple for web site policies http://demo.hotwaxmedia.com/ecommerce/control/policies
I would like to display multilingual text with alternate locale.
Even if I add alternate locale to the "policies" content,
it doesn't work. Policies are always in English !

In ecommerce/.../commonScreens.xml

<screen name="policies">
...
        <sub-content content-id="WebStoreCONTENT" map-key="policies"/>
...

How can I change this line to display multilingual content ?

Eric
Reply | Threaded
Open this post in threaded view
|

Re: multilingual Sub-content and alternate locale

Jacques Le Roux
Administrator
Have a look into DemoProductI18nData.xml

Jacques

From: "Eric DE MAULDE" <[hidden email]>
Hi,

By exemple for web site policies http://demo.hotwaxmedia.com/ecommerce/control/policies
I would like to display multilingual text with alternate locale.
Even if I add alternate locale to the "policies" content,
it doesn't work. Policies are always in English !

In ecommerce/.../commonScreens.xml

<screen name="policies">
...
        <sub-content content-id="WebStoreCONTENT" map-key="policies"/>
...

How can I change this line to display multilingual content ?

Eric
Reply | Threaded
Open this post in threaded view
|

Re: multilingual Sub-content and alternate locale

Malin Nicolas
In reply to this post by Eric DE MAULDE
Eric DE MAULDE a écrit :

> Hi,
>
> By exemple for web site policies http://demo.hotwaxmedia.com/ecommerce/control/policies
> I would like to display multilingual text with alternate locale.
> Even if I add alternate locale to the "policies" content,
> it doesn't work. Policies are always in English !
>
> In ecommerce/.../commonScreens.xml
>
> <screen name="policies">
> ...
>         <sub-content content-id="WebStoreCONTENT" map-key="policies"/>
> ...
>
> How can I change this line to display multilingual content ?
>
> Eric
>  
Hi Eric, you can create a policy with your language without change the
code. You just need associate a data resource associate to
WebStoreContent with your locale. If my rebember are good ;)

Nicolas

--
Nicolas MALIN
Consultant
Tél : 06.17.66.40.06
Site projet : http://www.neogia.org/
-------
Société LibrenBerry
Tél : 02.48.02.56.12
Site : http://www.librenberry.net/

Reply | Threaded
Open this post in threaded view
|

Re: multilingual Sub-content and alternate locale

Vince Clark
In reply to this post by Jacques Le Roux
The two demo data files demonstrate how to handle different languages for category and product. It appears to only address "name" and "description" fields.
DemoProductI18nData.xml
DemoProductCategoriesI18nData.xml

What would be the best way to localise other other product meta data such as product features?

jacques.le.roux wrote
Have a look into DemoProductI18nData.xml

Jacques

From: "Eric DE MAULDE" <ericjob@free.fr>
Hi,

By exemple for web site policies http://demo.hotwaxmedia.com/ecommerce/control/policies
I would like to display multilingual text with alternate locale.
Even if I add alternate locale to the "policies" content,
it doesn't work. Policies are always in English !

In ecommerce/.../commonScreens.xml

<screen name="policies">
...
        <sub-content content-id="WebStoreCONTENT" map-key="policies"/>
...

How can I change this line to display multilingual content ?

Eric
Reply | Threaded
Open this post in threaded view
|

Re: multilingual Sub-content and alternate locale

masionas
Hi,

I have another issue. I need localization within "en" locale. Example  having two different descriptions for category in "en_US" and "en_GB". Below files operates with localeString as localeString="en", localeString="fr" etc.

Vince Clark wrote
DemoProductI18nData.xml
DemoProductCategoriesI18nData.xml
Reply | Threaded
Open this post in threaded view
|

Re: multilingual Sub-content and alternate locale

Jacques Le Roux
Administrator
Follow the same scheme using subdivisions. It should work (never testesd)

Jacques

From: "masionas" <[hidden email]>

>
> Hi,
>
> I have another issue. I need localization within "en" locale. Example
> having two different descriptions for category in "en_US" and "en_GB". Below
> files operates with localeString as localeString="en", localeString="fr"
> etc.
>
>
> Vince Clark wrote:
>> DemoProductI18nData.xml
>> DemoProductCategoriesI18nData.xml
>>
>
> --
> View this message in context: http://www.nabble.com/multilingual-Sub-content-and-alternate-locale-tp20953155p22090347.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>

Reply | Threaded
Open this post in threaded view
|

Re: multilingual Sub-content and alternate locale

Eric DE MAULDE
Hi,

*** Error (in Demo server and revision 746495)
To add an alternate locale in Catalog / Product / Content / Create Simple
Text Content For Alternate Locale
The error is :

... ERROR: insert or update on table "content_assoc" violates foreign key
constraint "contentassc_to"<br/> Detail: Key
(content_id_to)=([contentId=null]) is not present in table "content".))]
calling service createContentAssoc in
createSimpleTextContentForAlternateLocale

Eric

----- Original Message -----
From: "Jacques Le Roux" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, February 19, 2009 10:19 AM
Subject: Re: multilingual Sub-content and alternate locale


> Follow the same scheme using subdivisions. It should work (never testesd)
>
> Jacques
>
> From: "masionas" <[hidden email]>
>>
>> Hi,
>>
>> I have another issue. I need localization within "en" locale. Example
>> having two different descriptions for category in "en_US" and "en_GB".
>> Below
>> files operates with localeString as localeString="en", localeString="fr"
>> etc.
>>
>>
>> Vince Clark wrote:
>>> DemoProductI18nData.xml
>>> DemoProductCategoriesI18nData.xml
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/multilingual-Sub-content-and-alternate-locale-tp20953155p22090347.html
>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: multilingual Sub-content and alternate locale

Jacques Le Roux
Administrator
Hi Eric,

Could you please detail more the actions. I was able to create alternate locale simple texts (descriptions) in french (either fr and
fr_FR) for a product from the ui without any problems.
To see the result in eCommerce, I simply delete the std description in product content

Jacques

From: "Eric DE MAULDE" <[hidden email]>

> Hi,
>
> *** Error (in Demo server and revision 746495)
> To add an alternate locale in Catalog / Product / Content / Create Simple Text Content For Alternate Locale
> The error is :
>
> ... ERROR: insert or update on table "content_assoc" violates foreign key constraint "contentassc_to"<br/> Detail: Key
> (content_id_to)=([contentId=null]) is not present in table "content".))] calling service createContentAssoc in
> createSimpleTextContentForAlternateLocale
>
> Eric
>
> ----- Original Message -----
> From: "Jacques Le Roux" <[hidden email]>
> To: <[hidden email]>
> Sent: Thursday, February 19, 2009 10:19 AM
> Subject: Re: multilingual Sub-content and alternate locale
>
>
>> Follow the same scheme using subdivisions. It should work (never testesd)
>>
>> Jacques
>>
>> From: "masionas" <[hidden email]>
>>>
>>> Hi,
>>>
>>> I have another issue. I need localization within "en" locale. Example having two different descriptions for category in "en_US"
>>> and "en_GB". Below
>>> files operates with localeString as localeString="en", localeString="fr"
>>> etc.
>>>
>>>
>>> Vince Clark wrote:
>>>> DemoProductI18nData.xml
>>>> DemoProductCategoriesI18nData.xml
>>>>
>>>
>>> --
>>> View this message in context: http://www.nabble.com/multilingual-Sub-content-and-alternate-locale-tp20953155p22090347.html
>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>
>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: multilingual Sub-content and alternate locale

Eric DE MAULDE
I reproduce the error to create an alternate locale for Warning content,
I type "en" for locale string :
https://demo.hotwaxmedia.com/catalog/control/EditProductContent?productId=WG-9943


Eric
----- Original Message -----
From: "Jacques Le Roux" <[hidden email]>
To: <[hidden email]>
Sent: Saturday, February 21, 2009 4:20 PM
Subject: Re: multilingual Sub-content and alternate locale


> Hi Eric,
>
> Could you please detail more the actions. I was able to create alternate
> locale simple texts (descriptions) in french (either fr and fr_FR) for a
> product from the ui without any problems.
> To see the result in eCommerce, I simply delete the std description in
> product content
>
> Jacques
>
> From: "Eric DE MAULDE" <[hidden email]>
>> Hi,
>>
>> *** Error (in Demo server and revision 746495)
>> To add an alternate locale in Catalog / Product / Content / Create Simple
>> Text Content For Alternate Locale
>> The error is :
>>
>> ... ERROR: insert or update on table "content_assoc" violates foreign key
>> constraint "contentassc_to"<br/> Detail: Key
>> (content_id_to)=([contentId=null]) is not present in table "content".))]
>> calling service createContentAssoc in
>> createSimpleTextContentForAlternateLocale
>>
>> Eric
>>
>> ----- Original Message -----
>> From: "Jacques Le Roux" <[hidden email]>
>> To: <[hidden email]>
>> Sent: Thursday, February 19, 2009 10:19 AM
>> Subject: Re: multilingual Sub-content and alternate locale
>>
>>
>>> Follow the same scheme using subdivisions. It should work (never
>>> testesd)
>>>
>>> Jacques
>>>
>>> From: "masionas" <[hidden email]>
>>>>
>>>> Hi,
>>>>
>>>> I have another issue. I need localization within "en" locale. Example
>>>> having two different descriptions for category in "en_US" and "en_GB".
>>>> Below
>>>> files operates with localeString as localeString="en",
>>>> localeString="fr"
>>>> etc.
>>>>
>>>>
>>>> Vince Clark wrote:
>>>>> DemoProductI18nData.xml
>>>>> DemoProductCategoriesI18nData.xml
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/multilingual-Sub-content-and-alternate-locale-tp20953155p22090347.html
>>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>>
>>>
>>>
>>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: multilingual Sub-content and alternate locale

Jacques Le Roux
Administrator
Yes, you are right. I did not use the alternate servlet. I will have a look.

Jacques

From: "Eric DE MAULDE" <[hidden email]>

>I reproduce the error to create an alternate locale for Warning content,
> I type "en" for locale string :
> https://demo.hotwaxmedia.com/catalog/control/EditProductContent?productId=WG-9943
>
>
> Eric
> ----- Original Message -----
> From: "Jacques Le Roux" <[hidden email]>
> To: <[hidden email]>
> Sent: Saturday, February 21, 2009 4:20 PM
> Subject: Re: multilingual Sub-content and alternate locale
>
>
>> Hi Eric,
>>
>> Could you please detail more the actions. I was able to create alternate
>> locale simple texts (descriptions) in french (either fr and fr_FR) for a
>> product from the ui without any problems.
>> To see the result in eCommerce, I simply delete the std description in
>> product content
>>
>> Jacques
>>
>> From: "Eric DE MAULDE" <[hidden email]>
>>> Hi,
>>>
>>> *** Error (in Demo server and revision 746495)
>>> To add an alternate locale in Catalog / Product / Content / Create Simple
>>> Text Content For Alternate Locale
>>> The error is :
>>>
>>> ... ERROR: insert or update on table "content_assoc" violates foreign key
>>> constraint "contentassc_to"<br/> Detail: Key
>>> (content_id_to)=([contentId=null]) is not present in table "content".))]
>>> calling service createContentAssoc in
>>> createSimpleTextContentForAlternateLocale
>>>
>>> Eric
>>>
>>> ----- Original Message -----
>>> From: "Jacques Le Roux" <[hidden email]>
>>> To: <[hidden email]>
>>> Sent: Thursday, February 19, 2009 10:19 AM
>>> Subject: Re: multilingual Sub-content and alternate locale
>>>
>>>
>>>> Follow the same scheme using subdivisions. It should work (never
>>>> testesd)
>>>>
>>>> Jacques
>>>>
>>>> From: "masionas" <[hidden email]>
>>>>>
>>>>> Hi,
>>>>>
>>>>> I have another issue. I need localization within "en" locale. Example
>>>>> having two different descriptions for category in "en_US" and "en_GB".
>>>>> Below
>>>>> files operates with localeString as localeString="en",
>>>>> localeString="fr"
>>>>> etc.
>>>>>
>>>>>
>>>>> Vince Clark wrote:
>>>>>> DemoProductI18nData.xml
>>>>>> DemoProductCategoriesI18nData.xml
>>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/multilingual-Sub-content-and-alternate-locale-tp20953155p22090347.html
>>>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>>>
>>>>
>>>>
>>>
>>
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: multilingual Sub-content and alternate locale

masionas
In reply to this post by Jacques Le Roux
Unfortunately it does not appear to work.

jacques.le.roux wrote
Follow the same scheme using subdivisions. It should work (never testesd)

Jacques
Reply | Threaded
Open this post in threaded view
|

Re: multilingual Sub-content and alternate locale

Jacques Le Roux
Administrator
Yes, I know. I will look at it soon...

Jacques

From: "masionas" <[hidden email]>

>
> Unfortunately it does not appear to work.
>
>
> jacques.le.roux wrote:
>>
>> Follow the same scheme using subdivisions. It should work (never testesd)
>>
>> Jacques
>>
>>
>
> --
> View this message in context: http://www.nabble.com/multilingual-Sub-content-and-alternate-locale-tp20953155p22170534.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>

Reply | Threaded
Open this post in threaded view
|

Re: multilingual Sub-content and alternate locale

masionas
Hi Jacques,

Actually, after I added the 'en_US' and 'en_GB' as available locales in general.properties file and used these values in locale string field in content entities it started to work I think.

jacques.le.roux wrote
Yes, I know. I will look at it soon...

Jacques

From: "masionas" <michael.korotun@gmail.com>
>
> Unfortunately it does not appear to work.
>
>
> jacques.le.roux wrote:
>>
>> Follow the same scheme using subdivisions. It should work (never testesd)
>>
>> Jacques
>>
>>
>
> --
> View this message in context: http://www.nabble.com/multilingual-Sub-content-and-alternate-locale-tp20953155p22170534.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: multilingual Sub-content and alternate locale

Jacques Le Roux
Administrator
Have you used the UI following http://docs.ofbiz.org/x/_AM or an xml file ?

Yes, if you set some locales then you have to put all the ones you want to use, as comment explains

Jacques

From: "masionas" <[hidden email]>

>
> Hi Jacques,
>
> Actually, after I added the 'en_US' and 'en_GB' as available locales in
> general.properties file and used these values in locale string field in
> content entities it started to work I think.
>
>
> jacques.le.roux wrote:
>>
>> Yes, I know. I will look at it soon...
>>
>> Jacques
>>
>> From: "masionas" <[hidden email]>
>>>
>>> Unfortunately it does not appear to work.
>>>
>>>
>>> jacques.le.roux wrote:
>>>>
>>>> Follow the same scheme using subdivisions. It should work (never
>>>> testesd)
>>>>
>>>> Jacques
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/multilingual-Sub-content-and-alternate-locale-tp20953155p22170534.html
>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/multilingual-Sub-content-and-alternate-locale-tp20953155p22235078.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>

Reply | Threaded
Open this post in threaded view
|

Re: multilingual Sub-content and alternate locale

masionas
Hi  Jacques ,

I have actually tried it from seed file, but an idea is the same as in your article - creating main content and then association as alternate locale. Here is the code I used in the seed and it appeared to work finally after adding en_US and en_GB to general.properties. HOW do I check that it works? I go to ecommerce and request the link with this category and language set as US English in dropdown - it shows US English description content. Then I change the language in dropdown to GB English and request the url again. Firstly, it shows cached old page with both US items, then I press F5 and it shows GB language  selected in dropdown and GB description content. Here is the seed data:



 <ProductCategory productCategoryId="FOOTER_BOX_1" productCategoryTypeId="INTERNAL_CATEGORY" categoryName= "Footer Box 1"
    categoryImageUrl = "/images/categories/category/FOOTER_BOX_1.jpg" linkOneImageUrl="/images/categories/linkOne/FOOTER_BOX_1.gif"
    description = "" categoryMenuName="" categoryMenuIcon=""  linkUrl=""/>
 
 
    <DataResource dataResourceId="DRFooterBox1EnUS" dataResourceTypeId="ELECTRONIC_TEXT" localeString="en_US"/>   
    <DataResource dataResourceId="DRFooterBox1EnGB" dataResourceTypeId="ELECTRONIC_TEXT" localeString="en_GB"/>   
 
    <ElectronicText dataResourceId="DRFooterBox1EnUS" textData="30 day returns text US English"/>
    <ElectronicText dataResourceId="DRFooterBox1EnGB" textData="30 day returns text GB English"/>
     
    <Content contentId="CFooterBox1EnUS" contentTypeId="DOCUMENT" dataResourceId="DRFooterBox1EnUS" description="30 day return text US" localeString="en_US" />
    <Content contentId="CFooterBox1EnGB" contentTypeId="DOCUMENT" dataResourceId="DRFooterBox1EnGB" description="30 day return text GB" localeString="en_GB"/>

    <ProductCategoryContent productCategoryId="FOOTER_BOX_1" contentId="CFooterBox1EnUS" prodCatContentTypeId="DESCRIPTION" fromDate="2006-09-22 00:00:00.0"/>

    <ContentAssoc contentId="CFooterBox1EnUS" contentIdTo="CFooterBox1EnGB" contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2006-09-22 00:00:00.0"/>
   


   
Reply | Threaded
Open this post in threaded view
|

Re: multilingual Sub-content and alternate locale

Jacques Le Roux
Administrator
In r751072 I have fixed an issue I had introduced recently. I have also updated http://docs.ofbiz.org/x/_AM to reflect the UI as it
works now

Jacques

From: "masionas" <[hidden email]>

>
> Hi  Jacques ,
>
> I have actually tried it from seed file, but an idea is the same as in your
> article - creating main content and then association as alternate locale.
> Here is the code I used in the seed and it appeared to work finally after
> adding en_US and en_GB to general.properties. HOW do I check that it works?
> I go to ecommerce and request the link with this category and language set
> as US English in dropdown - it shows US English description content. Then I
> change the language in dropdown to GB English and request the url again.
> Firstly, it shows cached old page with both US items, then I press F5 and it
> shows GB language  selected in dropdown and GB description content. Here is
> the seed data:
>
>
> <!--  Footer Box 1 -->
> <ProductCategory productCategoryId="FOOTER_BOX_1"
> productCategoryTypeId="INTERNAL_CATEGORY" categoryName= "Footer Box 1"
>    categoryImageUrl = "/images/categories/category/FOOTER_BOX_1.jpg"
> linkOneImageUrl="/images/categories/linkOne/FOOTER_BOX_1.gif"
>    description = "" categoryMenuName="" categoryMenuIcon=""  linkUrl=""/>
>
> <!--  Content for Footer Box 1 -->
>    <DataResource dataResourceId="DRFooterBox1EnUS"
> dataResourceTypeId="ELECTRONIC_TEXT" localeString="en_US"/>
>    <DataResource dataResourceId="DRFooterBox1EnGB"
> dataResourceTypeId="ELECTRONIC_TEXT" localeString="en_GB"/>
>
>    <ElectronicText dataResourceId="DRFooterBox1EnUS" textData="30 day
> returns text US English"/>
>    <ElectronicText dataResourceId="DRFooterBox1EnGB" textData="30 day
> returns text GB English"/>
>
>    <Content contentId="CFooterBox1EnUS" contentTypeId="DOCUMENT"
> dataResourceId="DRFooterBox1EnUS" description="30 day return text US"
> localeString="en_US" />
>    <Content contentId="CFooterBox1EnGB" contentTypeId="DOCUMENT"
> dataResourceId="DRFooterBox1EnGB" description="30 day return text GB"
> localeString="en_GB"/>
>
>    <ProductCategoryContent productCategoryId="FOOTER_BOX_1"
> contentId="CFooterBox1EnUS" prodCatContentTypeId="DESCRIPTION"
> fromDate="2006-09-22 00:00:00.0"/>
>
>    <ContentAssoc contentId="CFooterBox1EnUS" contentIdTo="CFooterBox1EnGB"
> contentAssocTypeId="ALTERNATE_LOCALE" fromDate="2006-09-22 00:00:00.0"/>
>
> <!-- End Content for Footer Box 1 -->
>
> <!--  End Footer Box 1 -->
>
> --
> View this message in context: http://www.nabble.com/multilingual-Sub-content-and-alternate-locale-tp20953155p22244043.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>