Translations of elements defined in the system (Custom messages files) they are used for translations:
- Document classes,
- views,
- reports,
- e-mail notification theme.
Configuration
First, enter the path to the folder where the translations are located. We set this in the system parameters tab (Administration -> System configuration -> System parameters). Where in the General panel, enter the path of the folder with translations (full path to the folder or relative to the server) to the field PATH_TO_CUSTOM_BUNDLE. In this case, this is the full path: / home / customMessages. For Windows, an example path: E://suncode_dev3.1//tomcat7//webapps//PlusWorkflow//bundles//custom//
Translation files
The default file with translations is the customMessages.18n file. For each translation, create a file with an appropriately appended language shortcut (a subpage with a list of supported languages can be found on the main page of the translation instructions: Instruction -Translation). All three files must be on the disk.
Base name | PL | EN |
|
|
|
The sequence of downloading translations from files works on the following principles:
Let's assume that the following translation files are available:
customMessages_en.i18n
customMessages_pl.i18n
customMessages.i18n
If the user's language is English (en), the sequence in which the translations will be downloaded will be as follows:
customMessages_en.i18n
customMessages.i18n
Translations are stored in the form: key = value in files *.i18n.
The key is created on the basis of the name given in the system, eg for a created document class called "Test Document" you create a key by replacing the space in the name with an underscore.
Dokument_Testowy=Dokument Testowy
Dokument_Testowy=Test Document
Key:
When you translate more than one word in the key, add the underscore "_" instead of how it is entered in the space system "" (eg for the document class named "Text Document" set Test_document).
Tłumaczeniom elementów definiowanych w systemie (pliki Custom messages) służą do tłumaczeń:
- klas dokumentów,
- widoków,
- raportów,
- tematu powiadomienia mailowego.
Konfiguracja
W pierwszej kolejności należy wprowadzić ścieżkę do folderu, w którym się znajdują tłumaczenia. Ustawiamy to w zakładce parametrach systemu (Administracja -> Konfiguracja systemu -> Parametry systemu). Gdzie w panelu General (Ogólne) do pola PATH_TO_CUSTOM_BUNDLE wprowadzamy ścieżkę folderu z tłumaczeniami (pełna ścieżka do folderu lub też relatywna do serwera). W tym przypadku jest to pełna ścieżka: /home/customMessages. Dla Windows przykładowa ścieżka to: E://suncode_dev3.1//tomcat7//webapps//PlusWorkflow//bundles//custom//
Pliki tłumaczeń
Domyślnym plikiem z tłumaczeniami jest plik customMessages.18n.Dla poszczególnych tłumaczeń należy utworzyć plik z odpowiednio doklejonym skrótem języka (podstronę z listą wspieranych języków możemy znaleźć na stronie głównej instrukcji tłumaczeń: Instrukcja - Tłumaczenia). Na serwerze w danej lokalizacji muszą znajdować się wszystkie trzy pliki.
Nazwa bazowa | PL | EN |
---|---|---|
customMessages.i18n | customMessages_pl.i18n | customMessages_en.i18n |
Kolejność pobierania tłumaczeń z plików działa na następujących zasadach:
Załóżmy, że dostępne są następujące pliki tłumaczeń:
customMessages_en.i18n
customMessages_pl.i18n
customMessages.i18n
Jeżeli językiem użytkownika jest język angielski (en), to kolejność pobierania tłumaczeń będzie następująca:
customMessages_en.i18n
customMessages.i18n
Tłumaczenia przechowywane są w postaci klucz=wartość w plikach *.i18n.
Klucz tworzymy na podstawie nazwy podanej w systemie, np. dla przykładowo utworzonej klasy dokumentu o nazwie "Dokument Testowy" tworzymy klucz poprzez zamienie w nazwie spacji na podkreślenie.
Dokument_Testowy=Dokument Testowy
Dokument_Testowy=Test Document
Klucz:
Gdy tłumaczymy więcej niż jedno słowo w kluczu dodajemy symbol podkreślenia "_" zamiast jak to jest wprowadzone w systemie spacji " " (np. dla klasy dokumentu o nazwie "Dokument Tekstowy" ustawiamy Dokument_Testowy).