Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > How to dynamically change UI culture View modes: 
User avatar
Member
Member
Kendoka - 11/10/2010 12:07:46 AM
   
How to dynamically change UI culture
Hi there;

I'd like to use custom culture strings to provide translations in the front end UI of the web site (v5.5) for anonymous users. A user can switch Content Culture easily using the General > Language Selection web part. Is there a way I can use this to also change the UI culture to use my translated UI Cultures > Custom strings?

Perhaps a more direct version of this question is:

How do I change the UI culture dynamically?

Thanks in advance

-Pete

User avatar
Member
Member
Kendoka - 11/10/2010 1:55:48 AM
   
RE:How to dynamically change UI culture
I think I'm working towards a solution that involves replacing the portal template with an aspx template so I can modify the page behind code to override the InitializeCulture() method of the Page class.

I'll let you know how it goes but I'm still open to alternative solutions as I don't know if this one will work yet. :)

-Pete

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 11/10/2010 10:58:33 AM
   
RE:How to dynamically change UI culture
Hi,

could you please provide us more details about your scenario. Where would you like to change your UI culture?

You said that you would like to set UI culture for anonymous users. But IU culture sets culture of CMS Desk/Site manager where anonymous users have not access. You can set the default UI culture only for users already created in the system (Site Manager - Administration - Users - your_user - General - Preferred user interface culture).

Have you created and used your custom culture string according to this tutorial?

Now in your scenario - there is a live site, anonymous user prefer for example French version therefore he changes the language in the language selector and the content of page is changed to French version except of your culture strings?

Where are you using these strings?

Best regards,
Ivana Tomanickova

User avatar
Member
Member
Kendoka - 11/10/2010 3:42:32 PM
   
RE:How to dynamically change UI culture
Thanks for your reply Ivana;

I have created my custom culture strings according to the tutorial you linked to.

I understand that the default use of UI cultures is only in the back-end (CMSDesk/Site Manager).

What I have is UI elements that appear in the front-end of the site for anonymous users. Another way to describe it is that I have string constants that appear in multiple places in the front-end of the site that need to be multilingual. I have created custom web parts that use these strings. I'm trying to determine how to tell these web parts which language (culture) of the strings to use.

And I've figured it out. I was using CMS.GlobalHelper.ResHelper.GetString(stringName) when I should have been using CMS.GlobalHelper.ResHelper.GetString(stringName, culture)

Thank you. Problem solved. :)

-Pete