Merge lp://staging/~danilo/launchpad/bug-427843 into lp://staging/launchpad

Proposed by Данило Шеган
Status: Merged
Approved by: Aaron Bentley
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp://staging/~danilo/launchpad/bug-427843
Merge into: lp://staging/launchpad
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~danilo/launchpad/bug-427843
Reviewer Review Type Date Requested Status
Aaron Bentley (community) Approve
Review via email: mp+11697@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Данило Шеган (danilo) wrote :

= Bug #427843 =

This includes mechanical changes to convert distribution and
distroseries translations pages to 3.0.

All links from the navigation menus are moved inline.

= Demo & QA =

https://translations.launchpad.dev/ubuntu/
https://translations.launchpad.dev/ubuntu/hoary
https://translations.launchpad.dev/ubuntu/breezy-autotest

= Tests =

bin/test -vvt translation-import-queue-targets -t
'translations.*stories.distroseries' -t
'translations.*stories.distribution' -t stories.translationgroups

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/translations/browser/configure.zcml
  lib/lp/translations/browser/distroseries.py

lib/lp/translations/stories/distribution/xx-distribution-change-language-pack-admins.txt

lib/lp/translations/stories/distribution/xx-distribution-translations.txt

lib/lp/translations/stories/distroseries/xx-distroseries-language-packs.txt
  lib/lp/translations/stories/distroseries/xx-distroseries-templates.txt

lib/lp/translations/stories/distroseries/xx-distroseries-translations.txt

lib/lp/translations/stories/importqueue/xx-translation-import-queue-targets.txt

lib/lp/translations/stories/translationgroups/10-distro-translation-group.txt
  lib/lp/translations/templates/distribution-language-pack-admin-info.pt
  lib/lp/translations/templates/distribution-translations.pt
  lib/lp/translations/templates/distroseries-translations.pt

Revision history for this message
Aaron Bentley (abentley) wrote :

