Interchange I18N Features ========================= ic_i18n.1.4 (Draft) 1. Internationalization ======================= Interchange has a rich set of internationalization (I18N) features that allow conditional message display, differing price formats, different currency definitions, price factoring, sorting, and other settings. The definitions are maintained in the catalog.cfg file through the use of built-in POSIX support and Interchange's Locale directive. All settings are independent for each catalog and each user visiting that catalog, since customers can access the same catalog in an unlimited number of languages and currencies. 1.1. Configuring the Locale --------------------------- It is recommended to use the ScratchDefault directive for setting the catalog's default locale: ScratchDefault mv_locale de_DE 1.2. Setting the Locale ----------------------- The locale could be set to fr_FR (French for France) in one of two ways: [setlocale locale=locale* currency=locale* persist=1*] Immediately sets the locale to locale, and will cause it to persist in future user pages if the persist is set to a non-zero, non-blank value. If the currency attribute is set, the pricing and currency-specific locale keys and Interchange configuration directives are modified to that locale. If there are no arguments, it sets it back to the user's default locale as defined in the scratch variables mv_locale and mv_currency. This allows: Dollar Pricing: [setlocale en_US] [item-list] [item-code]: [item-price]
[/item-list] Franc Pricing: [setlocale fr_FR] [item-list] [item-code]: [item-price]
[/item-list] [comment] Return to the user's default locale [/comment] [setlocale] [page process/locale/fr_FR/page/catalog] This is the same as [page catalog], except when the link is followed it will set the locale to fr_FR before displaying the page. This is persistent. [page process/locale/fr_FR/currency/en_US/page/catalog] This is the same as [page catalog], except when the link is followed it will set the locale to fr_FR and the pricing/number display to the locale en_US before displaying the page. This is persistent. Once the locale is persistently set for a user, it is in effect for the duration of their session. 1.3. Interchange Locale Settings -------------------------------- The Locale directive has many possible settings that allow complete internationalization of page sets and currencies. The Locale directive is defined in a series of key/value pairs with a key that contains word characters only being followed by a value. The value must be enclosed in double quotes if it contains whitespace. In this example, the key is Value setting. Locale fr_FR "Value setting" "Configuration de valeur" Locale de_DE "Value setting" Werteinstellung When accessed using the special tag [L]Value setting[/L], the value Configuration de valeur will be displayed only if the locale is set to fr_FR. If the locale is set to de_DE, the string Werteinstellung will be displayed. If it is neither, the default value of Value setting will be displayed. The [L] and [/L] must be capitalized. This is done for speed of processing as well as easy differentiation in text. Another, way to do this is right in the page. The [LC] ... [/LC] pragma pair permits specification of locale-dependent text. [LC] This is the default text. [fr_FR] Text for the fr_FR locale. [/fr_FR] [de_DE] Text for the de_DE locale. [/de_DE] [/LC] You can also place an entirely new page in place of the default one if the locale key is defined. When a locale is in force, and a key named HTMLsuffix is set to that locale, Interchange first looks for a page with a suffix corresponding to the locale. For example: Catalog home page If a page index.html exists, it will be the default. If the current locale is fr_FR, a page "index.fr_FR" exists, and Locale looks like this: Locale fr_FR HTMLsuffix .fr_FR Then, the .fr_FR page will be used instead of the .html page. For a longer series of strings, the configuration file recognizes: Locale fr_FR <