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
1=== modified file 'lib/lp/translations/browser/pofile.py'
2--- lib/lp/translations/browser/pofile.py 2010-03-23 22:38:04 +0000
3+++ lib/lp/translations/browser/pofile.py 2010-03-24 18:31:36 +0000
4@@ -616,12 +616,8 @@
5 " recognised as a file that can be imported.")
6 return
7
8- # We only set the 'from_upstream' flag if the upload is marked as an
9- # upstream upload.
10- if self.form.get('upload_type') == 'upstream':
11- from_upstream = True
12- else:
13- from_upstream = False
14+ # Uploads on this form are never from upstream.
15+ from_upstream = False
16
17 if self.context.path is None:
18 # The POFile is a dummy one, we use the filename as the path.
19
20=== removed file 'lib/lp/translations/help/imported-upload.html'
21--- lib/lp/translations/help/imported-upload.html 2010-02-19 12:05:10 +0000
22+++ lib/lp/translations/help/imported-upload.html 1970-01-01 00:00:00 +0000
23@@ -1,61 +0,0 @@
24-<html>
25- <head>
26- <title>Importing a .po file from upstream</title>
27- <link rel="stylesheet" type="text/css"
28- href="/+icing/yui/current/build/cssreset/reset.css" />
29- <link rel="stylesheet" type="text/css"
30- href="/+icing/yui/current/build/cssfonts/fonts.css" />
31- <link rel="stylesheet" type="text/css"
32- href="/+icing/yui/current/build/cssbase/base.css" />
33- </head>
34- <body>
35- <h1>Importing a .po file from upstream</h1>
36-
37- <p>
38- Many projects have either full or partial translation efforts
39- outside of Launchpad. If you work on translations for such a
40- project, either its partial translation in Launchpad or its
41- translation for a distribution such as Ubuntu, you should import
42- the externally generated translations from time to time.
43- </p>
44-
45- <h2>How Launchpad prioritizes imported translation strings</h2>
46-
47- <p>To help ensure the best quality translations, Launchpad
48- prioritizes translation strings differently depending on where
49- they were made.
50- </p>
51-
52- <p>
53- In general, a translation made in Launchpad will take precedence
54- over a translation imported from upstream, meaning that most
55- imports will only overwrite a string if it also was an import.
56- </p>
57-
58- <p>
59- There are, though, two important exceptions:
60- </p>
61-
62- <ul>
63- <li>
64- The first time that the translation of a string, in a
65- particular language, is imported into Launchpad, it will take
66- precedence over any existing translation made in that language
67- in Launchpad.
68- </li>
69-
70- <li>
71- If an imported string matches the translation already made in
72- Launchpad. This means that the translation will now be
73- overwritten by any subsequent imports, if they differ. However,
74- making a change to the translation in Launchpad would reset it
75- to take precedence over imported strings.
76- </li>
77- </ul>
78-
79- <p>You should also take a look at Launchpad's <a href="https://help.launchpad.net/Translations/YourProject/ImportPolicy" target="_blank">
80- translation import guidelines</a>.
81- </p>
82-
83- </body>
84-</html>
85
86=== renamed file 'lib/lp/translations/help/updated-upload.html' => 'lib/lp/translations/help/pofile-upload.html'
87--- lib/lp/translations/help/updated-upload.html 2010-01-12 16:16:27 +0000
88+++ lib/lp/translations/help/pofile-upload.html 2010-03-24 18:31:36 +0000
89@@ -13,13 +13,9 @@
90
91 <p>
92 When you download a .po file from Launchpad, update it, and then
93- upload your edited .po file back to Launchpad, you need to select
94- "Updated translation" on the upload page.
95- </p>
96-
97- <p>
98- Launchpad treats the strings in that .po file just the same as if
99- the translations had been made using Launchpad's web interface.
100+ upload your edited .po file back to Launchpad, it will be treated
101+ the same as if the translations had been made using Launchpad's web
102+ interface.
103 </p>
104
105 <h2>Structuring the .po file</h2>
106
107=== modified file 'lib/lp/translations/stories/translationgroups/55-pofile-upload.txt'
108--- lib/lp/translations/stories/translationgroups/55-pofile-upload.txt 2010-03-23 18:39:03 +0000
109+++ lib/lp/translations/stories/translationgroups/55-pofile-upload.txt 2010-03-24 18:31:36 +0000
110@@ -69,24 +69,10 @@
111 Ignored your upload because the file you uploaded was not recognised as
112 a file that can be imported.
113
114-Now let's upload one that is from upstream.
115-
116- >>> upload = admin_browser.getControl(name='file')
117- >>> upload.add_file(StringIO(af_file), 'application/x-po', 'af.po')
118- >>> admin_browser.getControl(name='upload_type').value = ['upstream']
119- >>> admin_browser.getControl('Upload').click()
120- >>> print admin_browser.url
121- http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/af/+upload
122-
123- >>> for tag in find_tags_by_class(admin_browser.contents, 'message'):
124- ... print tag.renderContents()
125- Thank you for your upload. It will be automatically reviewed...
126-
127-And one that is not from upstream.
128-
129- >>> upload = admin_browser.getControl(name='file')
130- >>> upload.add_file(StringIO(af_file), 'application/x-po', 'af.po')
131- >>> admin_browser.getControl(name='upload_type').value = ['user']
132+With all the correct information, a file can be uploaded.
133+
134+ >>> upload = admin_browser.getControl(name='file')
135+ >>> upload.add_file(StringIO(af_file), 'application/x-po', 'af.po')
136 >>> admin_browser.getControl('Upload').click()
137 >>> print admin_browser.url
138 http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/af/+upload
139
140=== modified file 'lib/lp/translations/templates/pofile-upload.pt'
141--- lib/lp/translations/templates/pofile-upload.pt 2010-01-07 16:39:19 +0000
142+++ lib/lp/translations/templates/pofile-upload.pt 2010-03-24 18:31:36 +0000
143@@ -14,38 +14,11 @@
144 <h2>Choose a file to upload</h2>
145 <div class="fields">
146 <input id="file_input" name="file" type="file" />
147- <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>
148- </div>
149-
150- <h2>What kind of upload is this?</h2>
151- <div class="fields">
152- <div class="alignment">
153-
154- <input id="user_type" name="upload_type" type="radio"
155- value="user" checked="checked" class="selector"/>
156- <span class="content">
157- <label for="user_type">
158- Updated translation
159- </label>
160- <p class="discreet">
161- You have exported a PO file from Launchpad, worked on it
162- off-line, and now you want to contribute your updates back. (<a href="/+help/updated-upload.html" target="help">More about updated translations</a>)
163- </p>
164- </span>
165-
166- <input id="upstream_type" name="upload_type" type="radio"
167- value="upstream" class="selector"/>
168- <span class="content">
169- <label for="upstream_type">
170- Imported translation
171- </label>
172- <p class="discreet">
173- You want to upload a more recent translation from upstream
174- release or from a source package. (<a href="/+help/imported-upload.html" target="help">More about imported translations</a>)
175- </p>
176- </span>
177+ <div class="discreet">This should be a <code>.po</code> file that
178+ was previously exported from Launchpad and contains updated
179+ translations.<br />
180+ (<a href="/+help/pofile-upload.html" target="help">More about uploading updated translations</a>)
181 </div>
182-
183 </div>
184
185 <div class="actions">

Subscribers

People subscribed via source and target branches