Bookmark and Share

Friday, March 05, 2010

How to manage localized strings in DNN Form and List XSLT

Do you need to insert nationalized strings in a Form and List module on Dotnetnuke 5?

Here is the solution:

<xsl:variable name="currentCulture" select="//udt:Context/udt:CurrentCulture" />
<xsl:if test="$currentCulture='it-IT'">
Italian text
</xsl:if>
<xsl:if test="$currentCulture='en-US'">
English text
</xsl:if>




Hope it helps…

2 comments:

  1. Hi,
    Thanks for this. Is there a way to use Resource Strings and have those output?

    ReplyDelete
  2. Well, you can transform the xslt file into a aspx file that outputs the same xslt code.
    Then you can insert your resource strings inside the code using the "<%= %>" tokens.
    I think this is a better idea for localization , and it's more robust than my solution.
    Compliments!

    ReplyDelete