Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

When a msgid contains %(keyword)s, keyword should not be translated #6

Open
alexis-via opened this issue Jun 6, 2023 · 2 comments · May be fixed by #7
Open

When a msgid contains %(keyword)s, keyword should not be translated #6

alexis-via opened this issue Jun 6, 2023 · 2 comments · May be fixed by #7
Assignees
Labels
enhancement New feature or request

Comments

@alexis-via
Copy link

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!

@riccardoFasan riccardoFasan added the bug Something isn't working label Jun 6, 2023
@riccardoFasan riccardoFasan self-assigned this Jun 6, 2023
@riccardoFasan
Copy link
Owner

Hi, thank you for reporting the issue. I will try to make the fix as soon as I have time

@riccardoFasan riccardoFasan added enhancement New feature or request and removed bug Something isn't working labels Jun 12, 2023
@riccardoFasan riccardoFasan linked a pull request Jun 12, 2023 that will close this issue
@riccardoFasan
Copy link
Owner

riccardoFasan commented Jun 12, 2023

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'"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants