OpenWGA 7.6 - OpenWGA Concepts and Features

Design and development » WebTML » Features » Labels

Label definition

Labels are defined in simple text files which are stored inside file container folders of your WebTML design. See the following files structure located inside a designs "files" directory:

As you can see there are multiple files suffixed ".properties" which contain the actual label definitions. They are stored inside label containers, which are file container folders of name "labels_" plus a language code. As might be expected every label container contains the label of one language.  Use the language codes which you also use for your language definitions on your OpenWGA content store.

The contents of each file contains a simple plaintext syntax where every row represents a single label. Imagine this contents of file "labels_en/general.properties":

user=User

toc=Table of contents
tocLink=Display table of contents

Each row starts with the label key, followed by an equal sign. What follows the equal sign is the text of that label in the current language. So this label file defines three labels.

The file "labels_de/general.properties" contains the same label keys, but with the german translations of the label text:

user=Benutzer

toc=Inhaltsverzeichnis

tocLink=Inhaltsverzeichnis anzeigen

As you can see in the directory structure above there may be multiple label files per label folder. The file "general.properties" is the default file which will be used on retrieval when no special file is addressed. All other files, like "webtmlref.properties" above, will need to be adresses explicitly when its labels are retrieved.

The format of label files is actually the standard format for "Java properties files". A special restriction of this is that they ALWAYS must use text encoding "ISO-8859-1". Characters that are not contained in this charset are specified in the notation "\uXXXX" (so called "unicode escapes") where XXXX is the hexadecimal character code in the Unicode charset.

The command linke tool "native2ascii" that is contained in each Java Development Kit can be used to convert properties files from any encoding to ISO-8859-1. See the javadocs about object "java.util.Properties" for details.

For every language there should be the same label files in each label container which also should contain the same label keys.