Customize translation text
This procedure shows you how custom translation text is provided in a locale file and referenced in the HTML code in the widget template file.
About this task
The Genero Browser Client (GBC) front-end provides support for language selection based on locale. To support multiple languages, the GBC instructs the DVM at runtime to transcode the application user interface (AUI) tree from the local Genero BDL encoding used in sources to UTF-8 automatically. Thus the GBC is able to display correctly any characters used by Genero BDL. For more details, see Localization in the Genero Business Development Language User Guide.
You can use translation texts to provide localization mainly in the following GBC front-end components:
- Welcome Page
- Ending Page
- Calendar Widget
- Contextual Menu For Tables
- File Transfer Dialog
You will find the locale files in gbc-project-dir/src/locales/xx-YY.json, where xx-YY follows the standard localization code used for languages, for example, en-US, de-DE, fr-FR.
Locale files are json files which have a typical json structure of keys and values in
double quotes separated by colons, ":"
. Translation key-value pairs
are separated by commas. A sample from the US English locale file is shown.
// in en-US.json
{
"gwc": {
"lngName" : "English",
"app": {
"waiting": "Waiting for connection",
"restart": "Restart the same application",
"run": "Run"
}
}
}