[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:
parent
35431de125
commit
9c7fb721f0
|
@ -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):
|
class UNIX_LINE_TERMINATOR(csv.excel):
|
||||||
lineterminator = '\n'
|
lineterminator = '\n'
|
||||||
|
@ -676,7 +679,7 @@ def trans_generate(lang, modules, cr):
|
||||||
|
|
||||||
def push(mod, type, name, res_id, term):
|
def push(mod, type, name, res_id, term):
|
||||||
term = (term or '').strip()
|
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)
|
push_translation(mod, type, name, res_id, term)
|
||||||
|
|
||||||
def get_root_view(xml_id):
|
def get_root_view(xml_id):
|
||||||
|
|
Loading…
Reference in New Issue