Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
3 Răspunsuri
18715 Vizualizări

Hi everybody !

I just created a new module to add fields in my invoice. I already created a .po file to translate my fields and it works perfectly inside OpenERP. But when I print my invoice, the translation doesn't works.

I think I have to create a new folder "report" in addons/mymodule and create new files inside but I really have no idea of which files I have to create and which code to put inside.

Someone could help me ?

Many thanks in advance.

JMB

Imagine profil
Abandonează
Cel mai bun răspuns

In order to translate you need:

  • folder called i18n
  • file module_name.pot within i18n (example: mymodule.pot)
  • file language.po (or languate_country.po) within i18n (example nl.po or nl_BE.po)

For a report, you need lines within the .pot:

#: report:sale.order:0
msgid "Offer"
msgstr ""

within the .po:

#: report:sale.order:0
msgid "Offer"
msgstr "Offerte"

The issues I have run into are:

  • updating the .pot and .po files does not always show on the reports, if these have been stored. So you need to create a new situation and print the report for the first time.
  • When you miss an entry in your .po file, there might be a default entry in the database, and that one will be used, even if you update your .po file.
  • it does matter where you place your :. A text like "the answer:" will not be translated it you store "the answer" or "the answer :" in your .pot and .po files.
Imagine profil
Abandonează
Autor

It works perfectly ! Thanks :)

Cel mai bun răspuns

Follow below steps:

1) Go to

Settings ‣ Translations ‣ Import / Export ‣ Export Translations

leave the language to the default (new language/empty template) # DO NOT CHANGE THIS

select the PO File format

select your module

click Export and download the file

2) Add your translation terms in the downloaded file. i.e. msgstr "" section depending on your translation language

3) change the filename to language_iso_code.po

e.g. for portugese => pt.po

4) create i18n folder under your module and add po file in it.

5) restart Odoo

6) Go to:

Settings ‣ Translations ‣ Load a Translation

select translation language (in my eg. Portugese)

make sure you check this : Overwrite Existing Terms

click LOAD.

DONE

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
dec. 24
488
2
feb. 24
2093
4
nov. 23
2081
1
aug. 22
2917
1
mar. 21
19124