Concrete5-8.x: Where do I add translation files for packages or blocks?

194 Views Asked by At

If I create my own .mo files for packages or blocks, where do I add the .mo files? Do they go in /application/languages/en_GB/LC_MESSAGES/block_handle.mo?

2

There are 2 best solutions below

2
1stthomas On

For package translations you have to put the files into <your_package>/languages/en_GB/LC_MESSAGES/messages.mo (the file name has to be exactly as my example)

Application files are under: application/languages/en_GB/LC_MESSAGES/messages.mo. But there you can not add a block specific translation. In the application folder are the core translations. What you can do, is to use the c5 internal translation interface, which will create an additional file under application/languages/site/en_GB.mo. But to use this interface you have to create the site folder first. You can find the c5 internal tranlsation interface on <example.com>/dashboard/system/multilingual/translate_interface.

0
biplob On

Just run

PATH-TO-CONCRETE5-ROOT-FOLDER/concrete/bin/concrete5 c5:package-translate PACKAGE_HANDLE OPTIONS

For more, visit https://documentation.concrete5.org/developers/concepts/localization