Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
5033 Представления

I just can't find how to translate the message where you change a record and you click cancel. So how to change the message below?

The record has been modified, your changes will be discarded. Are you sure you want to leave this page ?
Аватар
Отменить
Лучший ответ

Hello Samo Arko,

You can try this .

First Activate  Debug Mode

Go to Setting --> Translation -->Application Terms -->Translated Terms

if your String Not show in this than follow this


Go to Setting --> Translation -->Application Terms --> Synchronize Terms -->Translated Terms

Search as Source Term

The record has been modified, your changes will be discarded. Are you sure you want to leave this page ?

 

After this Put Your Translation in Translation Value with Respect to Your language.

And After Synchronize Translation.

Аватар
Отменить
Автор

I need this in a custom module, that I can install, not to set it from the interface.

ok can also done using import and export

follow this :

Translation --> Import/Export --> Export

Select Language and File format (PO) and your module name and export.

And Create a new folder it's name i18n and put your po file.

for Translation try this

msgid "Customer"

msgstr "顧客"

and update your module and after language Synchronize.

Автор

did as you said, but the message is still in english. My user and odoo instance have the correct language selected. Do I need to add the file to __manifest__.py or any other location? "language Synchronize" you mean the icon of two arrows in a circle?

Автор

It worked, but I had to delete the entry in the translated section. There it was with the same english string in translation value field. Thanks!

Лучший ответ

Hi, you can add this to your .po file:

#. module: web
#. openerp-web
#: code:addons/web/static/src/js/views/form_view.js:753
#, python-format
msgid "The record has been modified, your changes will be discarded. Are you sure you want to leave this page ?"
msgstr "YOUR TRANSLATION HERE"


Then go to Settings => Import translation and fill the fields, select the .po file and don't forget to select 'override existing terms'. Then, hit Import and check your message.

Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
июл. 18
10266
1
окт. 18
5163
0
авг. 22
10842
1
сент. 21
13250
1
мая 18
4698