- Use one single input file facilitating translation
- Reference interface messages from the project's resource files instead of repeating them literally, in order to assure consistency.
My solution to the second one, can be found in this customization of the chunking template. Have a look at how the inline.charseq template is overridden. This is the important part:
<xsl:choose>
<xsl:when test="normalize-space(.)">
.....
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="document($resfile)/resources/string[@name = $id]">
</xsl:value-of></xsl:otherwise>
</xsl:choose>
When the element has no content, localized string is looked up in the resource file, based on the role attribute of the element, stored earlier in the variable id. Now elements like
<guimenuitem role="select_account"/>
are rendered with their translated message.
No comments:
Post a Comment