Templates and Functions

Localize XHTML templates and XSLT functions

While most content on your website is likely to be stored on pages (static content) or in data types (dynamic content), some content might be part of XHTML-based templates and/or XSLT-based functions.

When you create your templates and XSLT functions, we recommend that you keep all the strings in the resource files in /App_GlobalResources. In this case, you can create localized versions of those resource files and use the strings from those resources in the same template regardless the website language:

<lang:string key="Resource, Resources.MyResourceFile.MyStringName" xmlns:lang="http://www.composite.net/ns/localization/1.0" />
 

where "MyResourceFile" stands for the name of the resource file (without the extension and culture code suffix) and "MyStringName" - the name of the string in the resource file.

Note: The steps for localizing page templates are applicable for XSLT functions, too.