Home > Contents > Index >
Template Tag TOC  |   Alpha TOC  |   Tag Family TOC  |   Purpose TOC  |   Annotated TOC  |   Index 

 

XLAT.LOOKUP

A tag which looks up a locale-specific string, and encodes it appropriately for an HTML or Javascript environment.

Syntax

Parameters

KEY (required)
Input. The name of the key to look up in the SystemLocaleString table.

VARNAME (required)
Input. The name of the variable to create with the localized and potentially encoded string.

LOCALE (optional)
Input. The name of the locale to use for the localized string lookup (e.g. en_US).

ENCODE (optional)
Input. If set to true (the default), the localized string will be escaped to become consistent with usage inside a standard HTML setting (e.g., an HTML attribute or text). If this is used in conjunction with escape=true, then the localized string will be escaped in a manner consistent with usage inside both HTML and Javascript (e.g., a mouseover command inside an HTML attribute.)

ESCAPE (optional)
Input. If set to true, the localized string will be escaped to become consistent with usage inside a Javascript setting (e.g., a Javascript quoted constant). If not specified, the default is false. If this is used in conjunction with encode=true, then the localized string will be escaped in a manner consistent with usage inside both HTML and Javascript (e.g., a mouseover command inside an HTML attribute.)

EVALALL (optional)
Input. If set to true (the default), then all environmental variables will be substituted in the localized string. For example, "hi there Variables.myname" would be converted to "hi there Alyssa", if there was a variable in called myname with a value of Alyssa.
If evalall is set to false, then only variables described by included xlat:argument tags will be substituted.

Description

This tag looks up the value of a specified key in the SystemLocaleString table using either the specified locale, or the value in the session variable locale. If the locale is still not determined, a default value of en_US will be used.
After lookup, the string may optionally be prepared for usage in various contexts such as Javascript or HTML.

errno

None.

 

Examples

This code looks up the key "mykey" in Canadian French and substitutes the result into an HTML attribute. The variable "myname" is made available for the localized text to substitute:

See Also

XLAT.STREAM

 

  Home > Contents > Index >

FatWire XML Tag Reference
Copyright 2005 by FatWire Software
All rights reserved.