How to: |
In this example, you will use the LNGPREP file to create language files that you can translate, allowing you to set a parameter to change the language of a procedure on-demand at run-time. This procedure uses the WebFOCUS Reporting Server Console to create the .cfg and .lng configuration files, and WebFOCUS App Studio to create the parameterized report. You will follow the following steps:
The Create Tutorial Framework page opens.
The Select an Option dialog box opens. Click OK.
A number of sample synonyms are created, including ggsales.
The text editor opens in the Web Console.
fre spa por
A table containing language codes can be found in Specify Multilingual DESCRIPTION and TITLE Attributes.
Note: English (eng) does not need to be specified. It is used as the base value for LNGPREP, even if the original file is not in English. If you are localizing a Master File from a foreign language to English, you must use a more specific English code, like uke for British English or ame for American English, to specify an English localization.
The Set Translation Files page opens.
As noted previously, prefixeng.lng is generated automatically and serves as the base translation file containing the column and table names specified in the Master File, even if those names are not in English. You would use the prefixame.lng or prefixuke.lng file as the English translation file.
You are informed that the translation files have been created in the specified folder.
Each translation file matches a number with each title and description in the Master File. The text next to each number must represent the same fields and segments in each translation file for the translations to be correct.
You can translate the values in the translation files for ggsales, as follows:
ggsales_eng.mas (Base Values) |
ggsales_fra.mas |
ggsales_spa.mas |
ggsales_por.mas |
---|---|---|---|
Legacy Metadata Sample: Gotham Grinds - GGSALES |
Exemple Métadonnées héritées: Gotham Grinds - GGSALES |
Ejemplo metadatos heredados: Gotham Grinds - GGSALES |
Exemplo de Metadados de Legado: Gotham Grinds - GGSALES |
Sequence# |
# de séquence |
n.° de secuencia |
Sequência# |
Sequence number in database |
Nombre de séquence dans Base de données |
Número de secuencia en base de datos |
Número de sequência no banco de dados |
Category |
Catégorie |
Categoría |
Categoria |
Product category |
Produit Catégorie |
Categoría de Producto |
Produto Categoria |
Product ID |
ID de produit |
ID de Producto |
ID do produto |
Product Identification code (for sale) |
Code d’identification du produit (en vente) |
Código de identificación del producto (para la venta) |
Código de identificação do produto (para vendas) |
Product |
Produit |
Producto |
Produto |
Product name |
Nom de Produit |
Nombre de Producto |
Nome do produto |
Region |
Région |
Región |
Região |
Region Code |
Code de région |
Código de región |
Código da região |
State |
État |
Estado |
Estado |
City |
Ville |
Ciudad |
Cidade |
Store ID |
ID de magasin |
ID de tienda |
ID da loja |
Store identification code (for sale) |
Code d’identification du magasin (en vente) |
Código de identificación de la tienda (para la venta) |
Código de identificação da loja (para vendas) |
Date |
Date |
Fecha |
Data |
Date of sales report |
Date du rapport de vente |
Fecha del informe de venta |
Relatório de data de vendas |
Unit Sales |
Ventes en unités |
Ventas de unidades |
Vendas por unidade |
Number of units sold |
Nombre d’unités vendues |
Número de unidades vendidas |
Número de unidades vendidas |
Dollar Sales |
Ventes en dollars |
Ventas en dólares |
Vendas em dólares |
Total dollar amount of reported sales |
Montant total des ventes en dollars |
Volumen total de ventas en dólares |
Quantidade total em dólares de vendas relatadas |
Budget Units |
Unités budgétaires |
Unidades presupuestadas |
Unidades de orçamento |
Number of units budgeted |
Nombre d’unités budgétées |
Número de unidades presupuestado |
Número de unidades orçadas |
Budget Dollars |
Budget en dollars |
Presupuesto en dólares |
Orçamento em dólares |
Total sales quota in dollars |
Quota total des ventes en dollars |
Cuota total de ventas en dólares |
Cota total de vendas em dólares |
Once your data has been localized, it is easy to use in a procedure, such as a report.
The Report canvas opens.
These parameters are created as the values for SET commands. You can create a SET command by typing it above the TABLE FILE request in your report.
For more information on SET commands, see the Developing Reporting Applications manual.
Note that all set commands should be kept to one line. Any line breaks in this section are due to size constraints on this page.
LANG sets the language of the report. For more information, see Activate the Use of a Language.
The syntax for creating a single-select static list for LANG is as follows:
SET LANG = '&variable.(<displaylang1,codelang1>,<displaylang2,codelang2>, ... ).Title.'
where:
Is the name of the variable, including the ampersand (&), for which you are supplying a list of values.
Is the display value for the first language that will display in the Responsive Autoprompt drop-down menu.
Is the three-character language code for the first language that will display in the Responsive Autoprompt drop-down menu. This value is also found in the title of the translation file.
Is the display value for the first language that will display in the Responsive Autoprompt drop-down menu.
Is the three-character language code for the first language that will display in the Responsive Autoprompt drop-down menu. This value is also found in the title of the translation file.
The display name and language code values for any other options in the drop-down menu, separated by a comma and wrapped in angle brackets.
Is the title that will display above the drop-down menu.
For this example, you can use the following command:
SET LANG = '&Lang.(<English,eng>,<French,fre>,<Spanish,spa>,<Portuguese,por>) .Language.'
The syntax to create a simple parameter with a single-select list for DATE_ORDER is as follows:
SET DATE_ORDER = '&variable.(DMY,MDY,YMD).Title.'
where:
Is the name of the variable, including the ampersand (&), for which you are supplying a list of values.
Are the available options to use as values for DATE_ORDER. DMY represents day/month/year, MDY represents month/day/year, and YMD represents year/month/day.
Is the title that will display above the drop-down menu.
Note that display values are not being specified. In this case, the possible DATE_ORDER values are displayed literally in the Responsive Autoprompting drop-down menu.
SET DATE_ORDER = '&Date_order.(DMY,MDY,YMD).Date Order.'
The syntax to create a simple parameter with a single-select list for CDN is as follows:
SET CDN = '&variable.(<displayoff,OFF>,<displayon,ON>,<displayspace,SPACE>, <displayquote,QUOTE>,<displayquotep,QUOTEP>).Title.'
where:
Is the name of the variable, including the ampersand (&), for which you are supplying a list of values.
Is the value to display in the menu for when CDN is set to OFF.
Is the default format. Alternatively, COMMAS_DOT serves the same function. Commas are used as thousands separators and a period is used as the decimal point. For example, 123,456.78.
Is the value to display in the menu for when CDN is set to ON.
Turns CDN on. Alternatively, DOTS_COMMA serves the same function. Periods are used as thousands separators and a comma is used as the decimal point. For example, 123.456,78.
Is the value to display in the menu for when CDN is set to SPACE.
Sets CDN to SPACE. Alternatively, SPACES_COMMA serves the same function. Spaces are used as thousands separators and a comma is used as the decimal point. For example, 123 456,78.
Is the value to display in the menu for when CDN is set to QUOTE.
Sets CDN to QUOTE. Alternatively, QUOTES_COMMA serves the same function. Quotes are used as thousands separators and a comma is used as the decimal point. For example, 123'456,78.
Is the value to display in the menu for when CDN is set to QUOTEP.
Sets CDN to QUOTEP. Alternatively, QUOTES_DOT serves the same function. Quotes are used as thousands separators and a period is used as the decimal point. For example, 123'456.78.
Is the title to show above the drop-down menu in Responsive Autoprompt.
For this example, you can use the following command:
SET CDN = '&CDN.(<Off,OFF>,<On,ON>,<Spaces with Comma,SPACE>,<Quotes with Comma,QUOTE>,<Quotes with Dot,QUOTEP>).Decimal Notation.'
SET LANG = '&Lang.(<English,eng>,<Français,fre>,<Español,spa>,<Português,por>).Language.' SET DATE_ORDER = '&Date_order.(DMY,MDY,YMD).Date Order.' SET CDN = '&CDN.(<Off,OFF>,<On,ON>,<Spaces with Comma,SPACE>,<Quotes with Comma,QUOTE>,<Quotes with Dot,QUOTEP>).Decimal Notation.' TABLE FILE nls/GGSALES SUM GGSALES.SALES01.BUDUNITS GGSALES.SALES01.UNITS GGSALES.SALES01.DOLLARS BY GGSALES.SALES01.REGION BY GGSALES.SALES01.ST BY GGSALES.SALES01.CITY ON TABLE SET PAGE-NUM NOLEAD ON TABLE SET ASNAMES ON ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT HTML ON TABLE SET HTMLEMBEDIMG ON ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/warm.sty, $ ENDSTYLE END
You are prompted to select a language, date order, and decimal notation from the Responsive Autoprompt interface.
Select your options and click the run button. The report loads to match your specifications, as shown in the following image.
WebFOCUS | |
Feedback |