# Translations

## The "Translations" tab

The **Translations**, available in the form editor, allows adding translations for the form, composite components and business components. It is also possible to add keys that override the default form content here (details in the chapter *Platform translation keys*).

This tab also allows adding or modifying validator messages related to components (details in the chapters [*Complex validations*](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/praca-z-komponentami-bazowymi/walidacja-wartosci-komponentow/walidacje-zlozone-wlasne) and [*Script validators*](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/logika-biznesowa/scriptcode/walidatory-skryptowe-validationscript)).

<figure><img src="https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2FNdm8xCvfuhiggW20oCUy%2Fimage.png?alt=media&#x26;token=9697e757-f2e2-4bee-bd43-c374e2f98af2" alt=""><figcaption><p><em><strong>Illustration 1.</strong> Form editor window - "Translations" tab</em></p></figcaption></figure>

***

### Editing a key and value

After selecting a cell in the table you can edit both the key and the translation values for individual languages.

For multi-line values the edit field will automatically expand to show the entire content.

<figure><img src="https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2FizN0EnwaO7q2ck2QNeeH%2Fimage.png?alt=media&#x26;token=e3a8232c-257d-4671-8fd6-f80843e512cd" alt=""><figcaption><p><em><strong>Illustration 2.</strong> Editing translations</em></p></figcaption></figure>

***

### Deleting a key

To delete an entire translation row, click the icon located to the right of the key.

<figure><img src="https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2FNa0PUIfbh1n6tBEzRtwk%2Fimage.png?alt=media&#x26;token=198703e0-a24b-4c12-9303-e534bca6a51e" alt=""><figcaption><p><em><strong>Illustration 3.</strong> Deleting a translation key</em></p></figcaption></figure>

After deleting a key, a notification with an option to undo the operation will appear at the bottom of the screen.

<figure><img src="https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2FOJw6hfM36Bp5OT84xSZm%2Fimage.png?alt=media&#x26;token=5f3df8f4-be13-4100-9960-d29c30f619f1" alt=""><figcaption><p><em><strong>Illustration 4.</strong> Notification with option to undo key deletion</em></p></figcaption></figure>

***

### Adding a key

It is possible to add a translation for any form element that displays text – titles, descriptions, labels, validation messages and content returned by external services.

Keys corresponding to validation error messages are added automatically after a validator is added. The exception is **script validators**, for which the key must be added manually.

To add a new key, use the button **Add key** located above the language columns.4

<figure><img src="https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2FOuMGJBWjpO2hF1HSqfcq%2Fimage.png?alt=media&#x26;token=cdcb9610-f4bc-4a5e-978c-9f5b5b9133a5" alt=""><figcaption><p><em><strong>Illustration 5.</strong> Button used to add a new translation key</em></p></figcaption></figure>

Clicking adds an empty row in which at least the key name (the *KEY*) column must be filled in.\
If the field is left empty, the system will automatically assign the name:

* `empty`
* `empty.copy`
* `empty.copy1`\
  and so on, as needed.

<figure><img src="https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2FjF7prxyi2PIYUR5GglvD%2Fimage.png?alt=media&#x26;token=515153e0-810c-4d82-bd84-af8fb1e1013f" alt=""><figcaption><p><em><strong>Illustration 6.</strong> Row after adding a key and not filling in its name</em></p></figcaption></figure>

***

### Selecting the default language (tag)

The default language can be set in the table header. This option is available only while editing the process.

The default language is **Polish**.

To set a language as default, click the star icon next to the language code. ![](https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2FPeA75FbrHMy8Za2Bxbqt%2Fimage.png?alt=media\&token=29098ee9-35e1-4f73-855f-8eb9ab80b267)\
A yellow star indicates the currently selected default language. ![](https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2FLnTJADB9yogrt9rxIiV5%2Fimage.png?alt=media\&token=0c739e23-83b7-465c-83fe-e23eaadaf96d)

<figure><img src="https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2Fw7E7cye4xOmSvp8WshjF%2Fimage.png?alt=media&#x26;token=55cc9402-b0c0-4ce2-b40f-569058524eac" alt=""><figcaption><p><em><strong>Illustration 7.</strong> Selecting the translation language</em></p></figcaption></figure>

***

### Filtering empty translations

To hide keys without translations, click the icon located in the **KEY**.

An active filter is indicated by a crossed-out “eye” symbol ![](https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2F2175b1xxVkCWXKPxx2me%2Fimage.png?alt=media\&token=5778fb83-3b9f-4372-816f-dd81e3cb7343). Additionally, information about the number of hidden keys is displayed ![](https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2FH0hDfAH1qauorQTTw1zZ%2Fimage.png?alt=media\&token=55d91baf-08e9-4d10-bbfe-c81c2dd3b7dc).&#x20;

***

### Searching translations

The search works both by key names and by translation values.

<figure><img src="https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2FoL5QE8xcOpYRujhLLhZM%2Fimage.png?alt=media&#x26;token=3ebbda3d-f569-4d25-93be-803bc93412f9" alt=""><figcaption><p><em><strong>Illustration 8.</strong> Searching translations</em></p></figcaption></figure>

If no results are found, the following message is displayed:

```
We didn't find a key or translation: ${searchText}
```

At that point the user is also offered the option to add a new key.\
After adding the key, the search field is automatically cleared.

***

### Adding and editing languages

To add a new language, click the button to add a new column located on the right side of the table.

<figure><img src="https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2FWRR1BjGwhIVGxGqptcVw%2Fimage.png?alt=media&#x26;token=6cc9143b-2915-4628-997f-03ed3de2b32c" alt=""><figcaption><p><em><strong>Illustration 9.</strong> Button to add a new translation language</em></p></figcaption></figure>

The name (tag) of the language can be changed by clicking its header.

**Language code** should comply with the **ISO 639**standard, written in lowercase.\
The list of supported codes is available at:\
<https://www.oracle.com/technetwork/java/javase/java8locales-2095355.html>

***

## Determining the language used when opening a form

When a form is opened to be filled in the system determines the language in the following order:

#### 1. The "locale" parameter in the URL

If the incoming address contains the `locale`parameter and the template contains translations for the given language, that language will be used.

**field is sufficient.**

```
https://url.eximee/webforms/ek/index.html?locale=en
```

***

#### 2. Browser accepted languages (Accept-Language)

If the URL parameter is not available and in the Webforms configuration the parameter:

```
server/locale/browserLocaleAllowed = true
```

then the system will take the language from the `Accept-Language`header, provided the template has the appropriate translations.

**field is sufficient.**

```
https://url.eximee/webforms/ek/index.html
Accept-Language: pl-PL,pl;q=0.9,en-US;q=0.8,en;q=0.7,en-gb;q=0.6,fr-FR;q=0.4,fr;q=0.3,es-CO;q=0.2,es;q=0.1
```

***

#### 3. The template's default language

If none of the above conditions are met, the **template default language**, set in Eximee Designer, is applied.
