Commit Graph
14 Commits
Author SHA1 Message Date
Christophe Simonis 2a06f4dcf3 [MERGE] forward port branch 12.0 up to 09fb2469b4 2019-03-29 18:10:57 +01:00
Martin Trigaux c9d01b136f [ADD] test_translation_import: add new test
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

closes odoo/odoo#32022

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-03-29 14:50:56 +00:00
Martin TrigauxandRaphael Collet 257ccdf83c [FIX] tools: extract module from po file
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>
2019-03-29 14:48:57 +00:00
Nicolas Lempereur ed99544dfa [FIX] translate.py: really generate missing terms
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 #29184
closes #30037
2019-01-09 15:00:43 +00:00
Nicolas Lempereur 233bae7de9 [FIX] translate.py: fallback on base lang if noterm
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
2018-11-07 09:07:02 +00:00
Christophe Simonis 43b63a0465 [MERGE] forward port branch saas-11.4 up to 57e387b645 2018-10-01 16:01:54 +02:00
Yannick Tivisse c67ac34ee4 [IMP] base: Add missing _description on models 2018-09-21 16:13:59 +02:00
Martin Trigaux 1421949c67 [FIX] tools: import translation file without pot
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
2018-09-18 18:02:19 +02:00
Martin Trigaux 4ba7fbbf81 [FIX] tools: use pot as reference file
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
2018-09-11 09:16:59 +02:00
Christophe Simonis 1884c71245 [FIX] test_translation_import: correct test and add required i18n files ignored during forward-port 2018-09-07 12:06:24 +02:00
Christophe Simonis f19e6ce561 [MERGE] forward port branch 11.0 up to 213759b03e 2018-09-05 18:52:27 +02:00
Martin Trigaux 5700f960d4 [ADD] test_translation_import: new duplication test
To make sure what was corrected is tested
2018-09-03 11:02:56 +02:00
Martin Trigaux e656a350a6 [FIX] test_translation_import: correct test
Now that it is tested, actually correct it
2018-09-03 11:02:56 +02:00
Martin Trigaux a9cd97f58e [MOV] tests: move test to be executed
The test was in a folder not checked by the runbot
The test, as it, is actually failing and it will be corrected in the next commit
2018-09-03 11:02:55 +02:00