Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • e-learning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Conocimientos
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Alimentación y hostelería
    • Bar y taberna
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y asistencia informática
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Browse all Industries
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Services for Partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyecto
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

Report translation with Mako

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
reportingtranslationwebkitmako
2 Respuestas
9627 Vistas
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
Mejor respuesta

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
Mejor respuesta

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
¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
Images in webkit / mako pdf reports Resuelto
webkit mako
Avatar
Avatar
Avatar
Avatar
4
sept 16
9090
How to display page numbers in webkit reports?
reporting webkit
Avatar
Avatar
Avatar
Avatar
Avatar
4
mar 15
11207
How do I limit an iteration in Mako?
webkit mako
Avatar
Avatar
1
mar 15
5902
Webkit header/footer translation
translation webkit
Avatar
0
mar 15
4388
Replace standard report with WebKit
reporting webkit
Avatar
Avatar
2
mar 15
7452
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y totalmente integrado.

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