what's the right way to use localization macros in ASCX transformation? So far I was able to get to this:
<%# CMS.CMSHelper.CMSContext.CurrentResolver.ResolveMacros( (bool)Eval("isUserActive") == true ? "{$boolean_yes$}" : "{$boolean_no$}" ) %>
but it looks... ugly?.. am I doing everything right? Basically I have a boolean field and I want to display yes/no in user's language.
Hi,
Since macros are not supported in ASCX transformation, this is the correct way.
Best regards, Juraj Ondrus
I believe you could also use this <%# (EvalBoolean("isUserActive") ? CMS.GlobalHelper.ResHelper.LocalizeString("{$boolean_yes$}) : CMS.GlobalHelper.ResHelper.LocalizeString("{$boolean_no$})) %> vs. a macro.
<%# (EvalBoolean("isUserActive") ? CMS.GlobalHelper.ResHelper.LocalizeString("{$boolean_yes$}) : CMS.GlobalHelper.ResHelper.LocalizeString("{$boolean_no$})) %>
Please, sign in to be able to submit a new answer.