Commit Graph
15 Commits
Author SHA1 Message Date
Martin Trigaux cd10bee519 [FIX] transifex: still support old .tx/config format
If one of the theme was not migrated to the new tx api, still support
the previous notation.
Happened on the design-theme repository

closes odoo/odoo#113571

X-original-commit: a8355ba3dddb5f3c8a8e8e777aff85d558410971
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-02-24 11:11:40 +01:00
Martin Trigaux ae2de8101d [I18N] migrate to the nex transifex API
Tansifex is deprecating it's client and switches to a go-based
solution in its API v3

The new client is still backward compatible with the old format but
the v2 API is going to be phased out.
See https://github.com/transifex/cli to install the deplyments using
the tx client

This PR is the result of the "tx migrate" command

closes odoo/odoo#112402

Transifex: adapt to new URL format
X-original-commit: 7ca55aec4f1faa8bc2ad80d730a7f0771df3998e
Related: odoo/documentation#3534
Related: odoo/enterprise#36950
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-02-10 16:49:15 +01:00
Chong Wang (cwg) 6346f52acf [ADD] transifex: add transifex module to help translation
model/model_terms translations:
A transifex link if available is displayed after the language in the translation
dialog to help translators to contribute their translations. The tooltip message
for mouse hovering is 'Contribute'

code translations:
Setting -> Translations -> Application Terms -> Transifex Code Translations

In order to reuse the list view and search bar, model transifex.code.translation
is created to store all code translations.
This model is
1. readonly
2. reloaded on demand/by cron(7 days) to avoid increasing the Odoo restart time
3. updated for new installed modules/languages while opening the list view
4. shared to all users without duplicated translations

closes odoo/odoo#111685

X-original-commit: 7b30badb52e2a948c41f4340a01f6118818c6711
Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: Wang Chong (cwg) <cwg@odoo.com>
2023-02-03 06:05:51 +01:00
Chong Wang (cwg) 9e23f8ca7c [REM] transifex: remove module
The transifex was used to provide transifex urls to ir.translation records
The ir.translation is removed, and the module is no longer needed.
2022-09-15 22:37:50 +02:00
Martin Trigaux bb96addbed [FIX] transifex: escape ' in urls
Translation "Let's go"
Makes a Transifex search text:'Let\'s go'
That should be converted to q=text%3A'Let%5C%27s+go' in the URL

Removing the ' works from time to time but not always

closes odoo/odoo#70561

X-original-commit: 5f6d6cf1b4c76a2f0031c269501054e816c65e97
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-05-07 16:33:26 +00:00
Goffin Simonandmart-e d2b711c1e6 [FIX] transifex: Wrong link on translations to go to transifex
Steps to reproduce the bug:

- Let's consider a user U with fr_BE as lang
- Log as U and active developper tool
- Go on any record, click on debug button
- Select Technical translation
- Choose a translation and click on the transifex url button

Bug:

The URL contained the iso code fr_BE but this iso code didn't match
any code in Transifex.

From: https://www.transifex.com/odoo/odoo-14/languages/

We can see that the only iso codes with a '_' are: 'zh_CN', 'zh_TW', 'pt_BR'

opw:2448533

closes odoo/odoo#65308

X-original-commit: d609a75ccbfaa62b6070de4769880a94d896ff73
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Co-authored-by: mart-e <mat@odoo.com>
2021-01-30 16:24:39 +00:00
Xavier Morel de590816d8 [FIX] *: deprecated access to url_ utilities through werkzeug root
In 0.15 accessing werkzeug.urls functions directly through werkzeug
is deprecated, the shortcut will be removed in the eventual werkzeug
1.0.

Fix existing uses of these shortcuts. Also cleanup some imports when
they're not far from a werkzeug* import being altered.
2020-02-04 12:42:35 +00:00
Julien Castiaux d47083e6d2 [IMP] module.py: deprecate openerp
[PEP-594] is deprecating the `imp` module, that module is used in
`module.py` in order to dynamically import addons using any of the
`odoo.addons` or `openerp.addons` import anchor.

We are deprecating `openerp` module/addons imports in v13 in order to
remove the support in v14 and greatly simplify how modules/addons are
loaded. If you are still using the old `import openerp` or `import
openerp.addons`, `import odoo` and `import odoo.addons` are drop-in
replacements.

The `odoo.modules.module.ad_paths` addon paths list has been deprecated
too. The list is now accessible on `odoo.addons.__path__` where they
are now directly loaded [2].

See also:

[PEP-594]: https://python.org/dev/peps/pep-0594/
[2]: https://packaging.python.org/guides/packaging-namespace-packages/

closes odoo/odoo#36597

Task: 2003936
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-09-20 05:58:16 +00:00
Martin Trigaux 66ef641f33 [REF] base: remove field source of ir.translation
Instead, make sure the field src is always up to date
Add tests

Changes in _write:
- Replace _set_ids (to be deprecated) call by _upsert_translations as it works
  in batch
- Call _upsert_translations for any language, including en_US
  In case an English translation already existed for a record, only the master
  value (on the reference record) was updated but the user kept seeing the
  translation value (was revealed 73a7534bfc).
- Read src_trans without language
  Similar as above, if an English translation already existed, the translation
  was used for the result of the read and not the new value that has just been
  inserted into the database
- Add _set_source method
  When updating a master record of a translated field, the src field must be
  updated, including in different languages.
  Before it was ok that the src field was out of date as the source was computed

Changes in copy_translation:
- set src as the new value without lang
  update the comment to reflect reality since 489494e733
  src will contain the English version if no changes were made and it will
  contain the modified value if copy was overriden

Changes in upsert_translations:
- Do not force a module, comment, state
  Only src, res_id, name, value and lang must be given. Optional values will no
  longer be set to null if not given
2019-08-01 09:06:25 +00:00
Martin Trigaux de3a4c2947 [FIX] transifex: correctly escape links
This commit corrects two issues:
- new lines characters are ignored by transifex when searching (searching on
'\n' finds no match)
- quotes are ignored by transifex (it used to be escaped with \\)
- the text:'...' does not need to be escaped, it is the searched string that
must be escaped.

For instance, searching on "\n\nThis addon is already installed"
used to give:
https://www.transifex.com/odoo/odoo-12/translate/#fr/base/42?q=text%3A%27%0A%0AThis+addon+is+already+installed+on+your+system%27

and it now returns:
https://www.transifex.com/odoo/odoo-12/translate/#fr/base/42?q=text:'This+addon+is+already+installed+on+your+system'

Searching on
'%s' does not seem to be a number
used to give:
https://www.transifex.com/odoo/odoo-12/translate/#fr/base/42?q=text:'%5C%27%25s%5C%27+does+not+seem+to+be+a+number+for+field+%5C%27%25%25%28fi'

and it now returns:
https://www.transifex.com/odoo/odoo-12/translate/#fr/base/42?q=text:'%25s+does+not+seem+to+be+a+number+for+field+%25%25%28fi'

closes odoo/odoo#33279

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-09 12:55:04 +00:00
Martin Trigaux 98665aca1c [FIX] transifex: actually escape strings containing a '
The report's template is wrong
should becomes

text:'The report\'s template is wrong'

but previous code had no effect
2018-09-03 15:03:09 +02:00
Martin Trigaux 41e7df7880 [FIX] transifex: adapt the URL scheme
The search patterns have changed on Transifex
While the URL is still backward compatible, it may change in the future
2018-04-18 13:59:56 +02:00
Yannick Tivisse 54e99d2298 [FIX] transifex: Avoid traceback on transifex_url computation 2017-09-27 17:23:31 +02:00
Martin Trigaux 6f6a69ec23 [FIX] transifex: allow both python import
Now that @jem-odoo has finally migrated to python3
2017-09-27 10:30:49 +02:00
Martin Trigaux 7e205ea6a9 [ADD] transifex: integration module
Create a new module to directly find a source term on Transifex

This will not make translation easier but improve the collaboration and allow
easily to find a source term.
2017-09-25 15:26:54 +02:00