Help

2

Why are some translations ignored

Avatar
Prowler

We want to translate Odoo to Slovenian. The problem is that strings sometimes just don't get translated like for example Create and Import buttons


I even tried this procedure and it doesn't help.

1) Stop odoo

2) Update all po files

3) DELETE FROM ir_translation WHERE lang = 'sl_SI'

4) ./odoo.py --stop-after-init --load-language=sl_SI -c odoo.conf)

5) Start odoo


We have all translations in one .po file. Could that be a problem? Also is it possible to import this .po file from command line and not on the web based form?

Avatar
Discard
1 Answer
0
Avatar
Temur
Best Answer


Please skip database manipulation (i.e. step 3). After the 4th step, You can simply do:


./odoo.py --stop-after-init  --language=sl_SI  --i18n-overwrite --i18n-import=your_translation_file.po
11 Comments
Avatar
Discard
Avatar
Prowler
-

Hm... I'm getting some strange python error: http://pastebin.com/AKFyd6NH

Avatar
Temur
-

Running as user 'root' is a security risk. -this error is not related to this command directly, but you should not run odoo with root, that's a point. If you'r odoo user is named as odoo, then ad at the begginning of the above command: sudo -u odoo

Avatar
Prowler
-

Thanks. I've been wondering if "su - odoo" is the correct way. Apparently not. This might also be related to my problem as the output is a little different now: http://pastebin.com/25MCLGvD

Avatar
Temur
-

yes, "su - odoo" is a correct way, but as I see in your output at http://pastebin.com/AKFyd6NH , this command did not worked in your case, because at the second line, command prompt is still "root@odooserver:/opt/odoo# ", it should be changed to "odoo@odooserver:/opt/odoo$ " if you configured odoo system user properly. Have you set up a system user odoo? maybe you're using different user for running odoo? if it's a case, then use the user you're running your odoo server with.

Avatar
Temur
-

the last error you got is because of wrong data directory, it seems your instance had trouble to identify correct data directory path, or you choose wrong user to run odoo. you can add one more config, to command line or in the config file, that is a data directory path: data_dir = /path/to/filestore , and you can add -c /path/to/config/odoo.conf to command line than.

Avatar
Prowler
-

Awesome! I think it worked using the -c parameter. Now let's wait if the translations will be properly loaded. I'll report shortly.

Avatar
Prowler
-

Nope. The translations still don't work correctly. I still see the 'Create' button.

Avatar
Temur
-

it seems you have not translated the "Create" string for that button. Now, as you imported all your translations, you can export strings to translate from your odoo instance to the .po file. You'll see in that po file what strings are leaved untranslated. I guess that "Create" string will be there as well, between untranslated terms. You can use --i18n-export=/fiel/to/exprot/translations.py instead of --i18n-import, in case of export operation

Avatar
Prowler
-

Thanks for your tips. I finally learned to do this stuff from cli. I have exported the file but I can't find one not-translated "Create" string.. :(

Avatar
Temur
-

you can directly open PO file in any text editor and search for the "Create" string and try to find out if it comes with it's translation or not... Also, consider to use some special software, designed to work with PO files and for translating terms in it. I can't recommend you any particular one, but you should easily find some good options on the web

Avatar
Prowler
-

Now the "Create" buttons magically turned to "Ustvari" without my interference. This particular translation just started working by itself. It happened during the weekend, when nobody was touching the code nor web interface. Of course this didn't solve my issue of ignored translations. Even worse: Now I see this behaviour is actually random. :(