Translation of process maps
Configuration
By default, the base file is located in the folder generated by the client server (~path to the server /plusworkflow/wtpwebapps/server name klienckiegol/bundles/xpdl)
To change the folder in which the translations are located, proceed as follows. You should open the system parameters tab (Administration -> System configuration -> System parameters). Where in the General panel to the PATH_TO_XPDL_BUNDLE field you enter the path of the folder with translations (full path to the folder or relative to the server).
Translation files
The default translation file is the xpdlMessages.i18n file. For individual translations, a file should be created with an appropriately appended language shortcut (a subpage with a list of supported languages can be found on the main page of the translation guide: Instruction - Translation)
Base name | PL | EN |
xpdlMessages.i18n | xpdlMessages_pl.i18n | xpdlMessages_en.i18n |
The sequence of downloading translations from files works on the following principles:
Let's assume that the following translation files are available:
- xpdlMessages_en.i18n
- xpdlMessages_pl.i18n
xpdlMessages.i18n
If the user's language is English (en),
then the system will first try to load the file: xpdlMessages_en.i18n, when
this attempt fails, then the system will try to load the file xpdlMessages.i18n.
Adding translations
Adding a new file with translations:
If you add a new language file, create a new file with the appropriate shortcut in the name as described in the "Translation files" section. Then copy the entire contents of the xpdlMessages file and paste it into a new file. For example, when you want to have language files in our system that support translations in English and German, the catalog containing these files should look like the following.
Adding new translations to an existing file:
Adding new translations to the elements of process maps will be discussed on the example of adding a translation to the description of the process in the vacation application - "Vacation application process"
First of all, in the language file xpdlMessages you search for the text to be translated - "The holiday application process".
PACK(holiday_application)_PROC(application_for_holiday)_DESC= The holiday application process
Translations in xpdl files are saved in the key = value format, to add a translation you need to change the value from the default language to the desired language.
PACK(holiday_application)_PROC(application_for_holiday)_DESC=The holiday application process
After saving the changes to the xpdl file, you must again select the server to receive more information from the system.
Additionaly, in situation of changing the translation of the process name and tasks so that the tasks and processes previously created in the system are also translated, you must add a scheduled task. Correspondingly, the tasks translation update (method - updateActivityLocale) and updating of process translations (method - updateProcessLocale) are used for this task. More information about scheduled tasks can be found in the project manual: Link - Scheduled tasks
Konfiguracja
Domyślnie bazowy plik znajduje się w folderze wygenerowanym przez serwer kliencki (~ścieżka do serwera/plusworkflow/wtpwebapps/nazwa serwera klienckiegol/bundles/xpdl)
Aby zmienić folder, w którym się znajdują tłumaczenia, postępujemy następująco. Otwieramy zakładkę parametry systemu (Administracja -> Konfiguracja systemu -> Parametry systemu). Gdzie w panelu General (Ogólne) do pola PATH_TO_XPDL_BUNDLE wprowadzamy ścieżkę folderu z tłumaczeniami (pełna ścieżka do folderu lub też relatywna do serwera).
Pliki tłumaczeń
Domyślnym plikiem z tłumaczeniami jest plik xpdlMessages.i18n. 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)
Nazwa bazowa | PL | EN |
---|---|---|
xpdlMessages.i18n | xpdlMessages_pl.i18n | xpdlMessages_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ń:
- xpdlMessages_en.i18n
- xpdlMessages_pl.i18n
xpdlMessages.i18n
Jeżeli językiem użytkownika jest język angielski (en), to w pierwszej kolejności system będzie próbował wczytać plik: xpdlMessages_en.i18n, gdy próba to zakończy się niepowodzeniem to następnie system będzie próbował wczytać plik xpdlMessages.i18n.
Dodawanie tłumaczeń
Dodawanie nowego pliku z tłumaczeniami:
W przypadku dodawania nowego pliku językowego tworzymy nowy plik z odpowiednim skrótem w nazwie tak jak to zostało opisanie w punkcie "Pliki tłumaczeń". Następnie kopiujemy całą zawartość pliku xpdlMessages i wklejamy ją do nowego pliku. Dla przykładu, gdy chcemy w naszym systemie mieć pliki językowe wspierające tłumaczenia w języku angielskim i niemieckim. Katalog zawierający te pliki powinen wyglądać tak, jak przedstawiono poniżej.
Dodowanie nowych tłumaczeń do istniejącego pliku:
Dodawanie nowych tłumaczeń do elementów map procesów zostanie omówiony na przykładzie dodania tłumaczenia do opisu procesu we wniosku urlopowym - "Proces składania wniosku urlopowego".
W pierwszej kolejności w pliku językowym xpdlMessages wyszukujemy dany tekst do tłumaczenia - "Proces składania wniosku urlopowego".
PACK(wniosek_urlopowy)_PROC(wnioskowanie_o_urlop)_DESC=Proces składania wniosku urlopowego
Tłumaczenia w plikach xpdl zapisane są w formacie klucz=wartość, aby dodać tłumaczenie należy zmienić wartość z języka domyślnego na język pożądany.
PACK(wniosek_urlopowy)_PROC(wnioskowanie_o_urlop)_DESC=The holiday application process
Po zapisaniu zmian w pliku xpdl, aby wprowadzone zmiany zostały odczytane przez system, należy ponownie uruchomić serwer.
Ponadto w przypadku zmiany tłumaczeń nazwy procesu i zadań, aby w systemie również zostały przetłumaczone zadania i procesy wcześniej utworzone, należy dodać zadanie zaplanowane. Odpowiednio służą do tego zadania aktualizacja tłumaczeń zadań (metoda - updateActivityLocale) i aktualizacja tłumaczeń procesów (metoda - updateProcessLocale). Więcej informacji o zaplanowanych zadaniach można znaleźć w podręczniku projektatna : Link - Zadania zaplanowane