[IMP] i18n extractor now ignores comments and PIs + additional spurious translations removed

PO templates updated accordingly

bzr revid: odo@openerp.com-20120207182255-23s4yp4hrteierht
This commit is contained in:
Olivier Dony 2012-02-07 19:22:55 +01:00
parent b33f8d7087
commit df0b4f8c35
4 changed files with 11 additions and 50 deletions

View File

@ -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"
@ -631,16 +631,6 @@ msgstr ""
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"
@ -837,21 +827,11 @@ msgstr ""
msgid "LOGOUT"
msgstr ""
#. openerp-web
#: addons/web/static/src/xml/base.xml:388
msgid "&laquo;"
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 "&raquo;"
msgstr ""
#. openerp-web
#: addons/web/static/src/xml/base.xml:389
msgid "Unfold menu"
@ -1227,15 +1207,6 @@ msgstr ""
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 ""
@ -1280,11 +1251,6 @@ msgstr ""
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"
@ -1295,11 +1261,6 @@ msgstr ""
msgid "Name"
msgstr ""
#. openerp-web
#: addons/web/static/src/xml/base.xml:1611
msgid "&nbsp;"
msgstr ""
#. openerp-web
#: addons/web/static/src/xml/base.xml:1633
msgid "Save as:"

View File

@ -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">&amp;laquo;</span>
<span class="oe_menu_unfold" title="Unfold menu">&amp;raquo;</span>
<span class="oe_menu_fold" title="Fold menu"><t t-raw="'&amp;laquo;'"/></span>
<span class="oe_menu_unfold" title="Unfold menu"><t t-raw="'&amp;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">&amp;nbsp;</td>
<td width="18" t-translation="off">&amp;nbsp;</td>
</t>
</t>
<td valign="top" align="left" style="cursor: pointer;" width="18">

View File

@ -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"
@ -27,11 +27,6 @@ msgstr ""
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"

View File

@ -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"):