Looks pretty straightforward.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/translations/browser/configure.zcml'
2--- lib/lp/translations/browser/configure.zcml 2009-09-11 10:55:54 +0000
3+++ lib/lp/translations/browser/configure.zcml 2009-09-13 20:24:35 +0000
4@@ -887,6 +887,13 @@
5 permission="launchpad.TranslationsAdmin"
6 template="../../app/templates/generic-edit.pt"
7 layer="canonical.launchpad.layers.TranslationsLayer"/>
8+ <!-- Language pack admin portlet -->
9+ <browser:page
10+ name="+language-pack-admin-info"
11+ for="lp.registry.interfaces.distribution.IDistribution"
12+ permission="launchpad.View"
13+ template="../templates/distribution-language-pack-admin-info.pt"
14+ layer="canonical.launchpad.layers.TranslationsLayer"/>
15
16 <!-- DistroSeries -->
17
18
19=== modified file 'lib/lp/translations/browser/distroseries.py'
20--- lib/lp/translations/browser/distroseries.py 2009-08-31 13:49:49 +0000
21+++ lib/lp/translations/browser/distroseries.py 2009-09-13 20:24:35 +0000
22@@ -248,6 +248,10 @@
23 def potemplates(self):
24 return list(self.context.getCurrentTranslationTemplates())
25
26+ @property
27+ def is_translation_focus(self):
28+ """Is this DistroSeries the translation focus."""
29+ return self.context.distribution.translation_focus == self.context
30
31 class DistroSeriesTranslationsMenu(NavigationMenu):
32
33
34=== modified file 'lib/lp/translations/stories/distribution/xx-distribution-change-language-pack-admins.txt'
35--- lib/lp/translations/stories/distribution/xx-distribution-change-language-pack-admins.txt 2009-08-13 19:03:36 +0000
36+++ lib/lp/translations/stories/distribution/xx-distribution-change-language-pack-admins.txt 2009-09-14 13:47:28 +0000
37@@ -7,7 +7,7 @@
38
39 >>> browser = setupBrowser(auth='Basic test@canonical.com:test')
40 >>> browser.open('http://translations.launchpad.dev/ubuntu/')
41- >>> browser.getLink('Language pack admin')
42+ >>> browser.getLink('Set language pack administrator')
43 Traceback (most recent call last):
44 ...
45 LinkNotFoundError
46@@ -22,7 +22,7 @@
47
48 >>> browser = setupBrowser(auth='Basic mark@example.com:test')
49 >>> browser.open('http://translations.launchpad.dev/ubuntu/')
50- >>> browser.getLink('Language pack admin').click()
51+ >>> browser.getLink('Set language pack administrator').click()
52
53 Current value is empty.
54
55
56=== modified file 'lib/lp/translations/stories/distribution/xx-distribution-translations.txt'
57--- lib/lp/translations/stories/distribution/xx-distribution-translations.txt 2009-08-23 05:28:49 +0000
58+++ lib/lp/translations/stories/distribution/xx-distribution-translations.txt 2009-09-14 13:47:28 +0000
59@@ -52,7 +52,7 @@
60 And the other Ubuntu distributions should be there too.
61
62 >>> content = find_main_content(browser.contents)
63- >>> print extract_text(content.findAll('h2')[1])
64+ >>> print extract_text(content.findAll('h2')[2])
65 Other versions of Ubuntu
66
67 >>> print extract_text(content.find(id='distroseries-list'))
68@@ -94,7 +94,7 @@
69 And the other Ubuntu distributions should be there too.
70
71 >>> content = find_main_content(browser.contents)
72- >>> print extract_text(content.findAll('h2')[1])
73+ >>> print extract_text(content.findAll('h2')[2])
74 Other versions of Debian
75
76 >>> print extract_text(content.find(id='distroseries-list'))
77
78=== modified file 'lib/lp/translations/stories/distroseries/xx-distroseries-language-packs.txt'
79--- lib/lp/translations/stories/distroseries/xx-distroseries-language-packs.txt 2009-09-01 21:12:37 +0000
80+++ lib/lp/translations/stories/distroseries/xx-distroseries-language-packs.txt 2009-09-14 13:54:29 +0000
81@@ -16,7 +16,7 @@
82
83 >>> admin_browser.open(
84 ... 'http://translations.launchpad.dev/ubuntu/hoary')
85- >>> admin_browser.getLink('Language packs').click()
86+ >>> admin_browser.getLink('See all language packs').click()
87
88 Initially, there is no package selected.
89
90@@ -50,7 +50,7 @@
91 Also, that change is shown in the public language pack listing web page:
92
93 >>> browser.open('http://translations.launchpad.dev/ubuntu/hoary')
94- >>> browser.getLink('Language packs').click()
95+ >>> browser.getLink('See all language packs').click()
96 >>> print extract_text(find_tag_by_id(browser.contents, "language_packs"))
97 Language packs for Ubuntu 5.04
98 ...
99
100=== modified file 'lib/lp/translations/stories/distroseries/xx-distroseries-templates.txt'
101--- lib/lp/translations/stories/distroseries/xx-distroseries-templates.txt 2009-07-16 14:40:28 +0000
102+++ lib/lp/translations/stories/distroseries/xx-distroseries-templates.txt 2009-09-14 13:54:29 +0000
103@@ -11,14 +11,14 @@
104
105 >>> user_browser.open(
106 ... 'http://translations.launchpad.dev/ubuntu/hoary')
107- >>> user_browser.getLink('Templates')
108+ >>> user_browser.getLink('full list of templates')
109 Traceback (most recent call last):
110 ...
111 LinkNotFoundError
112
113 >>> admin_browser.open(
114 ... 'http://translations.launchpad.dev/ubuntu/hoary')
115- >>> admin_browser.getLink('Templates').click()
116+ >>> admin_browser.getLink('full list of templates').click()
117 >>> print admin_browser.url
118 http://translations.launchpad.dev/ubuntu/hoary/+templates
119
120
121=== modified file 'lib/lp/translations/stories/distroseries/xx-distroseries-translations.txt'
122--- lib/lp/translations/stories/distroseries/xx-distroseries-translations.txt 2009-07-16 13:28:25 +0000
123+++ lib/lp/translations/stories/distroseries/xx-distroseries-translations.txt 2009-09-14 13:54:29 +0000
124@@ -50,7 +50,7 @@
125 Launchpad has an option to hide all of the translations for a distribution
126 series. The link to hide translations is not available to anonymous users:
127
128- >>> anon_browser.getLink('Settings')
129+ >>> anon_browser.getLink('Change settings')
130 Traceback (most recent call last):
131 ...
132 LinkNotFoundError
133@@ -67,7 +67,7 @@
134
135 >>> admin_browser.open('http://translations.launchpad.dev/ubuntu/hoary')
136
137- >>> admin_browser.getLink('Settings').click()
138+ >>> admin_browser.getLink('Change settings').click()
139
140 Once the administrator hides all translations...
141
142@@ -151,7 +151,7 @@
143 form where we hide all translations and an admin is able to change it:
144
145 >>> admin_browser.open('http://translations.launchpad.dev/ubuntu/hoary')
146- >>> admin_browser.getLink('Settings').click()
147+ >>> admin_browser.getLink('Change settings').click()
148 >>> admin_browser.getControl(
149 ... 'Defer translation imports').selected
150 False
151@@ -163,7 +163,7 @@
152
153 Once the system accepts the submission, we can see such change applied.
154
155- >>> admin_browser.getLink('Settings').click()
156+ >>> admin_browser.getLink('Change settings').click()
157 >>> admin_browser.getControl(
158 ... 'Defer translation imports').selected
159 True
160
161=== modified file 'lib/lp/translations/stories/importqueue/xx-translation-import-queue-targets.txt'
162--- lib/lp/translations/stories/importqueue/xx-translation-import-queue-targets.txt 2009-09-10 18:35:28 +0000
163+++ lib/lp/translations/stories/importqueue/xx-translation-import-queue-targets.txt 2009-09-14 13:54:29 +0000
164@@ -10,7 +10,7 @@
165 The import queue is linked from the translations page for distribution.
166
167 >>> user_browser.open('http://translations.launchpad.dev/ubuntu')
168- >>> user_browser.getLink('Import queue').click()
169+ >>> user_browser.getLink('Ubuntu import queue').click()
170
171 There is no content for Ubuntu.
172
173@@ -30,7 +30,7 @@
174 The import queue is linked from the translations page for distribution series.
175
176 >>> user_browser.open('http://translations.launchpad.dev/ubuntu/hoary')
177- >>> user_browser.getLink('Import queue').click()
178+ >>> user_browser.getLink('Hoary import queue').click()
179
180 And obviously, given that the ubuntu distribution had no content, Hoary, an
181 Ubuntu distro series has also no content.
182
183=== modified file 'lib/lp/translations/stories/translationgroups/10-distro-translation-group.txt'
184--- lib/lp/translations/stories/translationgroups/10-distro-translation-group.txt 2009-08-31 22:13:07 +0000
185+++ lib/lp/translations/stories/translationgroups/10-distro-translation-group.txt 2009-09-14 13:47:28 +0000
186@@ -26,14 +26,14 @@
187 >>> ubuntu_owner_browser = setupBrowser(
188 ... auth='Basic colin.watson@ubuntulinux.com:test')
189 >>> ubuntu_owner_browser.open(anon_browser.url)
190- >>> ubuntu_owner_browser.getLink('Settings').click()
191+ >>> ubuntu_owner_browser.getLink('Change permissions').click()
192 >>> print ubuntu_owner_browser.title
193 Set translation permissions for Ubuntu
194
195 Other users cannot access this page, nor see the menu link to it.
196
197 >>> user_browser.open(anon_browser.url)
198- >>> user_browser.getLink('Settings').click()
199+ >>> user_browser.getLink('Change permissions').click()
200 Traceback (most recent call last):
201 ...
202 LinkNotFoundError
203
204=== added file 'lib/lp/translations/templates/distribution-language-pack-admin-info.pt'
205--- lib/lp/translations/templates/distribution-language-pack-admin-info.pt 1970-01-01 00:00:00 +0000
206+++ lib/lp/translations/templates/distribution-language-pack-admin-info.pt 2009-09-13 20:24:35 +0000
207@@ -0,0 +1,30 @@
208+<tal:root
209+ xmlns:tal="http://xml.zope.org/namespaces/tal"
210+ xmlns:metal="http://xml.zope.org/namespaces/metal"
211+ xmlns:i18n="http://xml.zope.org/namespaces/i18n"
212+ omit-tag="">
213+
214+ <p tal:condition="context/language_pack_admin">
215+ Language packs are administered by
216+ <span tal:replace="structure
217+ context/language_pack_admin/fmt:link"
218+ >Mr. No
219+ </span>.
220+ <tal:admin
221+ condition="context/required:launchpad.Edit">
222+ <a tal:attributes="
223+ href
224+ context/fmt:url/+select-language-pack-admin"
225+ class="edit sprite"></a>
226+ </tal:admin>
227+ </p>
228+ <tal:admin
229+ condition="context/required:launchpad.Edit">
230+ <p tal:condition="not:context/language_pack_admin">
231+ <a tal:attributes="
232+ href
233+ context/fmt:url/+select-language-pack-admin"
234+ class="edit sprite">Set language pack administrator</a>
235+ </p>
236+ </tal:admin>
237+</tal:root>
238
239=== modified file 'lib/lp/translations/templates/distribution-translations.pt'
240--- lib/lp/translations/templates/distribution-translations.pt 2009-07-17 17:59:07 +0000
241+++ lib/lp/translations/templates/distribution-translations.pt 2009-09-13 20:24:35 +0000
242@@ -3,59 +3,69 @@
243 xmlns:tal="http://xml.zope.org/namespaces/tal"
244 xmlns:metal="http://xml.zope.org/namespaces/metal"
245 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
246- xml:lang="en"
247- lang="en"
248- dir="ltr"
249- metal:use-macro="view/macro:page/onecolumn"
250- i18n:domain="launchpad" >
251+ metal:use-macro="view/macro:page/main_only"
252+>
253
254 <body>
255 <div metal:fill-slot="main">
256+ <ul class="helplinks">
257+ <li>
258+ <a href="https://help.launchpad.net/Translations"
259+ id="link-to-translations-help"
260+ >Help for translations
261+ </a>
262+ </li>
263+ </ul>
264 <h1>Translations</h1>
265
266- <ul class="helplinks">
267- <li>
268- <a href="https://help.launchpad.net/Translations"
269- id="link-to-translations-help"
270- >Help for translations
271- </a>
272- </li>
273- </ul>
274- <tal:translation_focus condition="view/translation_focus">
275- <p>
276- The current translation focus for
277- <span tal:replace="context/displayname">Ubuntu</span> is
278- <span tal:replace="view/translation_focus/version">6.06</span>
279- (<span tal:replace="view/translation_focus/displayname">Dapper</span>),
280- and we encourage you to translate it first.
281- </p>
282- <p id="translation-permissions">
283- <tal:distro replace="context/displayname">This
284- distribution</tal:distro> is translated
285- <tal:hasgroup condition="context/translationgroup">by
286- <a tal:attributes="href context/translationgroup/fmt:url"
287- tal:content="context/translationgroup/title">translators</a>
288- </tal:hasgroup>
289- with <a target="help" href="/+help/permissions-policies.html"
290- tal:content="context/translationpermission/title">certain</a>
291- permissions.
292- <tal:permissions condition="context/required:launchpad.Edit">
293- You can modify permissions on the
294- <a
295- tal:define="link context/menu:navigation/settings"
296- tal:attributes="href link/url"
297- >Settings</a> page.
298- </tal:permissions>
299- </p>
300-
301- <h2>
302- <span tal:replace="view/translation_focus/version">5.04</span>:
303- <span tal:replace="view/translation_focus/title">
304- Hoary Hedgehog
305- </span>
306- </h2>
307- <div tal:replace="structure view/translation_focus/@@+langchart" />
308- </tal:translation_focus>
309+ <tal:translation_focus condition="view/translation_focus"
310+ define="target view/translation_focus">
311+
312+ <div class="top-portlet">
313+ <p>
314+ Launchpad currently recommends translating
315+ <tal:target replace="structure target/fmt:link/+translations"
316+ >trunk</tal:target>.
317+ </p>
318+ </div>
319+ <div class="yui-g">
320+ <div class="yui-u first">
321+ <div class="portlet">
322+ <h3>Permissions</h3>
323+ <p>
324+ <tal:permissions replace="
325+ structure
326+ context/@@+portlet-translation-groups-and-permission"/>
327+ </p>
328+ </div>
329+ </div>
330+ <div class="yui-u">
331+ <div class="portlet">
332+ <h3>Administration</h3>
333+ <p>To see all the translation files that are waiting to be
334+ imported, please look at
335+ <a tal:attributes="href context/fmt:url/+imports"
336+ tal:content="string:${context/displayname} import queue">
337+ import queue</a>.
338+ </p>
339+
340+ <div tal:replace="structure
341+ context/@@+language-pack-admin-info" />
342+ </div>
343+ </div>
344+ </div>
345+
346+ <h2>
347+ <span tal:replace="view/translation_focus/version">5.04</span>:
348+ <span tal:replace="view/translation_focus/title">
349+ Hoary Hedgehog
350+ </span>
351+ </h2>
352+ <div tal:replace="structure view/translation_focus/@@+langchart" />
353+ <div class="translations-legend">
354+ <div tal:replace="structure context/@@+rosetta-status-legend" />
355+ </div>
356+ </tal:translation_focus>
357
358 <tal:secondary condition="view/secondary_translatable_serieses">
359 <h2 tal:condition="view/translation_focus">
360
361=== modified file 'lib/lp/translations/templates/distroseries-translations.pt'
362--- lib/lp/translations/templates/distroseries-translations.pt 2009-07-17 17:59:07 +0000
363+++ lib/lp/translations/templates/distroseries-translations.pt 2009-09-13 20:24:35 +0000
364@@ -2,33 +2,140 @@
365 xmlns="http://www.w3.org/1999/xhtml"
366 xmlns:tal="http://xml.zope.org/namespaces/tal"
367 xmlns:metal="http://xml.zope.org/namespaces/metal"
368- xml:lang="en"
369- lang="en"
370- dir="ltr"
371- metal:use-macro="view/macro:page/onecolumn">
372+ metal:use-macro="view/macro:page/main_only">
373
374 <body>
375-<div metal:fill-slot="main">
376- <ul class="helplinks">
377- <li>
378- <a href="https://help.launchpad.net/Translations"
379- id="link-to-translations-help"
380- >Help for translations
381- </a>
382- </li>
383- </ul>
384- <h1>Translation status by language</h1>
385-
386- <div tal:replace="structure context/@@+langchart" />
387- <div tal:replace="structure context/@@+rosetta-status-legend" />
388-
389- <ul>
390- <li class="edit">
391- <a href="/+editmylanguages">Customize displayed languages</a>
392- </li>
393- </ul>
394-
395-</div>
396-</body>
397+ <div metal:fill-slot="main">
398+ <ul class="helplinks">
399+ <li>
400+ <a href="https://help.launchpad.net/Translations"
401+ id="link-to-translations-help"
402+ >Help for translations
403+ </a>
404+ </li>
405+ </ul>
406+ <h1>Translation status by language</h1>
407+
408+ <div class="top-portlet">
409+ <p tal:condition="not:view/is_translation_focus">
410+ Launchpad currently recommends translating
411+ <tal:target replace="
412+ structure
413+ context/distribution/translation_focus/fmt:link/+translations"
414+ >Hoary</tal:target>.
415+ </p>
416+ <p tal:condition="view/is_translation_focus">
417+ <tal:target replace="context/displayname">Hoary</tal:target> is
418+ the current translation focus for
419+ <tal:distro replace="structure context/distribution/fmt:link">
420+ Ubuntu
421+ </tal:distro>.
422+ </p>
423+ </div>
424+ <div class="yui-g">
425+ <div class="yui-u first">
426+ <div class="portlet">
427+ <h3>Permissions</h3>
428+ <p>
429+ <tal:permissions replace="
430+ structure
431+ context/distribution/@@+portlet-translation-groups-and-permission"/>
432+ </p>
433+ </div>
434+ </div>
435+ <div class="yui-u">
436+ <div class="portlet">
437+ <h3>Administration</h3>
438+ <p>Translation files that are waiting to be imported are shown in
439+ the
440+ <a tal:attributes="href context/fmt:url/+imports"
441+ tal:content="string:${context/displayname} import queue">
442+ import queue</a>.
443+ </p>
444+ <p tal:condition="context/required:launchpad.Edit">
445+ To manage all the translation templates in
446+ <tal:series replace="context/displayname">Hoary</tal:series>,
447+ see the
448+ <a tal:attributes="href context/menu:navigation/templates/url">
449+ full list of templates</a>.
450+ </p>
451+ <p>
452+ <tal:series replace="context/displayname">Hoary</tal:series>
453+ translations are
454+ <em tal:condition="not:context/hide_all_translations">
455+ visible to everyone<!--
456+ --></em><em tal:condition="context/hide_all_translations">
457+ hidden from everyone but translation admins</em>.
458+ Import queue is
459+ <em tal:condition="not:context/defer_translation_imports">
460+ active<!--
461+ --></em><em tal:condition="context/defer_translation_imports">
462+ currently halted for
463+ <tal:series replace="context/displayname">
464+ Hoary
465+ </tal:series></em>.
466+ <a tal:attributes="href context/menu:navigation/admin/url"
467+ tal:condition="context/required:launchpad.TranslationsAdmin"
468+ class="edit sprite">
469+ Change settings
470+ </a>
471+ </p>
472+ </div>
473+ </div>
474+
475+ <div class="yui-u first">
476+ <div class="portlet">
477+ <h3>Language packs</h3>
478+
479+ <div tal:replace="
480+ structure
481+ context/distribution/@@+language-pack-admin-info" />
482+
483+ <div>
484+ <strong>Current base pack:</strong>
485+ <a tal:condition="context/language_pack_base"
486+ tal:attributes="href context/language_pack_base/file/http_url">
487+ <tal:export-date
488+ replace="context/language_pack_base/date_exported/fmt:datetime" />
489+ <img tal:condition="context/language_pack_base"
490+ alt="download icon" src="/@@/download" />
491+ </a>
492+ <tal:not-export-date condition="not: context/language_pack_base">
493+ none yet
494+ </tal:not-export-date>
495+ </div>
496+ <div>
497+ <strong>Update pack:</strong>
498+ <a tal:condition="context/language_pack_delta"
499+ tal:attributes="href context/language_pack_delta/file/http_url">
500+ <tal:export-date
501+ replace="context/language_pack_delta/date_exported/fmt:datetime" />
502+ <img tal:condition="context/language_pack_delta"
503+ alt="download icon" src="/@@/download" />
504+ </a>
505+ <tal:not-export-date condition="not: context/language_pack_delta">
506+ none yet
507+ </tal:not-export-date>
508+ </div>
509+ <p>
510+ <a tal:attributes="
511+ href context/menu:navigation/language_packs/url">
512+ See all language packs</a>
513+ </p>
514+ </div>
515+ </div>
516+ </div>
517+
518+ <tal:stats condition="view/distroserieslanguages">
519+ <div class="yui-b top-portlet">
520+ <h2>Translation statistics</h2>
521+ <div tal:replace="structure context/@@+langchart" />
522+ <div class="translations-legend">
523+ <div tal:replace="structure context/@@+rosetta-status-legend" />
524+ </div>
525+ </div>
526+ </tal:stats>
527+ </div>
528+ </body>
529 </html>
530
531