[IMP] backport of rev odo@openerp.com-20120202143210-05p1w24t6u77cyv8 of trunk: tools...
authorChristophe Simonis <chs@openerp.com>
Thu, 9 Feb 2012 10:52:03 +0000 (11:52 +0100)
committerChristophe Simonis <chs@openerp.com>
Thu, 9 Feb 2012 10:52:03 +0000 (11:52 +0100)
commit55403a48d89b57dc1c24fb2cdc045aa3e2dc24fb
tree45516fb46b349c7c7a6684657da6a7fd62bf7be5
parent01ed70238da565e8650fbb8d212b2befbc02a187
[IMP] backport of rev odo@openerp.com-20120202143210-05p1w24t6u77cyv8 of trunk: tools.translate: be more lenient and accept standart gettext source annotations

Original commit information:
------------------------------------------------------------
revno: 4002
revision-id: odo@openerp.com-20120202143210-05p1w24t6u77cyv8
parent: xmo@openerp.com-20120131154023-lbxqpdirjk9df694
committer: Olivier Dony <odo@openerp.com>
branch nick: trunk
timestamp: Thu 2012-02-02 15:32:10 +0100
message:
  [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: chs@openerp.com-20120209105203-7y9busughofi65vf
bin/tools/translate.py