Introduction
When month taken by using ddwrt namespace it gives the name first letter in captial for some languages only.
For example December in english but dicembre in italian.So here i tried some xslt code to change the first letter in captial.
|
<xsl:variable name="caseLower" select= "'abcdefghijklmnopqrstuvwxyz'"/>
<xsl:variable name="caseUpper" select= "'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
<xsl:variable name="testNewsdate"> <!--It gives Month name as décembre in french-->
<xsl:value-of select="ddwrt:FormatDateTime(string(@CreatedDate),1036,'MMMM yyyy: ')" />
</xsl:variable>
<xsl:variable name="dateNews"> <!--It translate Month name as Décembre in french-->
<xsl:value-of select= "concat(translate(substring($testNewsdate,1,1), $caseLower, $caseUpper),
substring($testNewsdate, 2),substring(' ', 1 div not(position()=last())) ) "/>
</xsl:variable>
|
Output
Before translating - décembre 2013
After translating - Décembre 2013
|