From 9c7fb721f0859e0bc492c39a1bb704a97add3483 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 4 Dec 2014 13:09:15 +0100 Subject: [PATCH] [FIX] translate: allow common english 2 chars terms Before, all isolated (between xml/html tags) two chars words coming from views were not translated (by choice). But, for some words, allowing them is useful. For instance, the word 'or' located between two buttons. opw-616716 --- openerp/tools/translate.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openerp/tools/translate.py b/openerp/tools/translate.py index 32fd5bcf6fe..3c9a8a2642e 100644 --- a/openerp/tools/translate.py +++ b/openerp/tools/translate.py @@ -137,6 +137,9 @@ _LOCALE2WIN32 = { } +# These are not all english small words, just those that could potentially be isolated within views +ENGLISH_SMALL_WORDS = set("as at by do go if in me no of ok on or to up us we".split()) + class UNIX_LINE_TERMINATOR(csv.excel): lineterminator = '\n' @@ -676,7 +679,7 @@ def trans_generate(lang, modules, cr): def push(mod, type, name, res_id, term): term = (term or '').strip() - if len(term) > 2: + if len(term) > 2 or term in ENGLISH_SMALL_WORDS: push_translation(mod, type, name, res_id, term) def get_root_view(xml_id):