Hi,
Some translations to my native language are not relevant for my project, so I would like to override these default translations with my own .po/.mo files. I found a similar question here How to translate a theme? which did not help.
Could someone point me to the right direction please?
You can
- download the .po file of your language from \application\language\
- correct the translations
- compile the .po file to a .mo file using this site https://po2mo.net/
- upload back to \application\language\
If something with my explanation is still not clear, just ask.
Hanan Cohen
Thanks Hanan, that’s what I had done before posting. Unfortunately, the translations remain unchanged… Is there a cache or something I am missing?
I didn’t experience problems with seeing changes after uploading the .mo file. If you want, you can email me the .po file and write me what strings you are having problems with and I will try to take a look. Maybe I will see something that you didn’t see or didn’t look for. I am hanan.cohen at gmail
Hi Hanan,
I investigated further but I’m still puzzled… I’d like for example to replace the French translation of the term item from contenu - which is the translation of the word content - to élément.
So I opened the fr.po file, replaced all occurences of the term contenu as well as its plural and capitalized variations with the expected ones, then built the fr.mo file and uploaded both files to the /application/language folder.
As a result, calling $translate('items') still outputs contenus while calling $translate('Items') correctly outputs Éléments.
After scanning the entire fr.po file, I noticed that the string “Items” has an occurence:
msgid "Items"
msgstr "Éléments"
while string “items” does not appear in the file.
Even if I add something like
msgid "items"
msgstr "éléments"
the translation still outputs contenus.
hmmm.
If I understand correctly, the string contenus is still “hiding” somewhere. I would search for it in all of the .po files of ALL languages and in ALL of the theme files.
Either download them to your computer and do the string search or if you have command line access to the server, do it there.
Hanan