Multilingual Metadata

In this section:

How to:

Reference:

Master Files support column headings and descriptions in multiple languages.

The heading or description used depends on the value of the LANG parameter and whether a TITLE_ln or DESC_ln attribute is specified in the Master File, or a set of translation files exist for the Master File, where ln identifies the language to which the column heading or description applies.

In a Master File, column headings are taken from:

  1. A heading specified in the report request using the AS phrase.
  2. A TITLE attribute in the Master File, if no AS phrase is specified in the request and SET TITLES=ON.
  3. The field name specified in the Master File, if no AS phrase or TITLE attribute is specified, or if SET TITLES=OFF.

Top of page

x
Syntax: How to Activate the Use of a Language

Issue the following command in a supported profile or in a FOCEXEC:

SET LANG = lng

or

SET LANG = ln

where:

lng

Is the three-letter abbreviation for the language.

ln

Is the two-letter ISO language code.

Note: If SET LANG is used in a procedure, its value will override the values set in nlscfg.err or in any profile.


Top of page

x
Reference: Activating a Language in the NLS Configuration File

In the nlscfg.err configuration file, issue the following command:

LANG = lng

Top of page

x
Reference: Languages and Language Code Abbreviations

Language Name

Two-Letter Language Code

Three-Letter Language Abbreviation

Arabic

ar

ARB

Baltic

lt

BAL

Chinese - Simplified GB

zh

PRC

Chinese - Traditional Big-5

tw

ROC

Czech

cs

CZE

Danish

da

DAN

Dutch

nl

DUT

English - American

en

AME or ENG

English - UK

uk

UKE

Finnish

fi

FIN

French - Canadian

fc

FRE

French - Standard

fr

FRE

German - Austrian

at

GER

German - Standard

de

GER

Greek

el

GRE

Hebrew

iw

HEW

Italian

it

ITA

Japanese - Shift-JIS(cp942) on ascii cp939 on EBCDIC

ja

JPN

Japanese - EUC(cp10942) on ascii (UNIX)

je

JPE

Korean

ko

KOR

Norwegian

no

NOR

Polish

pl

POL

Portuguese - Brazilian

br

POR

Portuguese - Portugal

pt

POR

Russian

ru

RUS

Spanish

es

SPA

Swedish

sv

SWE

Thai

th

THA

Turkish

tr

TUR


Top of page

x
Placing Multilingual Metadata Directly in a Master File

How to:

Reference:

You can place TITLE_ln and DESCRIPTION_ln attributes directly in the Master file, where ln specifies the language code.



x
Syntax: How to Specify Multilingual Metadata in a Master File
FIELDNAME = field, ...
   .
   .
   .
TITLE= default_column_headingTITLE_ln = column_heading_for_ln   .
   .
   .
DESC= default_descDESC_ln = desc_for_ln   .
   .
   .

where:

field

Is a field in the Master File.

default_column_heading

Is the column heading to use when SET TITLES=ON and either the LANG parameter is set to the default language for the server, or another language is set but the Master File has no corresponding TITLE_ln attribute for that field. This column heading is also used if the ln value is invalid.

default_desc

Is the description to use when either the LANG parameter is set to the default language for the server, or another language is set but the Master File has no corresponding DESC_ln attribute for that field. This description is also used if the ln value is invalid.

TITLE_ln = column_heading_for_ln

Specifies the language for which the column heading applies and the text of the column heading in that language. That column heading is used when SET TITLES=ON, the LANG parameter is set to a non-default language for the server, and the Master File has a corresponding TITLE_ln attribute, where ln is the two-digit code for the language specified by the LANG parameter Valid values for ln are the two-letter ISO 639 language code abbreviations. For information, see Languages and Language Code Abbreviations.

DESC_ln = desc_for_ln

Specifies the language for which the description applies and the description text in that language. This description is used when the LANG parameter is set to a non-default language for the server and the Master File has a corresponding DESC_ln attribute. Valid values for ln are the two-letter ISO 639 language code abbreviations.



x
Reference: Usage Notes for Multilingual Metadata


Example: Using Multilingual Descriptions in a Master File

The following Master File for the CENTINV data source specifies French descriptions (DESC_FR) and Spanish descriptions (DESC_ES) as well as default descriptions (DESC) for the PROD_NUM and PRODNAME fields:

FILE=CENTINV, SUFFIX=FOC, FDFC=19, FYRT=00
 SEGNAME=INVINFO, SEGTYPE=S1, $
  FIELD=PROD_NUM, ALIAS=PNUM, FORMAT=A4, INDEX=I,
   DESCRIPTION='Product Number'
   DESC='Product Number',
   DESC_ES='Numero de Producto',
   DESC_FR='Nombre de Produit', $
  FIELD=PRODNAME, ALIAS=PNAME, FORMAT=A30,
   WITHIN=PRODCAT,
   DESCRIPTION='Product Name'
   DESC_FR='Nom de Produit',
   DESC_ES='Nombre de Producto', $
  FIELD=QTY_IN_STOCK, ALIAS=QIS, FORMAT=I7,
   DESCRIPTION='Quantity In Stock', $
  FIELD=PRICE, ALIAS=RETAIL, FORMAT=D10.2,
   TITLE='Price:',
   DESCRIPTION=Price, $


Example: Using Multilingual Titles in a Request

The following Master File for the CENTINV data source specifies French titles (TITLE_FR) and Spanish titles (TITLE_ES) as well as default titles (TITLE) for the PROD_NUM and PRODNAME fields:

FILE=CENTINV, SUFFIX=FOC, FDFC=19, FYRT=00
 SEGNAME=INVINFO, SEGTYPE=S1, $
  FIELD=PROD_NUM, ALIAS=PNUM, FORMAT=A4, INDEX=I,
   TITLE='Product,Number:',
   TITLE_FR='Nombre,de Produit:',
   TITLE_ES='Numero,de Producto:',
   DESCRIPTION='Product Number', $
  FIELD=PRODNAME, ALIAS=PNAME, FORMAT=A30,
   WITHIN=PRODCAT,
   TITLE='Product,Name:',
   TITLE_FR='Nom,de Produit:',
   TITLE_ES='Nombre,de Producto:'
   DESCRIPTION='Product Name', $
  FIELD=QTY_IN_STOCK, ALIAS=QIS, FORMAT=I7,
   TITLE='Quantity,In Stock:',
   DESCRIPTION='Quantity In Stock', $
  FIELD=PRICE, ALIAS=RETAIL, FORMAT=D10.2,
   TITLE='Price:',
   DESCRIPTION=Price, $

The default language for the server code page is English and, by default, SET TITLES=ON. Therefore, the following request, uses the TITLE attributes to produce column headings that are all in English:

TABLE FILE CENTINV
PRINT PROD_NUM PRODNAME PRICE
WHERE PRICE LT 200
END

The output is:

Product  Product
Number:  Name:                                 Price:
-------  -------                               ------
1004     2 Hd VCR LCD Menu                     179.00
1008     DVD Upgrade Unit for Cent. VCR        199.00
1026     AR3 35MM Camera 10 X                  129.00
1028     AR2 35MM Camera 8 X                   109.00
1030     QX Portable CD Player                 169.00
1032     R5 Micro Digital Tape Recorder         89.00

Now, issue the following command to set the language to Spanish and run the same request:

SET LANG = SPA

The output now displays column headings from the TITLE_ES attributes where they exist (Product Number and Product Name). Where no Spanish title is specified (the Price field), the column heading in the TITLE attribute appears:

Numero        Nombre
de Producto:  de Producto:                          Price:
------------  ------------                          ------
1004          2 Hd VCR LCD Menu                     179.00
1008          DVD Upgrade Unit for Cent. VCR        199.00
1026          AR3 35MM Camera 10 X                  129.00
1028          AR2 35MM Camera 8 X                   109.00
1030          QX Portable CD Player                 169.00
1032          R5 Micro Digital Tape Recorder         89.00

Top of page

x
Storing Localized Metadata in Language Files

How to:

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.



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:


WebFOCUS