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.

1

How do I translate arbitrary strings in an i18n file?

By
Luis Masuelli
on 7/21/15, 2:23 PM 427 views

There are some times when I need strings in a report, that do not exist in any other part of the module: model, fields, XML files, module descripcion, .....Since such strings do not exist in the module -but I will only declare and _-wrap them in a mako report- EXPORTING the i18n file from the module to be edited will not work: I will have to add the needed strings by hand in my file:

    msgid "Worked Hours"
    msgstr "Horas Trabajadas"

However, these strings are never translated in my report when I do: _('Worked Hours'), while other strings (which exist in fields or modules) are successfully translated (like _('Start Date')).

How can I mark them to be recognized? I tried this:

    #. module: hr_attendance_analysis
    #: view:hr.attendance:0
    msgid "Worked Hours"
    msgstr "Horas Trabajadas"

But it did not work. How can I make it work?

I have similar problem, does anyone have an idea?

Tarek Mohamed Ibrahim
on 8/5/15, 10:22 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: 7/21/15, 2:23 PM
Seen: 427 times
Last updated: 8/5/15, 10:22 AM