export translation - missing if one source but multiple values
Bug #1258577 reported by
Alvar Vilu
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
New
|
Undecided
|
Unassigned |
Bug Description
If we have a field name - this should be Capitalized e.g. Free Member = Tasuta liige
but if we have a status (a selection), it should be lowercase e.g. Free Member = tasuta liige
But if we use translate export, it will take the first translation value and all the other sources get the same value.
e.g. Free Member = tasuta liige (in all values)
To post a comment you must log in.
A quick fix in file openerp/ tools/translate .py:437 (trans_export)
# we now group the translations by source. That means one translation per source.
grouped_ rows = {} rows.setdefault (src, {})
row.setdefaul t('modules' , set()).add(module) 'translation' ) and trad != src:
row[ 'translation' ] = trad
row.setdefaul t('tnrs' , []).append((type, name, res_id))
row.setdefaul t('comments' , set()). update( comments)
for module, type, name, res_id, src, trad, comments in rows:
row = grouped_
if not row.get(
for src, row in grouped_ rows.items( ):
# translation template, so no translation value
row[ 'translation' ] = ''
elif not row.get( 'translation' ):
row[ 'translation' ] = src
writer. write(row[ 'modules' ], row['tnrs'], src, row['translation'], row['comments'])
if not lang:
-- to --
# we now group the translations by source. That means one translation per source.
grouped_ rows = {} rows.setdefault (src + '__' + trad, {})
row.setdefaul t('modules' , set()).add(module) 'translation' ) and trad != src:
row[ 'translation' ] = trad
row[ 'source' ] = src
row.setdefaul t('tnrs' , []).append((type, name, res_id))
row.setdefaul t('comments' , set()). update( comments)
for module, type, name, res_id, src, trad, comments in rows:
row = grouped_
if not row.get(
if ('source' not in row) or (not row['source']):
for src, row in grouped_ rows.items( ):
# translation template, so no translation value
row[ 'translation' ] = ''
elif not row.get( 'translation' ):
row[ 'translation' ] = src
writer. write(row[ 'modules' ], row['tnrs'], row['source'], row['translation'], row['comments'])
if not lang: