Open voronind opened 1 month ago
Sorry, I didn't get you
Original term is "CRM"
You want to translate it to "CRM"
(It means, you want to use the same original term than translated one)
Right?
The part I didn't get you is
my translation ignores.
I expect a empty string use original term like you translation
But what is the value used then?
Module crm
has shitty translation of CRM
term in my language. I want keep original term (CRM
). I created module crm_translation
and add in i18n directory:
#. module: crm
#: something
msgid "CRM"
msgstr "CRM"
po-pretty-format
hook replace msgstr
to "" (empty string) and Odoo uses shitty translation from crm
module.
@voronind
You have a good point
You need to redefine to original English term in order to overwrite the translated term
This static checker doesn't have context about this case since that it doesn't know the original module/file terms
So, you have diferent workaorund here since that it can not be fixed
1) Fix the wrong translated term from weblate 2) Disable "autofix" option for this checker in your configuration files 3) Discard this special file for this checker in your configuration files
Hi @moylop260,
Thinking it better, maybe removing an existing translation is a valid case, as long as it's under the directory i18n_extra
.
The reason for clearing translated terms is to generate a file as similar as possible to the one exported by Odoo, and to mimic the behavior (if the term is from our module, there's no need to fill the translation, because result will be the same). But since when dealing with manual translations (i18n_extra
) terms will be from other modules, leaving the term empty and fill it with the same string as the original term will have different behaviors. Actually, it wouldn't make much of a sense to include a term in the i18n_extra
directory and leave translation empty, because it will be ignored.
What do you think?
Regards,
@luisg123v
Who should take care about excluding files, the hooks itself or the pre-commit configuration file?
@moylop260 I think the file shouldn't be excluded, it just should change its behavior depending on if it's under i18n
or i18n_extra
:
i18n
, same translation should be cleared.i18n_extra
, same translation should be allowed, and empty translations should be filled (the opposite as the above).@voronind
In this case, are you using a i18n_extra/*.po file?
I am using i18n/. I dont know difference between them
пт, 26 июл. 2024 г., 07:36 moylop260 @.***>:
@voronind https://github.com/voronind
In this case, are you using a i18n_extra/*.po file?
— Reply to this email directly, view it on GitHub https://github.com/OCA/odoo-pre-commit-hooks/issues/100#issuecomment-2251898742, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMBIUW22YCMI2CXWN55TN3ZOG75XAVCNFSM6AAAAABLFJ5OVGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJRHA4TQNZUGI . You are receiving this because you were mentioned.Message ID: @.***>
@voronind i18n
is for translations that belong to your own module, while i18n_extra
is intended to modify translations from other modules.
Odoo 15. In my module I redefine
crm
module translation. I want to translateCRM
toCRM
.po-pretty-format
replace it to empty string and my translation ignores. Can we check module name?