Overview

As a feature of ProcessMaker version 3.0, the Dynaforms created inside the designer have multi-language support. Now, designers have the ability to download a .po file with the labels used inside the Dynaform and make the corresponding translation to any language. The translation can be used later inside the same form without having to create a new form for each language.

This option is at the top of the Dynaform designer, in the right-hand corner of the window.

Read the following sections to learn how to use Dynaform translations.

Downloading the Translation File of the Dynaform

Every time a Dynaform is created, the designer generates a .po file that contains the labels of the controls included in the Dynaform, as well as some other labels used in the properties of the controls, such as placeholders, hints and default values.

To download the .po file of the Dynaform, click on the icon in the Dynaform menu and the following modal window will open:

As mentioned before, all Dynaforms are created with English as the default language, so simply click on the name of the language (for English, the name of the file is "English [processmaker.en.po]") and the file will be downloaded automatically.

A .po file have the following characteristics:

"Project-Id-Version: PM 4.0.1\n" "POT-Creation-Date: \n" "PO-Revision-Date: 2010-12-02 11:44+0100 \n" "Last-Translator: Colosa\n" "Language-Team: Colosa Developers Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer_Encoding: 8bit\n" "X-Poedit-Language: English\n" "X-Poedit-Country: United States\n" "X-Poedit-SourceCharset: utf-8\n" "Content-Transfer-Encoding: 8bit\n" "File-Name: processmaker.en.po\n" msgid "ID_OF_THE_CONTROL" msgstr "LABEL_OF_THE_CONTROL_OR_PROPERTY" ...

The first section contains the following information about the translation file:

  • Project-Id-Version
  • POT-Creation-Date
  • PO-Revision-Date
  • Last-Translator
  • Language-Team
  • MIME-Version
  • Content-Type
  • Content-Transfer_Encoding
  • X-Poedit-Language
  • X-Poedit-Country
  • X-Poedit-SourceCharset
  • Content-Transfer-Encoding
  • File-Name

The next section lists the ID of the control in the msgid attribute and the label or text of the property in the msgstr attribute. Read the next section to learn how to make a translation file in another language.

Translating and Creating a .po File

The following Dynaform will be used in this example to demonstrate how to create a new translation file.

The controls used in this Dynaform are the following:

  • "Employee Information" -> Title
  • "Fill the information below" -> Subtitle
  • "Employee ID" -> Text Control
  • "Employee Name" -> Text Control
  • "Employee Last Name" -> Text Control
  • "Employee Birth Date" -> Datetime Control
  • "Employee Home Address" -> Textarea Control
  • "Employee Submit" -> Text Control

The .po file connected to the Dynaform above is the following:

msgid "" msgstr "" "Project-Id-Version: PM 4.0.1\n" "POT-Creation-Date: \n" "PO-Revision-Date: 2010-12-02 11:44+0100 \n" "Last-Translator: Colosa\n" "Language-Team: Colosa Developers Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer_Encoding: 8bit\n" "X-Poedit-Language: English\n" "X-Poedit-Country: United States\n" "X-Poedit-SourceCharset: utf-8\n" "Content-Transfer-Encoding: 8bit\n" "File-Name: processmaker.en.po\n" msgid "Employee Information" msgstr "Employee Information" msgid "Fill the information below" msgstr "Fill the information below" msgid "Employee ID" msgstr "Employee ID" msgid "Enter the employee ID" msgstr "Enter the employee ID" msgid "" msgstr "" msgid "" msgstr "" msgid "Employee Name" msgstr "Employee Name" msgid "Enter the employee name" msgstr "Enter the employee name" msgid "" msgstr "" msgid "" msgstr "" msgid "Employee Last Name" msgstr "Employee Last Name" msgid "Enter the employee last name" msgstr "Enter the employee last name" msgid "" msgstr "" msgid "" msgstr "" msgid "Employee Birth Date" msgstr "Employee Birth Date" msgid "Enter the employee birth date" msgstr "Enter the employee birth date" msgid "" msgstr "" msgid "Employee Home Address" msgstr "Employee Home Address" msgid "Enter the employee home address" msgstr "Enter the employee home address" msgid "" msgstr "" msgid "" msgstr "" msgid "Submit" msgstr "Submit"

The translations that are empty ("") are the labels of control properties that have not been set.

Before creating a new translation file, take into account the following points:

  • The name of the new .po file must have the following format:
    processmaker.<LANGUAGE>.po
    Where <LANGUAGE> is the two letter 639-1 ISO language code.
    In this example the new file will be named: processmaker.es.po.
  • The translation of the label must be made only in the msgstr attribute. Do not change the msgid label because it is the ID that relates the translation file to the label of the control or property in the Dynaform.
  • In the header of the new file, the following attributes must be updated with information about the new language:
    • X-Poedit-Language
    • X-Poedit-Country
    • File-Name

The new translation file can be created using a plain text editor or any advanced editing tool, such as PoEdit.

Using a Plain Text Editor

The .po file can be translated manually using any plain text editor, such as Notepad++ or UltraEdit for Windows and vim or gedit for Linux.

