Important Note: In the upcoming updates, language support will be continuously expanded. In the current version, translations are only supported directly in the elements. Support for the syntax [txt:] will be removed in the future. Custom translations will be retained but can no longer be modified. This chapter contains a description of the language editor, which however cannot yet be used.
The Language Editor is divided into two sections: Configuration and Database. The database contains all translations present in Antcas Control. In the Configuration tab, a new entry can be edited or added. When an element in the table is clicked, the translation editing is displayed. The editor also includes versions that allow creating exports and imports of translations.
A language is always defined together with the territory (usually the country) but can also be linked. For example, German (Germany) is created from German (Switzerland). Custom translations, however, must be defined for each territory. The territory also provides the regional schema, which is currently fixed to the translation.
A translation is always translated from English to the target language. Never from German to another language. This should be strictly observed. In the future, texts can thus be directly translated into Antcas Control using AI. A context should always be used if possible. For long sentences, a variable and text should be defined. A variable in a translation is always case-sensitive. Uppercase and lowercase are always distinguished.
When translating, it must be noted that punctuation marks must always match. If a sentence ends with a period, the translation must also contain a period. The same applies to uppercase and lowercase letters. Words may have been defined multiple times. For example, a word open
A translation can be defined as singular or plural. Since placeholders for replacing text sections can be defined, plural is used when these are used as counters. An existing text cannot be converted from plural to singular and vice versa.
In Antcas Control, this area is called Context but it is also known as Domain. A translation can contain various contexts. An example is the word Open. The word can describe a state opened or also open. Therefore, a context must be defined. A context is always case-sensitive. Uppercase and lowercase are distinguished. It is therefore recommended to always write all contexts in lowercase. If a word has already been defined equally in another context, it can be duplicated. However, the context should always be uniquely defined.
Note: A context should always be defined consistently. Never noun, nouns and Noun simultaneously.
| Context | Description |
|---|---|
| noun | Noun. Generally used for words like Order |
| verb | Verb. For example, Order |
| adj | Adjective. For example, Left |
| menu | The text is defined in a menu. This context occurs frequently in Antcas Control. |
| dialog | Used for messages that involve user interaction. For example, OK |
In texts, placeholders can be used. These are automatically formatted depending on the type. This simplifies using a text as the formatting does not need to be specified in a nested manner. A list of placeholders is provided in the table below. The placeholders are based on the sprintf command, which is also used in the Function Block STR_FORMAT. It should be noted that the order can be defined arbitrarily. However, this should occur without arbitrary order in the original text. For example, the translation is defined as follows:
Singular: One of %2$i Windows is open.
Plural: %i of %i Windows are open.
The placeholder %i is used here. Since only the latter one is used in the singular version, it must be defined with %2$i, which defines index 2. The first index starts with 1.
| Placeholder | Description |
|---|---|
| %s | Simple string. If this placeholder is used, the value will be output one-to-one. |
| %i | Defines an integer number. The number is always rounded to an integer. In addition, formatting is added. 12345.67 |
| %f | Defines a floating-point number. 12345.67 |
| %F | Like %f, but retains a dot as comma and does not set an apostrophe. 12345.67 |
| %z | Output in SI unit. 12345 |
| %Z | Output in bytes (binary conversion with 1'024) 12345 |
A translation can have multiple plural forms, depending on the language. The source language is always specified with singular and plural when these are used. This serves as a fallback if no translation is available. If a plural translation has been defined, it cannot be converted into a singular version and vice versa. Each language in Antcas Control already contains the rules for converting forms.