Merge lp:~danilo/launchpad/bug-548375 into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Данило Шеган |
Approved revision: | no longer in the source branch. |
Merged at revision: | 11501 |
Proposed branch: | lp:~danilo/launchpad/bug-548375 |
Merge into: | lp:launchpad |
Diff against target: |
173 lines (+42/-19) 3 files modified
lib/lp/translations/utilities/tests/test_file_importer.py (+30/-0) lib/lp/translations/utilities/tests/test_translation_importer.py (+3/-10) lib/lp/translations/utilities/translation_import.py (+9/-9) |
To merge this branch: | bzr merge lp:~danilo/launchpad/bug-548375 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Brad Crittenden (community) | code | Approve | |
Review via email: mp+34544@code.launchpad.net |
Commit message
Ignore empty translations for uploads (including user-uploaded PO files).
Description of the change
= Bug #548375 =
Ignore empty translations on import (always). We've also considered
keeping the ability to revert translations with non-published uploads,
but it would be more work for dubious benefit. For now, what users
want is for imports to simply not introduce empty messages. We get that
here.
Most of the changes are cleanups and lint fixes. Basically, only the change
@@ -449,7 +449,9 @@ class FileImporter(
# store English strings in an IPOFile.
return None
- if not message.
+ if (not message.
+ set(message.
+ set(message.
# We don't have anything to import.
return None
is important here. Since message.
more than 6 items, I didn't bother optimizing this (i.e. do a
set(message.
The tests are split into two methods so it's clearer what we do for
both cases (I've first written tests which assert previous behavior,
then unified the code using a helper private method).
== Tests ==
bin/test -cvvt storeTranslatio
== Demo and Q/A ==
Export a PO file and re-import it as "updated translation" and watch for empty messages not being created.
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
Looks good Danilos. Thanks for the branch and the clean up.