[FIX] tools: skip bad translations
This commit is contained in:
@@ -1098,10 +1098,14 @@ def trans_load_data(cr, fileobj, fileformat, lang, lang_name=None, verbose=True,
|
||||
|
||||
# discard the target from the POT targets.
|
||||
src = dic['src']
|
||||
if src in pot_targets:
|
||||
target = pot_targets[src]
|
||||
target.value = dic['value']
|
||||
target.targets.discard((dic['type'], dic['name'], dic['res_id']))
|
||||
target = pot_targets.get(src)
|
||||
if not target or (dic['type'], dic['name'], dic['res_id']) not in target.targets:
|
||||
_logger.info("Translation '%s' (%s, %s, %s) not found in reference pot, skipping",
|
||||
src[:60], dic['type'], dic['name'], dic['res_id'])
|
||||
return
|
||||
|
||||
target.value = dic['value']
|
||||
target.targets.discard((dic['type'], dic['name'], dic['res_id']))
|
||||
|
||||
# This would skip terms that fail to specify a res_id
|
||||
res_id = dic['res_id']
|
||||
|
||||
Reference in New Issue
Block a user