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.

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.

Reference: Activating a Language in the NLS Configuration File

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

LANG = lng

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

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.

Note: You can also create a set of language translation files and include the trans_file attribute at the file level of the Master File. For information on this technique, see Storing Localized Metadata in Language Files.

Syntax: How to Specify Multilingual Metadata in a Master File

FIELDNAME = field, ...
   .
   .
   .
TITLE= default_column_heading, TITLE_ln = column_heading_for_ln,
   .
   .
   .
DESC= default_desc, DESC_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.

Reference: Usage Notes for Multilingual Metadata

  • To generate the correct characters, all languages used must be on the code page specified at server startup. To change the code page, you must stop and restart the server with the new code page.
  • Master Files should be stored using the code page of the server.
  • Multilingual descriptions are supported with all fields described in the Master File, including DEFINE and COMPUTE fields.
  • If you issue a HOLD command with SET HOLDATTR=ON, only one TITLE attribute is propagated to the HOLD Master File. Its value is the column heading that would have appeared on the report output.

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