Open the .po file in your favorite editor (in this example, gedit was used) and translate all the msgstr strings. Do not forget to update the following properties to the new language.

  • "X-Poedit-Language: Español\n"
  • "X-Poedit-Language: Español\n"
  • "File-Name processmaker.es.po\n"

The new translation file will look like:

msgid "" msgstr "" "Project-Id-Version: PM 4.0.1\n" "POT-Creation-Date: \n" "PO-Revision-Date: 2010-12-02 11:44+0100 \n" "Last-Translator: ProcessMaker\n" "Language-Team: ProcessMaker Developers Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer_Encoding: 8bit\n" "X-Poedit-Language: Español\n" "X-Poedit-Country: España\n" "X-Poedit-SourceCharset: utf-8\n" "Content-Transfer-Encoding: 8bit\n" "File-Name: processmaker.es.po\n" msgid "Employee Information" msgstr "Información del Empleado" msgid "Fill the information below" msgstr "Complete la información a continuación" msgid "Employee ID" msgstr "ID del Empleado" msgid "Enter the employee ID" msgstr "Ingrese el ID del empleado" msgid "" msgstr "" msgid "" msgstr "" msgid "Employee Name" msgstr "Nombre del Empleado" msgid "Enter the employee name" msgstr "Ingrese el nombre del empleado" msgid "" msgstr "" msgid "" msgstr "" msgid "Employee Last Name" msgstr "Apellido del Empleado" msgid "Enter the employee last name" msgstr "Ingrese el apellido del empleado" msgid "" msgstr "" msgid "" msgstr "" msgid "Employee Birth Date" msgstr "Fecha de Nacimiento del Empleado" msgid "Enter the employee last name" msgstr "Ingrese la fecha de nacimiento" msgid "" msgstr "" msgid "Employee Home Address" msgstr "Dirección del Domicilio del Empleado" msgid "Enter the employee home address" msgstr "Ingrese la dirección del domicilio del empleado" msgid "" msgstr "" msgid "" msgstr "" msgid "Submit" msgstr "Enviar"

When translating the file, take care NOT to change the msgid strings. Each msgid string is the ID of a label that relates the translation file to the label of the control or property in the Dynaform.

Also, make sure that each msgstr is enclosed in double quotes. To use a double quotation mark within a string, precede it with a backslash "\" .

Using Poedit

Poedit is an easy-to.use open source translation editor available for Mac OS X, Windows and UNIX/Linux.

Install Poedit and click the Edit a translation option to open the "processmaker.en.po" file that was downloaded before.

In the window that will appear, click on the Fix Language button in the header that appears to change the language of the translation.

Or by going to Catalog > Properties:

The Catalog properties window will open. Change the language from English to the target language (in this example, the language is changed to Spanish), add your name in the Team field and your email address in the Team's email address so people can contact you with revisions and updates about the translation. Finally, set the Charset and Source code charset to UTF-8. Click on OK to save the changes.

Poedit will display the list of labels in the translation file ready to be translated in the top box of the window.

Select a phrase, then the Source textbox will display the original English phrase and the Translation box will display its translation. Translate the phrase in the Translation box from English to the target language.

For each line, the user can see translation suggestions in the sidebar of the window. If this sidebar is not displayed by default, go to View > Show Sidebar.

When translating, ignore any text inside square brackets. For example, do not translate any of the text in "[JAVASCRIPT/CANCEL]".

If you are unsure how to translate a phrase, it is better to leave it blank rather than use a wrong translation. Another option is to do a preliminary translation of a phrase, but indicate that the phrase needs to be reviewed in the future by clicking the Fuzzy icon in the toolbar. The text will be yellow, indicating to the next translator that the translation of that line needs to be reviewed.

Once done, save the new translation file as:

processmaker.<LANGUAGE>.po

Where <LANGUAGE> is the two letter 639-1 ISO language code. The language code for the Spanish language is es, therefore the new file will be named "processmaker.es.po".

Uploading the Translation

To upload the translation file to the Dynaform, click on the icon in the menu of the Dynaform. In the Languages window click on the Choose File button to upload the .po file.

The new translation file will be uploaded to the Dynaform and listed in the panel, as shown in the image below:

To remove the translation file from the Dynaform, click on the Delete button at the right side of the name of the file.

Reviewing the Dynaform Language

The newly translated labels can be reviewed by changing the Language property of the Dynaform control.

Then, go to the preview mode of the Dynaform by clicking the Preview button

Changing the Dynaform Language in the URL

The current system language (which is specified in the URL) is automatically selected when loading the Dynaform if there is a .po file available for that language. Otherwise, the Dynaform displays the field labels in the original design of the Dynaform.

Therefore, if the user logs into ProcessMaker with the English language, the Dynaform will be displayed using the English translation file.

If the user switches the language to Spanish, the Dynaform will select the Spanish translation file automatically and all its labels will be translated.

It is not necessary to log out and log in again just to change the language of the ProcessMaker interface. At any time, the user can simply edit the language code in the URL. To do so, go to the web browser's navigation bar and edit the URL. Then, refresh the web browser screen by pressing ENTER in the navigation bar, or pressing CTRL+R to display the new language in the Dynaform.