Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Automate translation of text with macro in ascx View modes: 
User avatar
Member
Member
francis.harvey-irisco - 9/10/2010 1:35:27 PM
   
Automate translation of text with macro in ascx
I want to automate the resolve of localisation macro in control's text property in my usercontrol

I try the {$keyname$} in the text, but i need to browse each control at page_load to tell kentico to resolve the string

like

MyLabel.Text = ResolveMacro(Mylabel.Text)

not really good...

Is there a solution to that?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 9/20/2010 7:52:00 AM
   
RE:Automate translation of text with macro in ascx
Hi,

Could you please explain what are you trying to achieve? Do you have one control or several independent controls?

I am not getting the meaning of browsing each control. Moreover, you can use CMS.GlobalHelper.ResHelper.LocalizeString(string inputText) for localization macros.

Anyway, the localization string has to be localized on each load of the control.

Best regards,
Juraj Ondrus

User avatar
Member
Member
francis.harvey-irisco - 9/20/2010 2:29:46 PM
   
RE:Automate translation of text with macro in ascx
i have a usercontrol with localisation macro to resolve in his control property Text

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 9/22/2010 2:37:21 AM
   
RE:Automate translation of text with macro in ascx
Hi,

You can add this code directly to the property/variables of your user control in the Set section, so it will be set every time.

Best regards,
Juraj Ondrus