This test also fails before the module extraction commit as the code
translations like the one for 'Ijkl' have no 'module' value during the reimport
and are ignored by the following search
closesodoo/odoo#32022
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
When a single po file is processed (i.e. direct po import, not read from a i18n
directory inside a module), there was no module information on code translations
The module information is important for web translations where the list of
modules is given in the call to the route '/website/translations' and
'/web/webclient/translations' and only the web translations of these specific
modules is retrieved and used.
To manually import the translations of a custom module (e.g. openerp_enterprise),
the base.language.import wizard is typically used and the give .po file is
directly imported.
For model and model_terms, the module information is easily deducted from the
the record external id (<module>.<reference>) but for code translation, we
relied on the global variable module_name.
The .po file do contain the module information but this information was ignored.
Real example:
#. module: openerp_enterprise
#. openerp-web
#: code:addons/openerp_enterprise/static/src/js/odoo_enterprise_start_trial.js:249
#, python-format
msgid "Please choose your domain name"
msgstr "Veuillez choisir votre nom de domaine"
Before this commit, the above translation was imported without the module and
was not retrieved in the '/website/translations' call on the /trial page
The global module_name is still used when set for backward compatibility.
Co-authored-by: Raphael Collet <rco@odoo.com>
With 12.0's (#28297) empty translations were no longer added by default
with the idea that if needed the "Generate Missing Terms" wizard should
be used.
But that wizard itself used what was modified so also did not added
empty translation.
With this changeset, empty translations are added when using the
"Generate Missing Terms" wizard.
fixes#29184closes#30037
When there is a language and its base language translation files in a
module, in 12.0 an empty translation in the language translation file
will not fallback on the base language.
eg.
fr.po : {'one': 'un', 'seventy': 'soixante-dix'}
fr_BE.po: {'one': '', 'seventy': 'septante'}
=> the translation in fr_BE will be {'one': '', 'seventy': 'septante'}
but before 7288b477 it would have been {'one': 'un', 'seventy': 'septante'}
With this commit, an empty translation is no longer created so does not
override base language.
Also the intention of d84b795b0a that was also lost is restored by
upserting only noupdate==false translation, and inserting the other
ones.
opw-1904638
closes#28297
Due to fccfd36 and 4ba7fbb the translations were only imported, considering the
.pot as the reference.
During import or a manual csv or po file, there is no pot file.
Add tests with Klingon and Dothraki
Fixes#27044
In the first attempt at #26134, the pot_targets was cleared after creating
the pot_rows object.
Since the rows not present in the pot_targets are now skipped, clearing the pot
should not be done.
Still use a temporary list pot_rows to avoid modifying the list we are iterating
on.
Update the .po test file to match the new file format
Closes#26881