跳至內容
選單
此問題已被標幟
1 回覆
12840 瀏覽次數

Hi, is it possible to add comments in the po files directly from the code ? Suppose I want to give a hint on the translation of a field name, can I do it from the odoo code ?


For instance I have this po generated :

#. module: child_compassion

#: view:compassion.childpool.search:child_compassion.view_compassion_childpool_form

msgid "A filter is active"

msgstr "Un filtre est actif"


Can I change the comments like this for instance ?

#.Field used in the view of Child where the user can select a filter

#: Some more comments...

msgid "A filter is active"

msgstr "Un filtre est actif"

頭像
捨棄
最佳答案

A comment in a .po file is a line that start with ':.' and it's not followed by the 'module' string

You could do it like:

#. Field used in the view of Child where the user can select a filter
#. Some more comments..
頭像
捨棄
作者

yes but is it possible to generate comments from the python code like doing:

#PO: This comment will go in the po file

filter = fields.Char()

The translation engine that extract message translations from python is babel
Here is the explanation of how babel extract comments
http://babel.pocoo.org/en/latest/messages.html#translator-comments

相關帖文 回覆 瀏覽次數 活動
0
12月 24
1304
0
10月 24
702
2
2月 24
2833
4
11月 23
3153
1
8月 22
3567