on 07-11-2014 10:41 AM
Hi
I have a question on Internationalisation and localization.
We have a requirement where we are giving the language change option to customer on Customer Profile page. Once customer submits the request for language page, the whole page (i.e header, footer and the profile page ( which is a jsp) ) needs to be refreshed with the language that the user has submitted.
Can anyone please tell me what is the best approach for the same.
I referred Localization and internationalization documentation on wiki hybris, but it talks about Item Type localization etc etc.
I want localization on jsps for which i suposeHybris dont have any OOTB support (please confirm on this). Does tag usage will be a good option to go with?
Accelerator does this out of the box.
The "spring:theme" tag is used to get the localized text:
<div id="productTabs">
<div class="tabHead"><spring:theme code="product.product.details" /></div>
<div class="tabBody"><product:productDetailsTab product="${product}"/></div>
<div class="tabHead" id="tab-reviews"><spring:theme code="review.reviews" /></div>
<div class="tabBody" ><product:productPageReviewsTab product="${product}"/></div>
<cms:pageSlot position="Tabs" var="tabs">
<cms:component component="${tabs}"/>
</cms:pageSlot>
</div>
which loads the message from properties files in /yacceleratorstorefront/web/webroot//WEB-INF
The above "product.product.details" from base_.properties:
product.product.details = Product details
product.product.details.more = More product details
If you are not using Accelerator, then you can deconstruct how this works and use the same mechanism.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot Konrad for your reply.
I have a question :
I am using B2bAccelerator and in my custom jsp i am going to use tag 1) Say On my customized customer Profile page , User changes the language say from english to thai and as part of it i made a change through below code:
userService.getCurrentUser().setSessionLanguage(LanguageModel corresponding to Thai language) Now after doing this if i refresh the page then will the localization gets applied automatically and the labels will be picked up from base_th.properties instead of base_en.properties??
Hello Konard, We have a similar requirement for french. However, was wondering if we can generate base_fr.properties file by using OOTB hybris language pack. Any suggestion will be very much helpful.
Thank You!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In addition to Konrads comments we have a fully working demonstrable approach in our B2C Electronic Store which we ship as a sample store with the Commerce Accelerator. Just ensure the electronicsstore AddOn is included in your localextensions.xml
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.