Lime CRM is a multilingual program. To support several languages, the
source code or markup in Lime CRM never contains any translated strings,
instead it contains
keys. These keys are translated into
the language the user running Lime CRM has chosen.
Providing custom translations¶
translations_module makes it possible to add custom
translations to a package or to reuse existing translations in a
To add the
translations to your package, change
directory to your package directory and run the following command:
This is going to create a new folder
lime-project generate translation-module
translationsin package directory, that includes
po-filesfor English and Swedish. Each file will have the following content:
To add an additional language just create a new po-file with the language abbreviation as file name (e.g.
msgid "custom.translation" msgstr "This is the translation"
da.po). To add a new translation, add two new lines to each file. The first line with the
key(msgid), and the second one with the translation (the msgstr) for your translation. After that you only need to restart the webserver and then the translation shall be available in the platform.
Example of a
en.po-file with several translations:
msgid "custom.title" msgstr "My big deal" msgid "custom.responsible" msgstr "sales rep" msgid "custom.comment" msgstr "comment"
- To see all translations go to
- When your package is loaded by the webclient, it checks for translations, registers them and adds your packages lib-name as prefix. So you don't have to worry about overriding existing keys by accident.
- While you define translation keys in your package po-file without a
prefix, keep in mind that you have to use
custom.translationin your code
- The language selection for packages works the same way as for the webclient. If your package doesn't provide a translation for the requested language, the translation key is going to be shown.
Using the translation service in the webclient¶
The platform object injected to a web component in Lime CRM contains a translation service. Out of the box you can use this service to translate any key that exists in Lime CRM.