Previous Topic: Add a Dialog to Query the Installation Path of the PIF Product MERCHANTNext Topic: Localize the Installation Dialogs for the PIF Product MERCHANT


Add Language-specific Product Files to the PIF Product MERCHANT

The PIF product MERCHANT prints localized messages in English and German. Therefore, the text files merchant.enu and merchant.deu are added to the product.

These text files are added to language-specific components. A language-specific component is installed only if the language specified in the component matches the target system locale ($LANG). In the language-specific component the language is specified through a property of the keyword #locale, in this example, ENU and DEU.

The following section in the prototype file specifies the language-specific component that contains the English text file:

@COMPONENT:
#chead: lang_spec ;
#locale: ENU ;
#file: bin/merchant.enu , /myhomepath/src/merchant.enu , root , sys , -r--r--r-- , 1 ;
@ENDCOMP:

The component’s name is lang_spec and it contains the merchant.enu text file. This component is installed if the target system locale has a value representing the English language (like en_US).

The following section in the prototype file specifies the language-specific component that contains the German text file:

@COMPONENT:
#chead: lang_spec ;
#locale: DEU ;
#file: bin/merchant.deu , /myhomepath/src/merchant.deu , root , sys , -r--r--r-- , 1 ;
@ENDCOMP:

The component has the same name lang_spec as the English version, but differs by the property of the #locale keyword. This component contains the merchant.deu text file, and is installed if the target system locale has a value representing the German language.

Language-specific resources can be provided as external product enhancements. Initially, the product is built with its origin text resources. Later on, the language-specific text resources can be extracted from the product using the pifextract command, as follows:

pifextract -f MERCHANT.Any.@pif -l ENU -L DEU -d german_folder

This command extracts all language-specific components into the folder german_folder, and then prepares and creates an applicable prototype file. After replacing the text resource files and adapting the applicable #file entries in the prototype file, the external PIF product can be built with the pifmk command. As a result, the PIF file MERCHANT.@deu is created.

This PIF file must be copied to the folder of the main PIF product.