Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Report translation with Mako

Subscriure's

Get notified when there's activity on this post

This question has been flagged
reportingtranslationwebkitmako
2 Respostes
9621 Vistes
Avatar
Max

How do you translate phrases from within a mako report? I have changed the target language with <% setLang(o.partner_id.lang) %> and tried using ${_()}, however only the original term is rendered, despite the fact that translations exist for the same string, for different fields, and no "untranslated" record is saved in the translations section...

Any idea ?

3
Avatar
Descartar
Avatar
Yannick Payot
Best Answer

You might need to set the language first if you didn't.

For exemple in invoice_webkit module in account_invoice.mako we take the invoice partner language.

%for inv in objects:
<% setLang(inv.partner_id.lang) %>

And then you use the ${_("my text")} format.

For your translations, I'm not sure OpenERP add automatically those in the database when synchronizing it.

If you make them in a .po file, it should look like this:

#. module: invoice_webkit
#: report:addons/invoice_webkit/report/account_invoice.mako:129
msgid "PRO-FORMA"
msgstr "PRO-FORMA"

Otherwise, you might have to add them by hand in the translations.

  • Source: PRO-FORMA
  • Translation Value: PRO-FORMA
  • Translated field: addons/invoice_webkit/report/account_invoice.mako
  • Language: French
  • Type: Report / Template
5
Avatar
Descartar
Max
Autor

Hi, thanks for your reply. I should have said that I have already done this (I have updated my answer with this information)

Yannick Payot

As your translations might not having been added by the synchronise translation wizard, as it certainly ignores ".mako" files I added some more info. Have you that kind of translation in your database or only for fields?

Max
Autor

Thanks again for the information. Unfortunately I am doing this on the SaaS, therefore there is no mako file path - I am saving the mako code directly in the report_webkit_mako text field. In this case, what do I put in the "Translated Field" field? Also, I assume Language is the target language, as it is assumed everything has its source as english?

Yannick Payot

Yes the Language is the target language, what is in source is always in english.

Max
Autor

Thanks, and what goes in the "Translated Field" field when using the report_webkit_mako field instead of a file path?

Yannick Payot

On SaaS, okay, try to add the translation by hand but then instead of path in Translated Field try to set the id of the report.

Max
Autor

So to sum up, the problem was fixed by manually creating a Translation Term with Type = 'Report/Template', Field Name = 'model_name', Resource_ID = ''. Thanks very much for your help

Franco Tampieri

Hi Yannick, I noticed that in some cases the translated terms of a webkit report and included in the file "po" in the application i18n are not reported in the press, but are either replaced with a generic term related to the object or are not translated. If I go to check out the lines of the translation, however, are present, what would it be?

Yannick Payot

Hello User 12396 :)

I'm not sure to understand your question. Could you give me an exemple of an existing line that has a translation line and not being present in po file ?

Franco Tampieri

I'm sorry, maybe I did not explain properly, but I often report on webkit that replace the standard reports such as the sale_order or account_invoice, where po when I export the file and translate terms such as 'VAT' then reloading the translation and do the update of the module and the translation I is again the old translation of the label, in order to get my maybe I should change the label 'VAT' in 'VAT' and after repeating the whole process this work. What could it be? But if you know a better way to make tranlation files please explain to me. Best Regards Franco

Yannick Payot

This seems to be a different issue than the one in this question. It can be a bug that you should report on launchpad or you could also open a new question there you will have enough place to explain step by step what the problem is. Here is a question about how to generate po file it might help.

Franco Tampieri

Thank you Yannik, I take a look at your link

Avatar
Katherine Zaoral
Best Answer

HI Max , Indeed the approach of configuration is the one given in the Yannick Vaucher answer the recall now is how to generate the .po with the terms in the mako file.

Making this by hand is too tedious. To generate the .po file yo can use xgettext command like the example given in https://www.odoo.com/forum/help-1/question/how-to-export-translation-strings-from-mako-templates-61575.

After generate the po you can merge this terms with the .pot of your module to complete them.

I hope It helps.
Regards

0
Avatar
Descartar
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
Images in webkit / mako pdf reports Solved
webkit mako
Avatar
Avatar
Avatar
Avatar
4
de set. 16
9090
How to display page numbers in webkit reports?
reporting webkit
Avatar
Avatar
Avatar
Avatar
Avatar
4
de març 15
11189
How do I limit an iteration in Mako?
webkit mako
Avatar
Avatar
1
de març 15
5891
Webkit header/footer translation
translation webkit
Avatar
0
de març 15
4386
Replace standard report with WebKit
reporting webkit
Avatar
Avatar
2
de març 15
7442
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now