Commit d00ae81b authored by Michal Čihař's avatar Michal Čihař

Set fuzzy after setting content

Otherwise the Po backend is too smart and drops fuzzy flag when the
string is not translated. So creating new fuzzy translation leads to
situation when in database we have the fuzzy flag but not in the
backend.

This inconsistency in database is causing wrong behaviour when togging
fuzzy flag as seen in issue #189.
parent 0a1b4cc0
...@@ -2130,13 +2130,13 @@ class Translation(models.Model): ...@@ -2130,13 +2130,13 @@ class Translation(models.Model):
# Detect changes # Detect changes
if unit.target != get_target(pounit) or unit.fuzzy != pounit.isfuzzy(): if unit.target != get_target(pounit) or unit.fuzzy != pounit.isfuzzy():
# Update fuzzy flag
pounit.markfuzzy(unit.fuzzy)
# Store translations # Store translations
if unit.is_plural(): if unit.is_plural():
pounit.settarget(unit.get_target_plurals()) pounit.settarget(unit.get_target_plurals())
else: else:
pounit.settarget(unit.target) pounit.settarget(unit.target)
# Update fuzzy flag
pounit.markfuzzy(unit.fuzzy)
# Optionally add unit to translation file # Optionally add unit to translation file
if add: if add:
if isinstance(store, LISAfile): if isinstance(store, LISAfile):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment