Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translation broken when html/xml removed #27311

Closed
nhomar opened this issue Sep 29, 2018 · 4 comments
Closed

Translation broken when html/xml removed #27311

nhomar opened this issue Sep 29, 2018 · 4 comments
Assignees
Labels
Framework General frontend/backend framework issues Internationalization about translations

Comments

@nhomar
Copy link
Collaborator

nhomar commented Sep 29, 2018

Impacted versions:

saas-11.5

Steps to reproduce:

example: Install spanish and then swich your user to spanish, try to open Account main menu with just account_accountant installed.

Current behavior:

Traceback.

imagen

Expected behavior:

No traceback.

solution

We actually conrrected the transifex text with the erroneous element but some things pops out here:

  1. An html string is sent to transifex which is not correct in the context of send just the text part.
  2. No checking such translations that should comply with the original structure are bringing back again the problem we had when we allow placehold things into the string.

cc @mart-e thanks.

@nhomar nhomar added the Framework General frontend/backend framework issues label Sep 29, 2018
@Yenthe666 Yenthe666 added the Internationalization about translations label Sep 29, 2018
@moylop260
Copy link
Contributor

moylop260 commented Sep 29, 2018

FYI I just ran the following command in order to find other similar cases:

pip install translate-toolkit
pofilter --test=xmltags ~/odoo_git/addons/account/i18n/es.po

The output was:

...

#: model_terms:ir.ui.view,arch_db:account.portal_invoice_page
msgid "<i class=\"fa fa-download\"/> Download"
msgstr "Descargar"

#: model_terms:ir.ui.view,arch_db:account.view_account_journal_form
msgid ""
"<i class=\"fa fa-fw o_button_icon fa-arrow-right\"/> Configure Email Servers"
msgstr "Configurar servidores de email"

#: model_terms:ir.ui.view,arch_db:account.invoice_form
msgid ""
"<span class=\"o_form_label\" attrs=\"{'invisible': "
"['|',('state','=','draft'), ('type','!=','out_refund')]}\">Credit "
"Note</span>"
msgstr "Nota de Crédito"

#: model_terms:ir.ui.view,arch_db:account.res_config_settings_view_form
msgid ""
"<span class=\"o_form_label\">Default Taxes</span>\n"
"                                    <span class=\"fa fa-lg fa-building-o\" title=\"Values set here are company-specific.\" aria-label=\"Values set here are company-specific.\" groups=\"base.group_multi_company\" role=\"img\"/>"
msgstr "Impuestos por defecto"

#: model_terms:ir.ui.view,arch_db:account.res_config_settings_view_form
msgid ""
"<span class=\"o_form_label\">Main Currency</span>\n"
"                                    <span class=\"fa fa-lg fa-building-o\" title=\"Values set here are company-specific.\" aria-label=\"Values set here are company-specific.\" groups=\"base.group_multi_company\" role=\"img\"/>"
msgstr "Moneda Principal"

#: model_terms:ir.ui.view,arch_db:account.account_journal_dashboard_kanban_view
msgid "<span name=\"button_import_placeholder\"/> Statements"
msgstr "Una cuenta bancaria puede pertenecer a un solo diario."

#: model_terms:ir.ui.view,arch_db:account.account_journal_dashboard_kanban_view
msgid "<span role=\"separator\">View</span>"
msgstr "Vista"

...

The groups parameter and another technical stuffs are added to translate them.

@moylop260
Copy link
Contributor

Is not a regression of #14497?

@mart-e
Copy link
Contributor

mart-e commented May 7, 2019

Hello,

Does this issue is still valid? As I understand, it is a problem of bad translations that needs to be fixed on Transifex but not really on Odoo side.
I did not know the --test=xmltags, thanks for the share

@mart-e mart-e closed this as completed May 7, 2019
@mart-e
Copy link
Contributor

mart-e commented May 7, 2019

By the way, you can check #33220 where I add a check to detect bad translations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework General frontend/backend framework issues Internationalization about translations
Projects
None yet
Development

No branches or pull requests

4 participants