Try to find translation for new one

This commit is contained in:
Cédric Krier committed 2009-03-14 19:09:44 +01:00
1 parent e718ac4f47
commit 2b1947d5f8
1 file changed
+19
+19
View File
@@ -1006,6 +1006,25 @@ class TranslationUpdate(Wizard):
'AND lang = %s',
(row['src'], row['name'], row['res_id'], row['type'],
data['form']['lang']))
cursor.execute('SELECT src, MAX(value) AS value FROM ir_translation ' \
'WHERE lang = %s ' \
'AND src IN (' \
'SELECT src FROM ir_translation ' \
'WHERE value = \'\' OR value IS NULL ' \
'AND lang = %s) '
'AND value != \'\' AND value IS NOT NULL ' \
'GROUP BY src', (data['form']['lang'], data['form']['lang']))
for row in cursor.dictfetchall():
cursor.execute('UPDATE ir_translation ' \
'SET fuzzy = True, ' \
'value = %s ' \
'WHERE src = %s ' \
'AND (value = \'\' OR value IS NULL) ' \
'AND lang = %s', (row['value'], row['src'],
data['form']['lang']))
cursor.execute('UPDATE ir_translation ' \
'SET fuzzy = False ' \
'WHERE (value = \'\' OR value IS NULL) ' \