I have two questions on language and translation issues and would be grateful for some hints:
How can I get the date format string for the current language within a module and within a proteus script stored in the the database table “ir_lang” (field “date”)?
Can I store translatations in the locale/*.po files for items, which are not connected to fields, buttons, views and so on? I want to store translations for two terms (English “Order”, “Delivery” and German “Bestellung”, “Lieferung”) and access them from module and proteus script to use them in a string, which will be added to invoice.lines as a comment.
The locale content should only contain file that were generated by the translation wizards.
You can create record in ir.message and get there translated version using trytond.i18n.gettext.
proteus script does not provide any API for that because its goal is to behave like a client. So if you can not do it in the UI client, you can not with proteus.
But maybe instead of using proteus script, you should write script for trytond-console.
Here is my implentation for creating and translating the two terms (English “Order”, “Delivery” and German “Bestellung”, “Lieferung”), for everyone who has the same issue.
Assume the module name is sort_invoice. The xml file sort_invoice.xml is the place to create the records for ir.message:
Pay attention to the Parameter of gettext. The documentation of trytond.i18n.gettext is a bit unprecise. The message_id of the xml file has to be supplemented by the module name in front.