Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
825 Lượt xem

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
Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhấ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.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 5 25
1549
1
thg 7 24
1718
2
thg 3 24
1829
1
thg 1 24
4720
1
thg 6 23
2191