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

hello guys, im using odoo 13 and i have these new warning messages:

and three of them on new custom module, when i change language of the user it did'nt translated automatically, how to do it? thanks

raise ValidationError(_("You can't insert image with height or width more than 500 (500 x 500).\nHeight: %s \nWidth: %s" % (height, width)))
raise ValidationError(_("You can't insert image with size more than 250 KB.\nSize: %s" % (image_size)))
raise UserError(_('You must include a Product Image to be able to save this data..'))
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

You will have to add the translation for these error messages. For this, you need to export the translation as shown in the screenshot.

Go to the "Settings / Translations / Export Translations"


Now, download the po file, add your translation in the file and import the file again.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello

I have the same issue but unfortunnatly when I export the PO file python text are not exported.

Is there a solution?


Thanks

Ảnh đại diện
Huỷ bỏ

Not every string from the code is exported automatically and needs to be wrapped, to be exported.
For UserError I do it like this:
raise UserError("This is an error!") => will not be exported
raise UserError(_("This is an error!")) => will be exported

Here is some Odoo documentation about the topic:
https://www.odoo.com/documentation/14.0/developer/misc/i18n/translations.html

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 11 18
12188
3
thg 3 19
3838
0
thg 11 16
318
0
thg 7 25
296
0
thg 6 21
6337