polyglot
polyglot copied to clipboard
When a msgid contains %(keyword)s, keyword should not be translated
Thanks for this great tool !
It works well, but I have one problem, to use your lib in real-life PO files from Odoo/OCA modules. My PO file contains:
#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:0
msgid "Company '%(company)s' is configured in country '%(country)s'."
msgstr ""
When I run:
python -m polyglot translate --from EN --to FR -s filename.po
I get the following result:
#: code:addons/l10n_fr_das2/models/l10n_fr_das2.py:0
msgid "Company '%(company)s' is configured in country '%(country)s'."
msgstr "L'entreprise \"%(entreprise)s\" est configurée dans le pays \"%(pays)s\"."
The keywords 'company' and 'country' should not be translated!
Hi, thank you for reporting the issue. I will try to make the fix as soon as I have time
Hi @alexis-via, can you test this PR? I added an argument where you can pass the variable wrapper. in your case you just add -v "'%(" ")s'"