Merge lp:~henninge/launchpad/bug-545365-published-uploads-ui into lp:~launchpad/launchpad/recife

Proposed by Henning Eggers
Status: Merged
Merge reported by: Henning Eggers
Merged at revision: not available
Proposed branch: lp:~henninge/launchpad/bug-545365-published-uploads-ui
Merge into: lp:~launchpad/launchpad/recife
Diff against target: 185 lines (+13/-123)
5 files modified
lib/lp/translations/browser/pofile.py (+2/-6)
lib/lp/translations/help/imported-upload.html (+0/-61)
lib/lp/translations/help/pofile-upload.html (+3/-7)
lib/lp/translations/stories/translationgroups/55-pofile-upload.txt (+4/-18)
lib/lp/translations/templates/pofile-upload.pt (+4/-31)
To merge this branch: bzr merge lp:~henninge/launchpad/bug-545365-published-uploads-ui
Reviewer Review Type Date Requested Status
Jeroen T. Vermeulen (community) code Approve
Review via email: mp+22029@code.launchpad.net

Description of the change

= Bug 545365 =

Remove the "upload_type" radio box from POFile:+upload template and view. The import queue entry created by this form will always be marked as from_upstream = False.

== Test ==

bin/test -vvt stories.translationgroups

To post a comment you must log in.
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Thanks for preserving the help text about updated POFiles. One typo though: "tranlations"

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/translations/browser/pofile.py'
--- lib/lp/translations/browser/pofile.py 2010-03-23 22:38:04 +0000
+++ lib/lp/translations/browser/pofile.py 2010-03-24 18:31:36 +0000
@@ -616,12 +616,8 @@
616 " recognised as a file that can be imported.")616 " recognised as a file that can be imported.")
617 return617 return
618618
619 # We only set the 'from_upstream' flag if the upload is marked as an619 # Uploads on this form are never from upstream.
620 # upstream upload.620 from_upstream = False
621 if self.form.get('upload_type') == 'upstream':
622 from_upstream = True
623 else:
624 from_upstream = False
625621
626 if self.context.path is None:622 if self.context.path is None:
627 # The POFile is a dummy one, we use the filename as the path.623 # The POFile is a dummy one, we use the filename as the path.
628624
=== removed file 'lib/lp/translations/help/imported-upload.html'
--- lib/lp/translations/help/imported-upload.html 2010-02-19 12:05:10 +0000
+++ lib/lp/translations/help/imported-upload.html 1970-01-01 00:00:00 +0000
@@ -1,61 +0,0 @@
1<html>
2 <head>
3 <title>Importing a .po file from upstream</title>
4 <link rel="stylesheet" type="text/css"
5 href="/+icing/yui/current/build/cssreset/reset.css" />
6 <link rel="stylesheet" type="text/css"
7 href="/+icing/yui/current/build/cssfonts/fonts.css" />
8 <link rel="stylesheet" type="text/css"
9 href="/+icing/yui/current/build/cssbase/base.css" />
10 </head>
11 <body>
12 <h1>Importing a .po file from upstream</h1>
13
14 <p>
15 Many projects have either full or partial translation efforts
16 outside of Launchpad. If you work on translations for such a
17 project, either its partial translation in Launchpad or its
18 translation for a distribution such as Ubuntu, you should import
19 the externally generated translations from time to time.
20 </p>
21
22 <h2>How Launchpad prioritizes imported translation strings</h2>
23
24 <p>To help ensure the best quality translations, Launchpad
25 prioritizes translation strings differently depending on where
26 they were made.
27 </p>
28
29 <p>
30 In general, a translation made in Launchpad will take precedence
31 over a translation imported from upstream, meaning that most
32 imports will only overwrite a string if it also was an import.
33 </p>
34
35 <p>
36 There are, though, two important exceptions:
37 </p>
38
39 <ul>
40 <li>
41 The first time that the translation of a string, in a
42 particular language, is imported into Launchpad, it will take
43 precedence over any existing translation made in that language
44 in Launchpad.
45 </li>
46
47 <li>
48 If an imported string matches the translation already made in
49 Launchpad. This means that the translation will now be
50 overwritten by any subsequent imports, if they differ. However,
51 making a change to the translation in Launchpad would reset it
52 to take precedence over imported strings.
53 </li>
54 </ul>
55
56 <p>You should also take a look at Launchpad's <a href="https://help.launchpad.net/Translations/YourProject/ImportPolicy" target="_blank">
57 translation import guidelines</a>.
58 </p>
59
60 </body>
61</html>
620
=== renamed file 'lib/lp/translations/help/updated-upload.html' => 'lib/lp/translations/help/pofile-upload.html'
--- lib/lp/translations/help/updated-upload.html 2010-01-12 16:16:27 +0000
+++ lib/lp/translations/help/pofile-upload.html 2010-03-24 18:31:36 +0000
@@ -13,13 +13,9 @@
1313
14 <p>14 <p>
15 When you download a .po file from Launchpad, update it, and then15 When you download a .po file from Launchpad, update it, and then
16 upload your edited .po file back to Launchpad, you need to select16 upload your edited .po file back to Launchpad, it will be treated
17 "Updated translation" on the upload page.17 the same as if the translations had been made using Launchpad's web
18 </p>18 interface.
19
20 <p>
21 Launchpad treats the strings in that .po file just the same as if
22 the translations had been made using Launchpad's web interface.
23 </p>19 </p>
2420
25 <h2>Structuring the .po file</h2>21 <h2>Structuring the .po file</h2>
2622
=== modified file 'lib/lp/translations/stories/translationgroups/55-pofile-upload.txt'
--- lib/lp/translations/stories/translationgroups/55-pofile-upload.txt 2010-03-23 18:39:03 +0000
+++ lib/lp/translations/stories/translationgroups/55-pofile-upload.txt 2010-03-24 18:31:36 +0000
@@ -69,24 +69,10 @@
69 Ignored your upload because the file you uploaded was not recognised as69 Ignored your upload because the file you uploaded was not recognised as
70 a file that can be imported.70 a file that can be imported.
7171
72Now let's upload one that is from upstream.72With all the correct information, a file can be uploaded.
7373
74 >>> upload = admin_browser.getControl(name='file')74 >>> upload = admin_browser.getControl(name='file')
75 >>> upload.add_file(StringIO(af_file), 'application/x-po', 'af.po')75 >>> upload.add_file(StringIO(af_file), 'application/x-po', 'af.po')
76 >>> admin_browser.getControl(name='upload_type').value = ['upstream']
77 >>> admin_browser.getControl('Upload').click()
78 >>> print admin_browser.url
79 http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/af/+upload
80
81 >>> for tag in find_tags_by_class(admin_browser.contents, 'message'):
82 ... print tag.renderContents()
83 Thank you for your upload. It will be automatically reviewed...
84
85And one that is not from upstream.
86
87 >>> upload = admin_browser.getControl(name='file')
88 >>> upload.add_file(StringIO(af_file), 'application/x-po', 'af.po')
89 >>> admin_browser.getControl(name='upload_type').value = ['user']
90 >>> admin_browser.getControl('Upload').click()76 >>> admin_browser.getControl('Upload').click()
91 >>> print admin_browser.url77 >>> print admin_browser.url
92 http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/af/+upload78 http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/af/+upload
9379
=== modified file 'lib/lp/translations/templates/pofile-upload.pt'
--- lib/lp/translations/templates/pofile-upload.pt 2010-01-07 16:39:19 +0000
+++ lib/lp/translations/templates/pofile-upload.pt 2010-03-24 18:31:36 +0000
@@ -14,38 +14,11 @@
14 <h2>Choose a file to upload</h2>14 <h2>Choose a file to upload</h2>
15 <div class="fields">15 <div class="fields">
16 <input id="file_input" name="file" type="file" />16 <input id="file_input" name="file" type="file" />
17 <div class="discreet">This should be a <code>.po</code> file and follow the <a href="https://help.launchpad.net/Translations/YourProject/ImportPolicy">translation import guidelines</a>.</div>17 <div class="discreet">This should be a <code>.po</code> file that
18 </div>18 was previously exported from Launchpad and contains updated
1919 translations.<br />
20 <h2>What kind of upload is this?</h2>20 (<a href="/+help/pofile-upload.html" target="help">More about uploading updated translations</a>)
21 <div class="fields">
22 <div class="alignment">
23
24 <input id="user_type" name="upload_type" type="radio"
25 value="user" checked="checked" class="selector"/>
26 <span class="content">
27 <label for="user_type">
28 Updated translation
29 </label>
30 <p class="discreet">
31 You have exported a PO file from Launchpad, worked on it
32 off-line, and now you want to contribute your updates back. (<a href="/+help/updated-upload.html" target="help">More about updated translations</a>)
33 </p>
34 </span>
35
36 <input id="upstream_type" name="upload_type" type="radio"
37 value="upstream" class="selector"/>
38 <span class="content">
39 <label for="upstream_type">
40 Imported translation
41 </label>
42 <p class="discreet">
43 You want to upload a more recent translation from upstream
44 release or from a source package. (<a href="/+help/imported-upload.html" target="help">More about imported translations</a>)
45 </p>
46 </span>
47 </div>21 </div>
48
49 </div>22 </div>
5023
51 <div class="actions">24 <div class="actions">

Subscribers

People subscribed via source and target branches