Storing Localized Metadata in Language Files

How to:

Localized column titles and description attributes can be stored in a Master File using the TITLE_lng and DESC_lng attributes.

However, if you want to centralize localized column titles, descriptions, and prompts, and apply them to multiple Master Files, you can create a set of translation files and use the TRANS_FILE attribute in a Master File to invoke them.


Top of page

x
Syntax: How to Create and Invoke Metadata Translation Files

Translation File Naming Conventions

The translation files have names of the following form:

prefixlng.lng

where:

prefix

Is a group of characters prepended to each related translation file.

lng

Is a language code.

For example, if the common prefix is dt, the French translation file would be named dtfre.lng, and the English translation file would be named dteng.lng.

Translation File Contents

The prefixeng.lng file must contain any title, description, and prompt values that you want translated as they appear in the Master File, whether they are in English or another language:

  1. Copy each attribute value from the Master File that you want translated into the default (eng) translation file, and assign it an index number. The index numbers do not need to be consecutive or in order. For example:
    39 = Product,Category
  2. Add the translations of those attribute values to the translation files for the other languages in which you want to display the metadata. Assign the same index number to the translations. For example, in the French translation file:
    39 = Produit,Catégorie

Identifying the Translation Files to Use For a Master File

To specify that a Master File should use a particular set of translation files, identify the common prefix in the FILE declaration of the Master File:

FILENAME=filename,  TRANS_FILE=[path]/prefix, ...

where:

filename

Is the name specified in the FILE= attribute.

path

Is the information needed for locating the set of translation files. It can be a full path or an app reference. If there is one set of translation files with the prefix being used and it is on the app path, this can be omitted.

prefix

Is the common prefix for the set of translation files.

Invoking the Translation Files for a Request

  1. Make sure the server is using a code page that supports the languages to be used.
  2. Set the LANGUAGE parameter to the language in which the metadata should be displayed.
  3. Run the request.


Example: Using Translation Files

The following request uses the WF_RETAIL_LITE data source:

TABLE FILE WF_RETAIL
SUM REVENUE_US 
BY PRODUCT_CATEGORY
BY PRODUCT_SUBCATEG
ON TABLE SET PAGE NOPAGE
ON TABLE SET STYLE *
TYPE = TITLE, FONT='Trebuchet MS', $
ENDSTYLE
END

The output is:

The Master File contains the following TRANS_FILE attribute:

FILENAME=WF_RETAIL_LITE,  TRANS_FILE=_EDAHOME/NLS/dt, ...

The TRANS_FILE attribute points to files that start with the characters dt that are in the NLS folder under the EDAHOME directory. The following sample shows some of the contents of the default translation file, dteng.lng:

1 = Age
2 = Age Range
3 = Age Group
6 = Gender
9 = Discount,Rate
10 = Discount,Price,Multiplier
15 = Country
17 = State
19 = City
31 = Customer,Income Range
32 = Customer,Income Subrange
33 = Households
34 = Number of,Earners
35 = Household,Size
36 = Industry
38 = Occupation
39 = Product,Category
40 = Product,Subcategory
41 = Brand Type

The text assigned to each number can be found in one of the Master Files associated with the WF_RETAIL_LITE Master File. WF_RETAIL_LITE is a cluster Master File that references fact and dimension Master Files to create a star schema.

The following sample shows the corresponding contents of the French translation file, dtfre.lng:

1 = Age
2 = Tranche d'âge
3 = Groupe d'âge
6 = Sexe
9 = Remise,Taux
10 = Remise,Prix,Multiplicateur
15 = Pays
17 = Département
19 = Ville
31 = Client,Tranche de revenus
32 = Client,Sous-tranche de revenus
33 = Ménages
34 = Nombre de,Salariés
35 = Ménage,Taille
36 = Secteur d'activité
38 = Profession
39 = Produit,Catégorie
40 = Produit,Sous-catégorie
41 = Type de marque

When the language is set to French, any text to be displayed that is an exact match to an index number in the dteng.lng file will be substituted with the text for the same index number in the dtfre.lng file.

The following version of the request adds the SET LANG=FRE command. The server code page supports English and French:

SET LANG = FRE
TABLE FILE WF_RETAIL
SUM REVENUE_US 
BY PRODUCT_CATEGORY
BY PRODUCT_SUBCATEG
ON TABLE SET PAGE NOPAGE
ON TABLE SET STYLE *
TYPE = TITLE, FONT='Trebuchet MS', $
ENDSTYLE
END

The output has translated column titles:


iWay Software