summaryrefslogtreecommitdiff
path: root/openerp/tests/addons/test_translation_import/view.xml
diff options
context:
space:
mode:
authorVo Minh Thu <vmt@openerp.com>2014-08-13 22:59:13 +0200
committerOlivier Dony <odo@openerp.com>2014-08-13 23:07:40 +0200
commit680214c47e80f30d2fd62cd56dfd6169dd9f2fbb (patch)
tree97fbd6353e17dce1f14278932985ef373779d914 /openerp/tests/addons/test_translation_import/view.xml
parent23cffab1f8cab7f456df56e6f1b002f4fa9b2ef0 (diff)
[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
Diffstat (limited to 'openerp/tests/addons/test_translation_import/view.xml')
-rw-r--r--openerp/tests/addons/test_translation_import/view.xml23
1 files changed, 23 insertions, 0 deletions
diff --git a/openerp/tests/addons/test_translation_import/view.xml b/openerp/tests/addons/test_translation_import/view.xml
new file mode 100644
index 00000000000..2fb26fbbdc5
--- /dev/null
+++ b/openerp/tests/addons/test_translation_import/view.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="action_test_translation_import" model="ir.actions.act_window">
+ <field name="name">Test translation import</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">test.translation.import</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">tree,form</field>
+ <field name="target">current</field>
+ </record>
+
+ <menuitem icon="STOCK_PREFERENCES" id="base.menu_tests" name="Tests"/>
+
+ <menuitem id="menu_test_translation" parent="base.menu_tests" name="Test translation"/>
+
+ <menuitem id="menu_test_translation_import"
+ name="Test translation import"
+ action="action_test_translation_import"
+ parent="menu_test_translation"/>
+ </data>
+</openerp>