Merge lp:~henninge/launchpad/devel-710591-setcurrenttranslation-extension into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Henning Eggers |
Approved revision: | no longer in the source branch. |
Merged at revision: | 12337 |
Proposed branch: | lp:~henninge/launchpad/devel-710591-setcurrenttranslation-extension |
Merge into: | lp:launchpad |
Prerequisite: | lp:~henninge/launchpad/devel-710591-sharing-info-groundwork-0 |
Diff against target: |
373 lines (+289/-4) 5 files modified
lib/lp/testing/factory.py (+3/-3) lib/lp/translations/interfaces/translationmessage.py (+11/-0) lib/lp/translations/model/potmsgset.py (+73/-0) lib/lp/translations/model/translationmessage.py (+23/-1) lib/lp/translations/tests/test_translationmessage.py (+179/-0) |
To merge this branch: | bzr merge lp:~henninge/launchpad/devel-710591-setcurrenttranslation-extension |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ian Booth (community) | release-critical | Approve | |
Jeroen T. Vermeulen (community) | code | Approve | |
Review via email: mp+48594@code.launchpad.net |
Commit message
[r=jtv][ui=none] [r=jtv][bug=710591][incr] Provide TranslationMess
Description of the change
= Summary =
Provide a method to import translations in old style. Old style means that
translations coming from an import are marked as "imported" by setting the
"current" flag on the other side. It also follow the precedence rules as
outlined here:
https:/
== Proposed fix ==
Provide a method "TranslationMes
"TranslationMes
is misleading as translations are not really approved. Hence the new method
does not take a "reviewer" parameter and does not set the "reviewer" and
"date_reviewed" attributes of a TranslationMessage.
== Pre-implementation notes ==
Talked to danilo about the need to fix this as a special case for
setCurrentTrans
== Implementation details ==
== Tests ==
bin/test -vvcm lp.translations
-t AcceptAsImported
== Demo and Q/A ==
None.
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
(Typo in ITranslation. acceptAsImporte d: "sold_style_ import" )
Hi Henning,
This looks like a very nice branch overall. Well-tested, well-documented, simple solution to a complex problem. We discussed on IRC, but unfortunately I don't have time to continue doing that today. The branch looks good to me in essence, so I'm approving now but with a few conditions.
First of those: POTMsgSet. acceptAsImporte d is two methods dressed up as one. There's a "mode switch" that I expect is going to be set explicitly near the call site, and then the two paths inside the method have very little in common. I can see how the method may have grown in that way, but now that it's stabilized it's clear that it needs to be split into two.
By the way, you note that the "old-style import" will be used "only if the upload is by_maintainer and to a source package and no upstream template [exists]." That means that the old-style code probably doesn't need to abstract away the two translation sides. That seems like a very specific behaviour involving both sides, in an asymmetric way. So perhaps the reasoning becomes easier if the sides are kept concrete. But I'll leave that for your consideration.
Second condition: "old-style" isn't going to be very meaningful to someone who started or will start working on Translations since the Recife rollout. That needs a better term. The way you describe it is nice and clear to me, but probably not to someone without the Rosetta background. Future engineers who read that may be afraid to touch the code (because they don't know what the old style does and why) or remove it (because you make it sound like something that's been dropped from the design).
We discussed this on IRC. It's hard to come up with a good name, but how about "upstream_ for_package" ?
Jeroen