Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to add a comment in translation .pot file ?

By
Emanuel Cino
on 6/28/16, 6:22 AM 414 views

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"

0

Axel Mendoza

--Axel Mendoza--
10238
| 7 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

Axel Mendoza
On 6/28/16, 7:14 PM

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()

Emanuel Cino
on 6/29/16, 2:10 AM

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

Axel Mendoza
on 7/5/16, 1:05 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 6/28/16, 6:22 AM
Seen: 414 times
Last updated: 6/28/16, 7:14 PM