skip to main content
OpenEdge Development: Translation Manager
Incorporating a Translated Kit into the Project : Compiling the source code with the translated phrases
 
Compiling the source code with the translated phrases
This section describes how to recompile the source code to create new run-time (.r) code to include the translated text phrases from one or more languages. The compiled .r code contains a separate text segment for each language. For example, if you translate an application from English into German, French, and Spanish, the resultant .r code contains four text segments (including the English source).
You must have already consolidated the kits to compile the source code with the translation data.
To compile the source code:
1. From any folder, choose the Compile button or choose BuildCompile. The Compile dialog box appears:
2. Select the languages you want to compile. Press and hold CTRL to select more than one language.
3. If you want to expand the length of the text phrases for the target languages, specify the percentage of the internal text segment growth table you want to use in the Growth Table combo box. For more information on the process the Translation Manager uses for text segment growth, see the “Text segment expansion” section.
4. Choose Options if you want to compile only certain procedures:
5. Choose OK to start the compile.
A status meter appears indicating the Compiler’s progress. When the Compiler is finished, a message appears indicating the time and date the Compiler completed the compilation and prompts you to specify whether you want to view the compile log file:
6. Choose Yes to view the compile log:
See Chapter 11, “Troubleshooting,” for information on the common error messages and warnings you might view in the compile log.
Text segment expansion
This section describes the Translation Manager text segment expansion process.
Text segment growth is the process of expanding source code text segment allocation at compile time so that translations can fit in their text segments without truncation. Text segment growth is important when you translate a compact language, such as English, into other less compact languages. For example, the English word “file” is shorter than the French translation “fichier.”
The purpose of text segment expansion is to avoid truncation of text phrases. Text phrase truncation occurs when the Compiler allocates a given number of characters for a text phrase in the text segment but a translation of the text phrase exceeds that number. The translated text phrase is truncated in the text segment and appears truncated on the screen. To overcome this common difficulty, use text segment expansion to add a number of extra characters to each text phrase.
A drawback to the text expansion process is that additional characters might disturb the layout of the interface.
The best solution is for developers to create source code that specifies maximum-length options for character strings to provide adequate space for truncation. For more information on how to hard code the length of a text string, see the character-string literal section of OpenEdge Development: ABL Reference.
The Translation Manager applies text segment growth to a text phrase only if it has a translation and does not have a hard-coded string-length attribute. If a text string is marked untranslatable (:U), or if it is explicitly set to a maximum length (for example, “hello” R10), the Translation Manager does not apply the text-segment growth expansion factor to that individual text phrase. For more information on the TRIM string attribute, see Chapter 1, “Preparing Your Application for Translation.”
The Translation Manager uses the algorithm in Table 8–1 to set the growth factor. For short strings, the Translation Manager increases strings by 200%, meaning that the new strings are three times as long as the original strings (original + 200%).
 
Table 8–1: Translation Manager internal text expansion 
Length of source text phrase
Text segment expansion factor
Up to 10 characters
200%
11 to 20 characters
100%
21 to 30 characters
80%
31 to 50 characters
60%
51 to 70 characters
40%
Over 70 characters
30%
The Compile dialog box lets you enter a value in the Growth Table field. This value specifies the percentage of the internal table’s growth factor that the Translation Manager uses to expand text strings.
Table 8–2 shows examples of how the Translation Manager determines the length of the target phrase.
 
Table 8–2: Text expansion examples 
Value of growth table field in the compile dialog box
Length of source text phrase
Corresponding internal table expansion factor
Expansion factor Translation Manager uses
Length of target text phrase
0%
7
200%
0% of 200 = 0%
7
100%
5
200%
100% of 200 = 200%
15
50%
10
200%
50% of 200 = 100%
20
150%
50
60%
150% of 60 = 90%
95