[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
This commit is contained in:
Denis Ledoux 2014-12-04 13:09:15 +01:00
parent 35431de125
commit 9c7fb721f0
1 changed files with 4 additions and 1 deletions

View File

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