Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Multilanguage My Profile web part View modes: 
User avatar
Member
Member
sousuke-onet - 1/20/2012 8:56:04 AM
   
Multilanguage My Profile web part
Hello, I'd like to know how to edit web part My Profile
I have in user profile field with Multiple choice (with other), so name for answer is in my database and now i want add multilanguage support with macro but if i put in database something like {$=OK|cs-cz=dobre|de-de=gut$} it didn't working.

User avatar
Member
Member
kentico_michal - 1/22/2012 7:39:07 AM
   
RE:Multilanguage My Profile web part
Hello,

Where did you put this macro?

It should not be problem with using localization macros in the options definition, for example:

1;{$=en item1|cs-cz=cz item1$}
2;{$=en item2|cs-cz=cz item2$}


For more information, I would like to point you to this section dedicated to macros expressions: Types of macros

Best regards,
Michal Legen

User avatar
Member
Member
sousuke-onet - 1/24/2012 11:23:36 AM
   
RE:Multilanguage My Profile web part
Ok, I know what I did wrong, I have custom control Multiple Choice which show also option 'Other' and text box to wrote your other answer.
Text for normal checkbox i take from my SQL database and only from this place they are loaded. How to force parsing macro after putting SQL records into checkbox items?

For loading items from SQL I use:
cbList.DataBind();

User avatar
Member
Member
kentico_michal - 1/29/2012 12:04:18 AM
   
RE:Multilanguage My Profile web part
Hello,

You need to resolve the macros before binding the checkbox. To do so, you can use the following method that can be used to resolve all the macros:
string CMS.CMSHelper.CMSContext.CurrentResolver.ResolveMacros(string inputText)

There is also another method that can be used to resolve the localization macros:
string CMS.GlobalHelper.ResHelper.LocalizeString(string inputText)


Best regards,
Michal Legen