Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
367 Vistas

Hi,


Trying to import translations via .csv file of text data in Odoo18 without success.

Using Settings->Translations->Import translation in debug mode.

Managed to read the file without error messages, but unfortunately nothing happens.

Message in log file is limited to 
INFO odoo werkzeug: 192.168.1.19 - - [14/Jul/2025 08:12:14] "GET /web/webclient/translations/6a81be58d8f6a5736c82d879222e37305a2e0221?lang=en_US HTTP/1.1" 200 - 1 0.008 0.011

Trying to load fr_BE records additional to en_US base language.


I would very much appreciate a basic working example of a .csv import. one record should be enough...
For example of the field name in product.template

  • Since Odoo 16, translations shifted from the ir_translation table to JSONB fields in the database. Previously, translations were stored in the ir_translation table with separate records for each language. Now, translatable fields (e.g., name, description) store translations directly in JSONB columns on the model’s table.
    Most of the tutorials are older or focus on translating module text.
    My focus is translating data text in Odoo18.

  • I understand that in the .csv the value of the "src" field has to be exactly the same as the one of the base language in the database and that the easiest way to obtain it is via the export translation. 
    Same for "res_id" and "name" fields in the .csv.

  • I understand also that the .csv has to be comma separated and also UTF8 formatted otherwise it won't work.

  • I have tested with basic text without spaces or special characters. 
    I have also tried enclosed in double quotes or simple quotes.
Actual contents of Product_template, name : 
{"en_US": "Sofa"}

Export Settings
Language? New Language (Empty translation template)
File Format? CSV File
Export Type? Module
Apps To Export? Products & Pricelists

This is (part of) the contents of product.csv exported file :
module,type,name,res_id,src,value,comments
product,model,"product.template,name",product.consu_delivery_01_product_template,Sofa,,

Import translation
Language Name? French_BE
Code? fr_BE
File? myimport.csv
Overwrite Existing Terms? Yes

This is the contents of myimport.csv imported file :
module,lang,res_id,name,type,src,value
product,fr_BE,product.consu_delivery_01_product_template,"product.template,name",field,Sofa,Canap,

Avatar
Descartar
Autor

Hi,

This worked for me. You have to change the language in the user settings (right upper corner). As a net result you should see your interface change to the selected language.

Prepare a file (here it can be XLSX also) with the external IDs (that you can get from a previous export) and the fields that you want translated (other non language dependent fields are welcome of course).
Once the test says everything is fine, you can import. Odoo replies by saying how many records were imported.

Thank you for your help, it helps make shorter days.

Mejor respuesta

Switch the language to French, then import the french names directly via the Products / Product Variants Menu.

Just make sure you use the External ID for the product.template or product.product as applicable.

Your table in this case would be:

"id","name"
"my_product_template.my_id","Canap"


When clicking the translation button next to the Product Name:


You will see both names:


Repeat this process for each additional language

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
dic 20
11705
3
jun 20
3739
1
nov 18
9283
11
feb 17
63531
0
nov 16
3928