Merge lp:~abentley/launchpad/fix-dummy-translations into lp:launchpad
Status: | Merged |
---|---|
Merged at revision: | 12822 |
Proposed branch: | lp:~abentley/launchpad/fix-dummy-translations |
Merge into: | lp:launchpad |
Diff against target: |
122 lines (+51/-15) 3 files modified
lib/lp/testing/factory.py (+2/-1) lib/lp/translations/browser/tests/test_pofile_view.py (+41/-1) lib/lp/translations/templates/currenttranslationmessage-translate-one.pt (+8/-13) |
To merge this branch: | bzr merge lp:~abentley/launchpad/fix-dummy-translations |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Benji York (community) | code | Approve | |
Review via email: mp+57208@code.launchpad.net |
Commit message
Fix credit display for translators who cannot edit.
Description of the change
= Summary =
Fix bug #702477: Translation credits on new POFiles show the dummy string for the other side
== Proposed fix ==
Use the same translation credit display for all viewers, regardless of whether
they can edit the POFile.
== Pre-implementation notes ==
Discussed with henninge
== Implementation details ==
This bug turns out to be simpler than it appeared. We had two ways of
displaying translation credits; one for translators with write access, and one
for translators without write access. The first was suitable for both, and the
second was unsuitable for anyone. So this branch uses the first way for both
cases.
Also, I had to change self.factory.
trying to set .translations_
been used with Zopeless tests so far. But LaunchpadFuncti
simulation of actual user interaction, so I used that.
== Tests ==
bin/test -t test_unwritable
== Demo and Q/A ==
View a POFile that you do not have write access to. If you are not already a
translator, accept the agreement. The translation credits should be shown
correctly, and you should not be able to edit any translations.
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
This branch looks good.
A thought regarding this bit of code:
insecure_ tx_person = removeSecurityP roxy(tx_ person) tx_person. translations_ relicensing_ agreement = license
insecure_
You might want to consider avoiding storing the reference to the
unproxied object in the hope that it'll avoid someone changing the code
in an insecure way in the future. Like so:
removeSecur ityProxy( tx_person) .translations_ relicensing_ agreement = (
license)
Although, your variable naming might be just as effective.