Commit Graph

62 Commits

Author SHA1 Message Date
Olivier Dony 65d92dadf4 [FIX] base: incorrect code and locale for Bosnian
Stems from prebiblical commit f083aa2.

Fixes #3480
2014-11-05 19:09:23 +01:00
Martin Ambroz 106cb1ec2b [FIX] base: python 2.6 incompatibility for dictionary comprehension 2014-08-20 10:28:37 +02:00
Olivier Dony 69eef5ac8d [FIX] tools.translate: addons path resolution failed with duplicates
When the addons_path config contained the
default path, the system was working with
an empty addons_path in the middle of the
other paths. This empty one matched for all
files, making all files appear to belong to
the root path component, e.g. `home` if the
root path is in /home.
Refactored a bit to avoid duplicates and
redundant path calculations.
2014-08-14 02:07:59 +02:00
Vo Minh Thu 680214c47e [FIX] tools.translate: when loading entries from a PO file, use also the POT.
On Launchpad, as commented on bug 933496, PO entries (and their comments) are
shared between series. This mean that e.g. the 7.0 series can have the wrong
`reference` comments (those beginning with #:) as they would be copied from say
the trunk series. Those `reference` comments are used to import translations
and look them up.

This patch adds a few lines of code to tools.translate so that targets
defined in the POT `reference` comments are used in addition to those from the
PO file.

Also adds a test module to validate the new behavior.

This patch stems from:
 - the 6.1 branch by Vo Minh Thu:
    https://code.launchpad.net/+branch/~openerp-dev/openobject-server/6.1-fix-po-targets-933496-vmt
 - the 7.0 port by Numerigraphe:
    https://code.launchpad.net/~numerigraphe-team/openobject-server/7.0-fix-po-targets-933496-vmt
2014-08-13 23:07:40 +02:00
Mathieu Benoit 40b1fccb2a [FIX] translate: Fix debug print when parse path list to translate. 2014-07-25 16:17:29 -04:00
Christophe Simonis c234d8547d [FIX] _(): avoid useless warning where translating string without a cursor
bzr revid: chs@openerp.com-20140206105141-7e8bv8ordqqsswh7
2014-02-06 11:51:41 +01:00
Xavier ALT 4986d636b4 [FIX] translation: force clearing of cached translated term after a successfull `trans_load_data`
When re-loading a translation (with 'Overwrite Existing Terms') we need to
  empty the translation cache to ensure overwritten terms get their new values.

bzr revid: xal@openerp.com-20131217145738-9oy2fjhbc46yzonq
2013-12-17 15:57:38 +01:00
Stefan Rijnhart 7de17a9358 [FIX] Keep backwards compatibility with Babel 0.9.6
bzr revid: stefan@therp.nl-20130918074505-59q1fs3ixlev1ein
2013-09-18 09:45:05 +02:00
Stefan Rijnhart a9b8936a4d [RVT] Undo previous fix
bzr revid: stefan@therp.nl-20130918074407-ae6yu2f001vxl0le
2013-09-18 09:44:07 +02:00
Stefan Rijnhart b224b40fac [FIX] Restore compatibility with Babel > 0.9.6
lp bug: https://launchpad.net/bugs/1226576 fixed

bzr revid: stefan@therp.nl-20130917122312-r6s7dgzdsfil7xyg
2013-09-17 14:23:12 +02:00
Ravi Gohil (OpenERP) bdde088d08 [FIX] re-importing the translation from a file(.csv, .xml) updates the terms in ir_translation table but does not update it in cache memory, need a server restart to take those change effect in interface. (Maintenance Case: 587178)
bzr revid: rgo@tinyerp.com-20130318133338-djkx3ykbkitvbzeb
2013-03-18 19:03:38 +05:30
Olivier Dony 527ef066dd [REVERT] tools.translate: undo rev 4874 refactoring and renaming `trans_parse_view`, was meant for trunk
rev 4874 = rev-id xmo@openerp.com-20130306095720-3277aw0rq9pzpsw4

bzr revid: odo@openerp.com-20130307164558-alvl7hcov2uhqxbw
2013-03-07 17:45:58 +01:00
Xavier Morel 7e7a8b44a9 [IMP] deduplicate trans_parse_view code, rename for clarity
also correctly handle all translatable attributes in a <attribute name=...> extension tag

bzr revid: xmo@openerp.com-20130306095720-3277aw0rq9pzpsw4
2013-03-06 10:57:20 +01:00
Dhruti Shastri c0e0110f42 [translation] : placeholders are missed out for Translation (Case:585261)
bzr revid: dhs@tinyerp.com-20130219095601-ncsy6tnfns1xz4ls
2013-02-19 15:26:01 +05:30
Dhruti Shastri 01eb26c35a [translation] : placeholders are missed out for Translation (Case:585261)
bzr revid: dhs@tinyerp.com-20130219084856-ab44isuegq7w31wo
2013-02-19 14:18:56 +05:30
Olivier Dony 3ad16170f3 [MERGE] tools.translate: fix extraction of translation terms from mako source files, courtesy of Niels Huylebroeck (Agaplan)
bzr revid: odo@openerp.com-20130114112831-87gmdtqzaa55zssf
2013-01-14 12:28:31 +01:00
Niels Huylebroeck 9db9138056 [FIX] When extracting strings from mako reports we specify a correcter method for string extraction.
lp bug: https://launchpad.net/bugs/1096138 fixed

bzr revid: nh@agaplan.eu-20130104171631-p72mjfkfsvm2tdr8
2013-01-04 18:16:31 +01:00
Xavier Morel b6ece5d65f [REM] trailing semicolons
bzr revid: xmo@openerp.com-20121214124310-wfdkhmcwxnyqu30m
2012-12-14 13:43:10 +01:00
Xavier Morel c6079dd6bb [REM] unnecessary parens
bzr revid: xmo@openerp.com-20121214123803-6xu2s1ndnoyj4i3e
2012-12-14 13:38:03 +01:00
Xavier Morel 80d97e8d17 [REM] duplicate dict keys
bzr revid: xmo@openerp.com-20121214121741-lhkqewfw76riqy45
2012-12-14 13:17:41 +01:00
Olivier Dony b624267457 [FIX] translate,orm: remember local Model [_sql]_constraints, and keep only those when exporting translations
Previously all _*constraints leaked upstream and
downstream, and were duplicated in all the exported
terms for all modules inheriting from a given model.

bzr revid: odo@openerp.com-20121204082947-tdpiu71ryxzuredb
2012-12-04 09:29:47 +01:00
Olivier Dony 7f5ad72429 [MERGE] Forward-port 6.1 bugfixes up to rev. 4307
rev.4307 = rev-id launchpad_translations_on_behalf_of_openerp-20121125065030-g5if5pybr61la4yj

bzr revid: odo@openerp.com-20121126160320-t2suuik6lhk6wl0x
bzr revid: odo@openerp.com-20121126161836-mv8yymzgbnmif4ve
bzr revid: odo@openerp.com-20121126162023-ejvsapwouyudw6c6
bzr revid: odo@openerp.com-20121126181527-d4yx15372bis77qj
2012-11-26 19:15:27 +01:00
Olivier Dony 0293ce4f64 [FIX] translate: skip XML comments when extracting terms from views
bzr revid: odo@openerp.com-20121124025622-mb7t7q7wgb7gu8y6
2012-11-24 03:56:22 +01:00
Olivier Dony a23fcfb1e8 [IMP] translate: ignore 0-1 letter terms during terms export + catch and log babel extractor exceptions with filename
bzr revid: odo@openerp.com-20121123235130-euhbx6zqs5118472
2012-11-24 00:51:30 +01:00
Olivier Dony 28062933d0 [FIX] translation export: added missing translation function `_lt` for javascript source files
bzr revid: odo@openerp.com-20121123164604-xhs2247xu4oh774q
2012-11-23 17:46:04 +01:00
Olivier Dony 180549c72e [MERGE] OPW 577045: translate: properly export and translate terms in XSL-based reports
This patch comes with a related patch on addons which
fixes a lot of cases of terms that were not properly
translated in reports, due to improper use of the
translation system. The addons patch also adds a
lot of missing entries in the POT files.

bzr revid: odo@openerp.com-20121008110946-21984tjvhoy8zkx9
2012-10-08 13:09:46 +02:00
Chris Biersbach c79543ee4d [FIX] Wrong indentation fixed
bzr revid: cbi@openerp.com-20121008105800-kkfah0x3l0z9hg3a
2012-10-08 12:58:00 +02:00
Olivier Dony a42baec455 [IMP] translate: unify the server and web translation export mechanisms
- qweb and Javascript terms extraction now builtin
- all qweb/JS terms are flagged with an extra PO comment:
  `openerp-web`, which the web client will use when
  loading translations
- the homemade Python/Mako extractor has been removed
  and replaced by the default babel Python extractor.
  Net result is that we extract less spurious terms, but
  keep valid ones, so everything looks great under
  the sun.

bzr revid: odo@openerp.com-20121003132659-h5obyl1j7hjo1y2b
2012-10-03 15:26:59 +02:00
Chris Biersbach a528390071 [FIX] removed unwanted parsing of transalte() blocks in rml python code
bzr revid: cbi@openerp.com-20121001085948-bgixbde1y3a8ka1a
2012-10-01 10:59:48 +02:00
Chris Biersbach 1d7b6d3e35 [Fix] Fixed generation of .pot files
bzr revid: cbi@openerp.com-20120924134002-co53v0mbz8zicciv
2012-09-24 15:40:02 +02:00
Olivier Dony b505ba9e0a [IMP] translate: avoid loading duplicate `code`-type translations, we only care about one
bzr revid: odo@openerp.com-20120918073029-dujiwi17irt8m73t
2012-09-18 09:30:29 +02:00
Olivier Dony 550751b358 [IMP] translations: wip, remove unnecessary code, support loading PO comments and storing them, split ir.translation view data in separate XML file
bzr revid: odo@openerp.com-20120913142920-ggpeqth4s2wwqwd2
2012-09-13 16:29:20 +02:00
Olivier Dony 9a577ef431 [MERGE] Sync with trunk
bzr revid: odo@openerp.com-20120911114104-vk8afbjq9ao1dqr2
2012-09-11 13:41:04 +02:00
Stephane Wirtel b3988436cb [REF] Replace the user id 1 by openerp.SUPERUSER_ID
bzr revid: stw@openerp.com-20120831135309-o4plzf5wp0kyuzgf
2012-08-31 15:53:09 +02:00
Jigar Amin - OpenERP d0910e1b38 [IMP] integreated the web serivce for the translations
bzr revid: jam@tinyerp.com-20120713114208-yndy8hus850bh97z
2012-07-13 17:12:08 +05:30
Turkesh Patel (Open ERP) 48a344c1e8 [IMP] improved code.
bzr revid: tpa@tinyerp.com-20120713095448-ghr750h2jk9ivsj2
2012-07-13 15:24:48 +05:30
Turkesh Patel (Open ERP) 8383d6a245 [IMP] Fetch only traslated and distinct strings using sql.
bzr revid: tpa@tinyerp.com-20120713092838-5th251msbdkgjdnb
2012-07-13 14:58:38 +05:30
Turkesh Patel (Open ERP) f05ee5dfdb [IMP] improved code.
bzr revid: tpa@tinyerp.com-20120713055330-avz6ebzuqvcpxdd5
2012-07-13 11:23:30 +05:30
Turkesh Patel (Open ERP) c17ea49de9 [IMP] improved code
bzr revid: tpa@tinyerp.com-20120712132700-zc4co6o4plhzoi60
2012-07-12 18:57:00 +05:30
Turkesh Patel (Open ERP) bc76991e24 [IMP] improved code.
bzr revid: tpa@tinyerp.com-20120712132308-1qvurv572sxmsnqe
2012-07-12 18:53:08 +05:30
Turkesh Patel (Open ERP) d87adc497e [IMP] improved code to get translation from database.
bzr revid: tpa@tinyerp.com-20120712085838-pqzj86fptp96eag6
2012-07-12 14:28:38 +05:30
Turkesh Patel (Open ERP) 4ea3ad65b2 [ADD] added module field in ir.translation and improved code for that.
bzr revid: tpa@tinyerp.com-20120712052111-5qq9noxd5vd9dlwv
2012-07-12 10:51:11 +05:30
Turkesh Patel (Open ERP) f9ad472466 [ADD] add new http service translation.
bzr revid: tpa@tinyerp.com-20120711071054-rfreaxwys8b1fqbc
2012-07-11 12:40:54 +05:30
Olivier Dony e3922a054b [FIX] OPW 572856: translate: attempt to auto-detect user's language preferences when no context is available
lp bug: https://launchpad.net/bugs/434266 fixed

bzr revid: odo@openerp.com-20120629120418-q61hd8cbxy2nftva
2012-06-29 14:04:18 +02:00
Fabien Pinckaers ed4c342d9c [IMP] Translations of static terms in views
bzr revid: fp@tinyerp.com-20120628141632-ghixqjf59jodqgx4
2012-06-28 16:16:32 +02:00
Vo Minh Thu 23eb63f139 [MERGE] merged trunk.
bzr revid: vmt@openerp.com-20120206203151-3snkz7usngwtv1xt
2012-02-06 21:31:51 +01:00
Olivier Dony aea1b13412 [IMP] tools.translate: be more lenient and accept standart gettext source annotations
The GetText spec says that PO auto-comments indicating
  the source location have this form:
   #: /path/to/file:lineno
  However OpenERP's POT export system defaults to a modified
  version of this format with an extra 'type' field:
   #: type:/path/to/file:lineno
  The babel extractors we use for openerp-web's translations
  have the GetText format hardcoded, so it's a good idea
  to be more lenient and allow the standards annotations too.
  We can use a default 'code' type for such cases.

  For openerp-web translations the type does not matter,
  as the translations will be directly loaded by the 
  web engine from the PO files and served in Javascript
 to the browser, with no typing needed.

  This patch simply avoids failing to parse updated PO files
  that will contain standard GetText annotations for the
  openerp-web related terms.

bzr revid: odo@openerp.com-20120202143210-05p1w24t6u77cyv8
2012-02-02 15:32:10 +01:00
Vo Minh Thu a142292f91 [IMP] openerp.tools: _logger with fully qualified module name.
bzr revid: vmt@openerp.com-20120124140056-hqoy49bh7wyr1xce
2012-01-24 15:00:56 +01:00
Olivier Dony 356e4ed9bd [FIX] translation: remove calls to trans_update_res_ids
Calling this method is no longer required since the
merge of the new code for loading translations using
a temporary table. The method itself has been removed
at revision 3919, so all calls to it should have been
cleaned up as well.
Rev.3919 = rco@openerp.com-20111223104824-fup1cjbjni1fsty1

bzr revid: odo@openerp.com-20120109140958-10i1ti16tw327580
2012-01-09 15:09:58 +01:00
Vo Minh Thu b71c0095c9 [MERGE] tools.translate: use misc.file_open() to load .po files even from .zip files.
bzr revid: vmt@openerp.com-20120104103212-qq2ad04b1ffydrur
2012-01-04 11:32:12 +01:00