İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
746 Görünümler

Hello,

for my users, I want to automate the process of importing a language file, which is otherwise done manually through Settings.

Therefore, I have the following questions:

  • How can I import a translation file using Python code from my custom module?
  • And how can I reload the corresponding language so that the changes take effect
Avatar
Vazgeç
Üretici En İyi Yanıt

Тhank you very much I will test and will give feedback :) 


Edit:


When I tried to implement the code, I got the following error:


 ImportError: cannot import name '_trans_load_data' from 'odoo.tools.translate' (/home/odoo/src/odoo/odoo/tools/translate.py). 


Which version is this code for? I'm testing it on odoo.sh version 18.

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
3
May 25
1514
1
Tem 24
1681
2
Mar 24
1768
1
Oca 24
4650
1
Haz 23
2179