Multilingual applications

Eric BREHAULT edited this page Sep 21, 2016 · 1 revision

How to build a multilingual Plomino application

If an i18n domain is declared in the database parameters, Plomino translation will be enabled.

When enabled, any text enclosed by __ will be translated according the defined i18n domain.

It will apply to form layout static content:

  • What time is it?

would be rendered as one of:

  • What time is it?
  • ¿qué hora es?
  • Quelle heure est-il ?

(assuming you have an i18n domain containing the msgid "What time is it?" and providing the desired languages)

It will also apply to any computed field output. The result of this formula:

return context.getItem('the_hour')+" __hours__"

would be rendered as one of:

  • 6 hours
  • 6 horas
  • 6 heures

If the text does not match any msgid from the i18n domain, it remains unchanged (but without the enclosing __).

Note: The translation mechanism can be called from a formula using the translate function provided by PlominoUtils, which can be handy in agents or view columns.