diff options
| author | Olivier Dony <odo@openerp.com> | 2012-02-07 19:22:55 +0100 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2012-02-07 19:22:55 +0100 |
| commit | df0b4f8c3546755f0df3590f3edfd87fa75889de (patch) | |
| tree | a604575d75a010cddaee33ec6e42dc4ba1f41a96 | |
| parent | b33f8d708798e9e4a1c0bf1f00976cec53b86e36 (diff) | |
[IMP] i18n extractor now ignores comments and PIs + additional spurious translations removed
PO templates updated accordingly
bzr revid: odo@openerp.com-20120207182255-23s4yp4hrteierht
| -rw-r--r-- | addons/web/i18n/web.pot | 41 | ||||
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 8 | ||||
| -rw-r--r-- | addons/web_process/i18n/web_process.pot | 7 | ||||
| -rwxr-xr-x | npybabel.py | 5 |
4 files changed, 11 insertions, 50 deletions
diff --git a/addons/web/i18n/web.pot b/addons/web/i18n/web.pot index 94242fd74e5..44313f3efdb 100644 --- a/addons/web/i18n/web.pot +++ b/addons/web/i18n/web.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2012-02-07 15:27+0100\n" +"POT-Creation-Date: 2012-02-07 19:19+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -632,16 +632,6 @@ msgid "Translations" msgstr "" #. openerp-web -#: addons/web/static/src/xml/base.xml:9 addons/web/static/src/xml/base.xml:15 -msgid "#{title}" -msgstr "" - -#. openerp-web -#: addons/web/static/src/xml/base.xml:10 addons/web/static/src/xml/base.xml:16 -msgid "#{text}" -msgstr "" - -#. openerp-web #: addons/web/static/src/xml/base.xml:44 addons/web/static/src/xml/base.xml:315 msgid "Powered by" msgstr "" @@ -839,21 +829,11 @@ msgstr "" #. openerp-web #: addons/web/static/src/xml/base.xml:388 -msgid "«" -msgstr "" - -#. openerp-web -#: addons/web/static/src/xml/base.xml:388 msgid "Fold menu" msgstr "" #. openerp-web #: addons/web/static/src/xml/base.xml:389 -msgid "»" -msgstr "" - -#. openerp-web -#: addons/web/static/src/xml/base.xml:389 msgid "Unfold menu" msgstr "" @@ -1228,15 +1208,6 @@ msgid "Save & Close" msgstr "" #. openerp-web -#: addons/web/static/src/xml/base.xml:1455 -msgid "" -"adds back padding to row being rendered after edition, if necessary\n" -" (if not deletable add back padding), otherwise the row being " -"added is\n" -" missing columns" -msgstr "" - -#. openerp-web #: addons/web/static/src/xml/base.xml:1551 msgid "" "This wizard will export all data that matches the current search criteria" @@ -1281,11 +1252,6 @@ msgid "Save fields list" msgstr "" #. openerp-web -#: addons/web/static/src/xml/base.xml:1585 -msgid "TODO: replace ids by 'oe_*' classes" -msgstr "" - -#. openerp-web #: addons/web/static/src/xml/base.xml:1588 msgid "Remove All" msgstr "" @@ -1296,11 +1262,6 @@ msgid "Name" msgstr "" #. openerp-web -#: addons/web/static/src/xml/base.xml:1611 -msgid " " -msgstr "" - -#. openerp-web #: addons/web/static/src/xml/base.xml:1633 msgid "Save as:" msgstr "" diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 4194831bb78..6b068679310 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -3,7 +3,7 @@ --> <templates id="template" xml:space="preserve"> <t t-name="Notification"> - <div class="oe_notification"> + <div class="oe_notification" t-translation="off"> <div id="oe_notification_default"> <a class="ui-notify-cross ui-notify-close" href="#">x</a> <h1>#{title}</h1> @@ -385,8 +385,8 @@ </t> <t t-name="Menu.secondary"> <div t-attf-class="oe_toggle_secondary_menu"> - <span class="oe_menu_fold" title="Fold menu">&laquo;</span> - <span class="oe_menu_unfold" title="Unfold menu">&raquo;</span> + <span class="oe_menu_fold" title="Fold menu"><t t-raw="'&laquo;'"/></span> + <span class="oe_menu_unfold" title="Unfold menu"><t t-raw="'&raquo;'"/></span> </div> <div t-foreach="widget.data.data.children" t-as="menu" style="display: none" class="oe_secondary_menu" t-att-data-menu-parent="menu.id"> <t t-foreach="menu.children" t-as="menu"> @@ -1608,7 +1608,7 @@ <tr class="oe_export_row"> <t t-foreach="(field.id).split('/')" t-as="level" > <t t-if="(field.id).split('/')[0] != level"> - <td width="18">&nbsp;</td> + <td width="18" t-translation="off">&nbsp;</td> </t> </t> <td valign="top" align="left" style="cursor: pointer;" width="18"> diff --git a/addons/web_process/i18n/web_process.pot b/addons/web_process/i18n/web_process.pot index dfb71f203fd..cb291039602 100644 --- a/addons/web_process/i18n/web_process.pot +++ b/addons/web_process/i18n/web_process.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2012-02-07 10:13+0100\n" +"POT-Creation-Date: 2012-02-07 19:19+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -28,11 +28,6 @@ msgid "Save" msgstr "" #. openerp-web -#: addons/web_process/static/src/xml/web_process.xml:3 -msgid "vim:fdl=1:" -msgstr "" - -#. openerp-web #: addons/web_process/static/src/xml/web_process.xml:6 msgid "Process View" msgstr "" diff --git a/npybabel.py b/npybabel.py index 8b582e17e5a..6759a4a6166 100755 --- a/npybabel.py +++ b/npybabel.py @@ -17,6 +17,10 @@ XMLJS_EXPR = re.compile(r"""(?:\_t *\( *((?:"(?:[^"\\]|\\.)*")|(?:'(?:[^'\\]|\\. TRANSLATION_FLAG_COMMENT = "openerp-web" +# List of etree._Element subclasses that we choose to ignore when parsing XML. +# We include the *Base ones just in case, currently they seem to be subclasses of the _* ones. +SKIPPED_ELEMENT_TYPES = (elt._Comment, elt._ProcessingInstruction, elt.CommentBase, elt.PIBase) + def extract_xmljs(fileobj, keywords, comment_tags, options): """Extract messages from Javascript code embedded into XML documents. This complements the ``extract_javascript`` extractor which works @@ -70,6 +74,7 @@ def extract_qweb(fileobj, keywords, comment_tags, options): # the ancestor element had a reason to be skipped def iter_elements(current_element): for el in current_element: + if isinstance(el, SKIPPED_ELEMENT_TYPES): continue if "t-js" not in el.attrib and \ not ("t-jquery" in el.attrib and "t-operation" not in el.attrib) and \ not ("t-translation" in el.attrib and el.attrib["t-translation"].strip() == "off"): |
