You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 32 Next »

Role required: admin.

Choice list translation


To localize a choice list, please complete the steps below:

  1. Navigate to System Definition → Choice Options.
  2. Click New and fill in the fields.
  3. Click Save or Save and Exit to apply changes.

Translated choice option form fields

FieldMandatoryDescription
TableY

Specify the table to which this choice option is related to.

Select the same table for the translated version as for the original one.

ColumnY

Specify the column to which this choice option is related to.

Select the same column for the translated version as for the original one.

TitleYType the translation of the source field there.
LanguageYIn there, specify the two-symbol name of the language (ru, en, and so on). Generally, references to languages are stored in the Languages (sys_language) table.
ValueYType the same value as specified for the source field.
OrderYEnter the number to define the option order in the choice list.
HintNText hint. This field is not mandatory.

Repeat this step for others choice options.

If some of the choice options were not fully localized (for example, choice option English values were added but non-English values were not added, then in user locale other than English, choice lists containing untranslated options will display English values by default, regardless of the current user locale.

Otherwise, a localized choice option is displayed, regardless of the current user locale.

To avoid such situations, please be careful when adding option values to your choice lists.

Localizing other interface elements


Please check before started that all necessary languages are created in the Languages (sys_language) table.

To localize any field of the Translated Text type (except for the choice list option, the translation of which is described above, or special interface elements like flash messages or Condition Operators), please complete the steps below:

  1. Navigate to System Localization → System Translations.
  2. Click New and fill in the fields.
  3. Click Save or Save and Exit to apply changes.

Another way to add localization via System Translations table is the following:

  1. Open the record you want to translate.
  2. Scroll down to the Related Lists area, choose the Translations tab.
  3. Click New and fill in the fields.
  4. Click Save or Save and Exit to apply changes.

In this case, the Record field (ID) is populated automatically.

Translated text form fields

FieldMandatoryDescription
ColumnYIn this reference field, specify the column containing the field being translating.
LanguageYSpecify the language of the translation. The fields references to the records stored in the Languages (sys_language) table.
ValueYType the translation of the source field there.
RecordYType the ID of the record which should be translated.

You can also localize elements while creating or editing them:

  1. Open the record you need to translate.
  2. In the Settings menu, change the language of the system to the one you need.
  3. Enter a new value for the field you need to translate.
  4. Click Save or Save and Exit to apply changes.

To check if the translation is saved correctly, scroll down to the Related Lists area, and choose the Translations tab.

Localizing static interface elements


To localize static interface elements, such as welcome messages, informational or warning messages, some other kinds of messages, there are two tables implemented containing source messages and their translations.

  • the Source Messages (source_message) table – this table contains original messages in English.
  • the Messages (message) table – this table contains localized messages in the user's languages (Russian, Hindi, etc).

source_message


Field

Type

Description

idBig IntegerThe ID of the message.
categoryStringThe category of the message (for example, app).
messageTextThe text of the message.

message


Field

Type

Description

idReferenceReference to the Source Messages (source_message) table.
languageStringTwo-symbol name of the language (ru, en, etc).
translationTextThe translated message.

These two tables are bound by ID. It means that every message in the Source Messages (source_message) table has a unique ID, and its translated version in the Messages (message) table has the same ID.

For example, the "Login" record in the Source Messages (source_message) table has ID 15596431050000002. Moreover, the "Логин" record has the following prerequisites in the Messages (message) table:

ID15596431050000002
languageru

So, if you want to add some new records, you have to add them to both tables as well, in compliance with IDs order and in all the languages you need.

To do this, please complete the steps below:

  1. Navigate to System Localization → Messages.
  2. Click New and fill in the fields, and click Save.
  3. Click Save or Save and Exit to apply changes.

Please keep in mind that the IDs of the original message in the Source Messages (source_message) table and the localized message in the Messages (message) table must be the same to prevent malfunction.

Also, the language field must be populated, as well.


Please do not change original messages in the Source Messages (source_message) table, it can cause malfunction on the instance. If you need to make changes in any source message, create a copy of it in the Messages (message) table with the desired text and fill in the Language field with the 'en' value.

Localization API


In SimpleOne, we have the SimpleMessage API class with the getMessage() message in it, which is taking in an original message from the Source Message (source_message) table and returns a message in the user's language that is set as default in the system. To learn more, please refer to the SimpleMessage article.

Also, you can use the s_i18n client-side class that intended to work with translated messages. It has two methods: getMessage() and getMessages(), that allow to get one or many messages in user language, respectively. For more information, please refer to our API reference containing information about this class.


  • No labels