Merge lp:~danilo/launchpad/project-and-products into lp:launchpad
- project-and-products
- Merge into devel
Proposed by
Данило Шеган
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~danilo/launchpad/project-and-products |
Merge into: | lp:launchpad |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~danilo/launchpad/project-and-products |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Celso Providelo (community) | code | Approve | |
Review via email:
|
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Данило Шеган (danilo) wrote : | # |
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Celso Providelo (cprov) wrote : | # |
Hi Danilo,
Thanks for working on these pages, they looks good.
I agree that this branch fits in ui=rs, trivial but precise changes.
Land it!
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/configure.zcml' |
2 | --- lib/lp/translations/browser/configure.zcml 2009-09-01 11:09:53 +0000 |
3 | +++ lib/lp/translations/browser/configure.zcml 2009-09-10 11:44:08 +0000 |
4 | @@ -815,6 +815,7 @@ |
5 | for="lp.registry.interfaces.project.IProject" |
6 | permission="zope.Public" |
7 | name="+translations" |
8 | + class="lp.translations.browser.project.ProjectView" |
9 | template="../templates/project-translations.pt" |
10 | layer="canonical.launchpad.layers.TranslationsLayer"/> |
11 | <browser:page |
12 | |
13 | === modified file 'lib/lp/translations/browser/product.py' |
14 | --- lib/lp/translations/browser/product.py 2009-08-31 00:31:01 +0000 |
15 | +++ lib/lp/translations/browser/product.py 2009-09-10 18:35:28 +0000 |
16 | @@ -29,7 +29,7 @@ |
17 | facet = 'translations' |
18 | links = ( |
19 | 'overview', |
20 | - 'translators', |
21 | + 'settings', |
22 | 'translationdownload', |
23 | 'imports', |
24 | ) |
25 | @@ -39,7 +39,7 @@ |
26 | return Link('+imports', text) |
27 | |
28 | @enabled_with_permission('launchpad.Edit') |
29 | - def translators(self): |
30 | + def settings(self): |
31 | text = 'Settings' |
32 | return Link('+changetranslators', text, icon='edit') |
33 | |
34 | @@ -113,3 +113,10 @@ |
35 | 'potemplates': translatable.getCurrentTranslationTemplates(), |
36 | 'base_url': canonical_url(translatable) |
37 | } |
38 | + |
39 | + @cachedproperty |
40 | + def untranslatable_series(self): |
41 | + """Return series which are not yet set up for translations.""" |
42 | + all_series = set(self.context.serieses) |
43 | + translatable = set(self.context.translatable_series) |
44 | + return all_series - translatable |
45 | |
46 | === modified file 'lib/lp/translations/browser/project.py' |
47 | --- lib/lp/translations/browser/project.py 2009-08-31 00:31:01 +0000 |
48 | +++ lib/lp/translations/browser/project.py 2009-09-10 11:44:08 +0000 |
49 | @@ -23,10 +23,10 @@ |
50 | |
51 | usedfor = IProject |
52 | facet = 'translations' |
53 | - links = ['products', 'changetranslators', 'overview'] |
54 | + links = ['products', 'settings', 'overview'] |
55 | |
56 | @enabled_with_permission('launchpad.Edit') |
57 | - def changetranslators(self): |
58 | + def settings(self): |
59 | text = 'Settings' |
60 | return Link('+changetranslators', text, icon='edit') |
61 | |
62 | @@ -41,7 +41,12 @@ |
63 | |
64 | |
65 | class ProjectView(LaunchpadView): |
66 | - pass |
67 | + """A view for `IProject` in the translations context.""" |
68 | + @property |
69 | + def untranslatables(self): |
70 | + translatables = set(self.context.translatables()) |
71 | + all_products = set(self.context.products) |
72 | + return list(all_products - translatables) |
73 | |
74 | |
75 | class ProjectChangeTranslatorsView(TranslationsMixin, ProjectEditView): |
76 | |
77 | === modified file 'lib/lp/translations/stories/importqueue/xx-translation-import-queue-targets.txt' |
78 | --- lib/lp/translations/stories/importqueue/xx-translation-import-queue-targets.txt 2009-09-01 20:06:37 +0000 |
79 | +++ lib/lp/translations/stories/importqueue/xx-translation-import-queue-targets.txt 2009-09-10 18:35:28 +0000 |
80 | @@ -51,7 +51,7 @@ |
81 | The import queue is linked from the translations page for products. |
82 | |
83 | >>> user_browser.open('http://translations.launchpad.dev/evolution') |
84 | - >>> user_browser.getLink('Import queue').click() |
85 | + >>> user_browser.getLink('Evolution import queue').click() |
86 | |
87 | This time, we do have content for this product: |
88 | |
89 | |
90 | === modified file 'lib/lp/translations/stories/productseries/xx-productseries-translation-export.txt' |
91 | --- lib/lp/translations/stories/productseries/xx-productseries-translation-export.txt 2009-08-28 15:54:41 +0000 |
92 | +++ lib/lp/translations/stories/productseries/xx-productseries-translation-export.txt 2009-09-10 18:35:28 +0000 |
93 | @@ -22,7 +22,7 @@ |
94 | |
95 | >>> user_browser.open( |
96 | ... 'http://translations.launchpad.dev/evolution/+translations') |
97 | - >>> user_browser.getLink('Download').click() |
98 | + >>> user_browser.getLink('download').click() |
99 | >>> print user_browser.url |
100 | http://translations.launchpad.dev/evolution/trunk/+export |
101 | |
102 | |
103 | === modified file 'lib/lp/translations/stories/project/xx-project-translations.txt' |
104 | --- lib/lp/translations/stories/project/xx-project-translations.txt 2009-07-10 12:49:30 +0000 |
105 | +++ lib/lp/translations/stories/project/xx-project-translations.txt 2009-09-10 18:35:28 +0000 |
106 | @@ -11,28 +11,33 @@ |
107 | |
108 | >>> evo_link = browser.getLink('Evolution') |
109 | >>> print evo_link.url |
110 | - http://translations.launchpad.dev/evolution |
111 | + http://launchpad.dev/evolution/+translations |
112 | |
113 | >>> browser.open('http://translations.launchpad.dev/gnome') |
114 | >>> print browser.url |
115 | http://translations.launchpad.dev/gnome |
116 | |
117 | -Netapplet is another product of GNOME project. It has translations, but it's not |
118 | -using Launchpad officially, so it's not in this page. |
119 | - |
120 | - >>> browser.getLink('Network Applet') |
121 | - Traceback (most recent call last): |
122 | - ... |
123 | - LinkNotFoundError |
124 | +Netapplet is another product of GNOME project. It has translations, |
125 | +but it's not using Launchpad officially, so it's not listed among |
126 | +translatable projects. |
127 | + |
128 | + >>> translated_projects = find_tag_by_id( |
129 | + ... browser.contents, 'translatable-projects') |
130 | + >>> link = translated_projects.find(text='Network Applet') |
131 | + >>> print link |
132 | + None |
133 | + |
134 | +It does show up among untranslated projects. |
135 | + |
136 | + >>> untranslated_projects = find_tag_by_id( |
137 | + ... browser.contents, 'untranslatable-projects') |
138 | + >>> link = untranslated_projects.find(text='NetApplet').parent |
139 | + >>> link['href'] |
140 | + u'http://launchpad.dev/netapplet/+translations' |
141 | |
142 | Let's confirm what we just stated. |
143 | |
144 | >>> anon_browser.open('http://launchpad.dev/gnome') |
145 | - >>> print anon_browser.title |
146 | - The GNOME Project in Launchpad |
147 | - |
148 | -Netapplet is in fact a product belonging to GNOME project. |
149 | - |
150 | >>> anon_browser.getLink('NetApplet').click() |
151 | >>> print anon_browser.title |
152 | Network Applet in Launchpad |
153 | @@ -54,17 +59,6 @@ |
154 | ... 'portlet-obsolete-translatable-series') is None |
155 | True |
156 | |
157 | -but administrators see translations disabled. |
158 | - |
159 | - >>> admin_browser.open(anon_browser.url) |
160 | - >>> print admin_browser.title |
161 | - Translations of Network Applet in Launchpad |
162 | - >>> print extract_text(find_tag_by_id( |
163 | - ... admin_browser.contents, |
164 | - ... 'portlet-obsolete-translatable-series')) |
165 | - All product series with obsolete templates |
166 | - NetApplet trunk series |
167 | - |
168 | alsa-utils is a product that doesn't belong to GNOME project. It has |
169 | translations and is using Launchpad Translations officially, and it |
170 | shouldn't appear in GNOME project translations page. |
171 | @@ -106,13 +100,3 @@ |
172 | >>> alsa_utils_spanish = browser.getLink('Spanish') |
173 | >>> print alsa_utils_spanish.url |
174 | http://translations.../alsa-utils/trunk/+pots/alsa-utils/es/+translate |
175 | - |
176 | -The translations page has also a link to the product search page to see |
177 | -whether a product is registered in Launchpad. |
178 | - |
179 | - >>> browser.open('http://translations.launchpad.dev/gnome') |
180 | - >>> print browser.url |
181 | - http://translations.launchpad.dev/gnome |
182 | - >>> browser.getLink('registered with Launchpad').click() |
183 | - >>> print browser.url |
184 | - http://translations.launchpad.dev/projects |
185 | |
186 | === modified file 'lib/lp/translations/stories/standalone/xx-product-export.txt' |
187 | --- lib/lp/translations/stories/standalone/xx-product-export.txt 2009-08-28 15:54:41 +0000 |
188 | +++ lib/lp/translations/stories/standalone/xx-product-export.txt 2009-09-10 18:35:28 +0000 |
189 | @@ -4,7 +4,7 @@ |
190 | translation downloads. |
191 | |
192 | >>> user_browser.open('http://translations.launchpad.dev/evolution') |
193 | - >>> download = user_browser.getLink('Download "trunk"') |
194 | + >>> download = user_browser.getLink('download') |
195 | |
196 | For products, that option downloads translations for the series that is |
197 | currently the preferred translation target. |
198 | @@ -45,7 +45,7 @@ |
199 | >>> product.official_rosetta = False |
200 | >>> product.sync() |
201 | >>> user_browser.open('http://translations.launchpad.dev/evolution') |
202 | - >>> user_browser.getLink('Download "trunk"') |
203 | + >>> user_browser.getLink('download') |
204 | Traceback (most recent call last): |
205 | ... |
206 | LinkNotFoundError |
207 | @@ -54,7 +54,7 @@ |
208 | >>> product.official_rosetta = True |
209 | >>> product.sync() |
210 | >>> user_browser.open('http://translations.launchpad.dev/evolution') |
211 | - >>> user_browser.getLink('Download "trunk"') is not None |
212 | + >>> user_browser.getLink('download') is not None |
213 | True |
214 | |
215 | |
216 | @@ -63,7 +63,7 @@ |
217 | Only logged-in users get the option to request downloads. |
218 | |
219 | >>> anon_browser.open('http://translations.launchpad.dev/evolution/') |
220 | - >>> anon_browser.getLink('Download "trunk"').click() |
221 | + >>> anon_browser.getLink('download').click() |
222 | Traceback (most recent call last): |
223 | ... |
224 | LinkNotFoundError |
225 | |
226 | === modified file 'lib/lp/translations/stories/standalone/xx-product-translations.txt' |
227 | --- lib/lp/translations/stories/standalone/xx-product-translations.txt 2009-08-13 19:03:36 +0000 |
228 | +++ lib/lp/translations/stories/standalone/xx-product-translations.txt 2009-09-10 18:35:28 +0000 |
229 | @@ -79,9 +79,9 @@ |
230 | >>> unprivileged = setupBrowser(auth='Basic no-priv@canonical.com:test') |
231 | >>> unprivileged.open('http://translations.launchpad.dev/gnomebaker') |
232 | >>> print extract_text(find_main_content(unprivileged.contents)) |
233 | - Overview / Import queue |
234 | + Gnome Baker |
235 | + ... |
236 | Translation setup needed |
237 | - ... |
238 | This project is not configured to use Launchpad for translations. |
239 | The gnomebaker project is not set up for translation in Launchpad. |
240 | You might want to talk with Foo Bar, the project registrant, about |
241 | @@ -121,9 +121,9 @@ |
242 | |
243 | >>> anon_browser.open('http://translations.launchpad.dev/gnomebaker') |
244 | >>> print extract_text(find_main_content(anon_browser.contents)) |
245 | - Overview / Import queue |
246 | + Gnome Baker |
247 | + ... |
248 | Translation setup needed |
249 | - ... |
250 | This project is not configured to use Launchpad for translations. |
251 | The gnomebaker project is not set up for translation in Launchpad. |
252 | If you are Foo Bar, log in to begin the setup process. |
253 | @@ -153,21 +153,12 @@ |
254 | >>> print find_tag_by_id(anon_browser.contents, 'language-chart') |
255 | None |
256 | |
257 | -When browsing it as an admin, we can see that it has some 'obsolete' |
258 | -translation templates, which is just that the product is not using |
259 | -them anymore. |
260 | +Even when browsing it as an admin, 'obsolete' translations are not |
261 | +shown since it is not marked as using Launchpad for translation. |
262 | |
263 | >>> admin_browser.open('http://translations.launchpad.dev/netapplet') |
264 | - >>> print extract_text( |
265 | - ... find_tag_by_id(admin_browser.contents, |
266 | - ... 'portlet-obsolete-translatable-series')) |
267 | - All product series with obsolete templates |
268 | - NetApplet trunk series |
269 | - |
270 | -While we can see that anonymous people are not getting such information: |
271 | - |
272 | - >>> print find_tag_by_id(anon_browser.contents, |
273 | - ... 'portlet-obsolete-translatable-series') |
274 | + >>> print find_tag_by_id(admin_browser.contents, |
275 | + ... 'portlet-obsolete-translatable-series') |
276 | None |
277 | |
278 | If the netapplet project is updated to use Launchpad for translations... |
279 | |
280 | === modified file 'lib/lp/translations/stories/translationgroups/15-product-translation-group.txt' |
281 | --- lib/lp/translations/stories/translationgroups/15-product-translation-group.txt 2009-08-31 22:13:07 +0000 |
282 | +++ lib/lp/translations/stories/translationgroups/15-product-translation-group.txt 2009-09-10 18:35:28 +0000 |
283 | @@ -36,13 +36,12 @@ |
284 | ... find_tag_by_id(netapplet_owner_browser.contents, |
285 | ... 'translation-permissions')) |
286 | NetApplet (Unspecified) is translated with Open permissions. |
287 | - You can modify permissions on the Settings page. |
288 | |
289 | Now let's make sure we can see the page to let us change translation |
290 | group and permissions. |
291 | |
292 | >>> translations_page_url = netapplet_owner_browser.url |
293 | - >>> netapplet_owner_browser.getLink('Settings').click() |
294 | + >>> netapplet_owner_browser.getLink('Change permissions').click() |
295 | >>> change_translators_url = netapplet_owner_browser.url |
296 | |
297 | >>> print netapplet_owner_browser.title |
298 | @@ -57,11 +56,11 @@ |
299 | ... 'Translation group').displayValue |
300 | ['(no value)'] |
301 | |
302 | -Ordinary users cannot see the "Settings" link or the page it |
303 | +Ordinary users cannot see the "Change permissions" link or the page it |
304 | leads to. |
305 | |
306 | >>> user_browser.open(translations_page_url) |
307 | - >>> user_browser.getLink('Settings').click() |
308 | + >>> user_browser.getLink('Change permissions').click() |
309 | Traceback (most recent call last): |
310 | ... |
311 | LinkNotFoundError |
312 | |
313 | === modified file 'lib/lp/translations/stories/translationgroups/20-project-translationgroup.txt' |
314 | --- lib/lp/translations/stories/translationgroups/20-project-translationgroup.txt 2009-08-31 22:13:07 +0000 |
315 | +++ lib/lp/translations/stories/translationgroups/20-project-translationgroup.txt 2009-09-10 18:35:28 +0000 |
316 | @@ -13,7 +13,7 @@ |
317 | And now make sure we can see the form to change the translation group |
318 | and permissions on a project. |
319 | |
320 | - >>> gnome_owner_browser.getLink('Settings').click() |
321 | + >>> gnome_owner_browser.getLink('Change permissions').click() |
322 | >>> print gnome_owner_browser.title |
323 | Set translation permissions for GNOME |
324 | |
325 | @@ -21,7 +21,7 @@ |
326 | to access the page it leads to. |
327 | |
328 | >>> user_browser.open(translations_page_url) |
329 | - >>> user_browser.getLink('Settings').click() |
330 | + >>> user_browser.getLink('Change permissions').click() |
331 | Traceback (most recent call last): |
332 | ... |
333 | LinkNotFoundError |
334 | |
335 | === modified file 'lib/lp/translations/stories/translationgroups/46-test-distro-structured-permissions.txt' |
336 | --- lib/lp/translations/stories/translationgroups/46-test-distro-structured-permissions.txt 2009-08-31 22:13:07 +0000 |
337 | +++ lib/lp/translations/stories/translationgroups/46-test-distro-structured-permissions.txt 2009-09-10 18:35:28 +0000 |
338 | @@ -13,7 +13,7 @@ |
339 | as the translation group for the netapplet product... |
340 | |
341 | >>> admin_browser.getLink('Translations').click() |
342 | - >>> admin_browser.getLink('Settings').click() |
343 | + >>> admin_browser.getLink('Change permissions').click() |
344 | >>> admin_browser.getControl('Translation group').displayOptions |
345 | ['(no value)', 'Single-language Translators', |
346 | 'The PolyGlot Translation Group', 'Just a testing team'] |
347 | |
348 | === modified file 'lib/lp/translations/templates/hastranslationgroup-portlet-translation-groups-and-permission.pt' |
349 | --- lib/lp/translations/templates/hastranslationgroup-portlet-translation-groups-and-permission.pt 2009-07-17 17:59:07 +0000 |
350 | +++ lib/lp/translations/templates/hastranslationgroup-portlet-translation-groups-and-permission.pt 2009-09-10 18:47:57 +0000 |
351 | @@ -1,22 +1,21 @@ |
352 | -<div class="portlet" id="portlet-translation-permissions"> |
353 | - <h2>Translation permissions</h2> |
354 | - <div class="portletBody"> |
355 | - <table> |
356 | - <tr> |
357 | - <th>Translation group:</th> |
358 | - <td tal:condition="not: context/translationgroup"> |
359 | - Not assigned |
360 | - </td> |
361 | - <td tal:condition="context/translationgroup"> |
362 | - <a tal:attributes="href context/translationgroup/fmt:url" |
363 | - tal:content="context/translationgroup/title" /> |
364 | - </td> |
365 | - </tr> |
366 | - <tr> |
367 | - <th>Permissions:</th> |
368 | - <td tal:content="context/translationpermission/title">Open</td> |
369 | - </tr> |
370 | - </table> |
371 | +<div id="portlet-translation-permissions" |
372 | + xmlns="http://www.w3.org/1999/xhtml" |
373 | + xmlns:tal="http://xml.zope.org/namespaces/tal"> |
374 | + <p id="translation-permissions"> |
375 | + <tal:product replace="structure context/fmt:link">This |
376 | + project</tal:product> is translated |
377 | + <tal:hasgroup condition="context/translationgroup">by |
378 | + <a tal:replace="structure context/translationgroup/fmt:link" |
379 | + >translators</a> |
380 | + </tal:hasgroup> |
381 | + with <a target="help" href="/+help/permissions-policies.html" |
382 | + tal:content="context/translationpermission/title">certain</a> |
383 | + permissions. |
384 | + </p> |
385 | + <div tal:condition="context/required:launchpad.Edit"> |
386 | + <a class="edit sprite" |
387 | + tal:define="link context/menu:navigation/settings" |
388 | + tal:attributes="href link/url" |
389 | + >Change permissions</a> |
390 | </div> |
391 | </div> |
392 | - |
393 | |
394 | === modified file 'lib/lp/translations/templates/product-portlet-translatables.pt' |
395 | --- lib/lp/translations/templates/product-portlet-translatables.pt 2009-07-17 17:59:07 +0000 |
396 | +++ lib/lp/translations/templates/product-portlet-translatables.pt 2009-09-10 18:35:28 +0000 |
397 | @@ -6,10 +6,9 @@ |
398 | |
399 | <div class="portlet" id="portlet-translatable-branches" |
400 | tal:condition="context/translatable_series"> |
401 | - <h2>All translatable series</h2> |
402 | + <h3>All translatable series</h3> |
403 | |
404 | <div class="portletBody portletContent"> |
405 | - |
406 | <ul> |
407 | <li class="translations" |
408 | tal:repeat="series context/translatable_series"> |
409 | @@ -18,14 +17,37 @@ |
410 | series title</a> |
411 | </li> |
412 | </ul> |
413 | - |
414 | + </div> |
415 | +</div> |
416 | + |
417 | +<div tal:condition="context/required:launchpad.Edit"> |
418 | + <div class="portlet" id="portlet-untranslatable-branches" |
419 | + tal:condition="view/untranslatable_series"> |
420 | + <h3>Set up translations for other series</h3> |
421 | + |
422 | + <div class="portletBody portletContent"> |
423 | + <ul> |
424 | + <li class="translations" |
425 | + tal:repeat="series view/untranslatable_series"> |
426 | + <a tal:content="series/title" |
427 | + tal:attributes="href string:${series/fmt:url}/+translations"> |
428 | + series title</a> — |
429 | + <a tal:attributes=" |
430 | + href string:${series/fmt:url}/+translations-upload"> |
431 | + upload</a> or |
432 | + <a tal:attributes=" |
433 | + href string:${series/fmt:url}/+translations-settings"> |
434 | + set up a bzr import</a>. |
435 | + </li> |
436 | + </ul> |
437 | + </div> |
438 | </div> |
439 | </div> |
440 | |
441 | <div class="portlet" id="portlet-translatable-packages" |
442 | tal:condition="context/translatable_packages"> |
443 | |
444 | - <h2>All translatable distribution packages</h2> |
445 | + <h3>All translatable distribution packages</h3> |
446 | |
447 | <div class="portletBody portletContent "> |
448 | |
449 | |
450 | === modified file 'lib/lp/translations/templates/product-translations.pt' |
451 | --- lib/lp/translations/templates/product-translations.pt 2009-07-17 17:59:07 +0000 |
452 | +++ lib/lp/translations/templates/product-translations.pt 2009-09-10 18:35:28 +0000 |
453 | @@ -2,30 +2,13 @@ |
454 | xmlns="http://www.w3.org/1999/xhtml" |
455 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
456 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
457 | - xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
458 | - xml:lang="en" |
459 | - lang="en" |
460 | - dir="ltr" |
461 | - metal:use-macro="view/macro:page/onecolumn" |
462 | - i18n:domain="launchpad" |
463 | + metal:use-macro="view/macro:page/main_only" |
464 | > |
465 | - <!-- metal:use-macro="context/@@main_template/master" --> |
466 | |
467 | <body> |
468 | <div metal:fill-slot="main" |
469 | tal:define="uses_translations view/uses_translations; |
470 | admin_user context/required:launchpad.TranslationsAdmin"> |
471 | - <tal:uses-translations condition="uses_translations"> |
472 | - <h1>Translation overview</h1> |
473 | - </tal:uses-translations> |
474 | - <tal:not-uses-translations condition="not: uses_translations"> |
475 | - <h1 tal:condition="admin_user"> |
476 | - How to start using Launchpad Translations |
477 | - </h1> |
478 | - <h1 tal:condition="not: admin_user"> |
479 | - Translation setup needed |
480 | - </h1> |
481 | - </tal:not-uses-translations> |
482 | <ul class="helplinks"> |
483 | <li> |
484 | <a href="https://help.launchpad.net/Translations" |
485 | @@ -35,31 +18,80 @@ |
486 | </li> |
487 | </ul> |
488 | <tal:uses-translations condition="uses_translations"> |
489 | + <h1>Translation overview</h1> |
490 | + </tal:uses-translations> |
491 | + <tal:not-uses-translations condition="not: uses_translations"> |
492 | + <h1 tal:condition="admin_user"> |
493 | + How to start using Launchpad Translations |
494 | + </h1> |
495 | + <h1 tal:condition="not: admin_user"> |
496 | + Translation setup needed |
497 | + </h1> |
498 | + </tal:not-uses-translations> |
499 | + <tal:uses-translations condition="uses_translations"> |
500 | <tal:translatable define="target context/primary_translatable"> |
501 | - <p id="translation-permissions"> |
502 | - <tal:product replace="structure context/fmt:link">This |
503 | - project</tal:product> is translated |
504 | - <tal:hasgroup condition="context/translationgroup">by |
505 | - <a tal:attributes="href context/translationgroup/fmt:url" |
506 | - tal:content="context/translationgroup/title">translators</a> |
507 | - </tal:hasgroup> |
508 | - with <a target="help" href="/+help/permissions-policies.html" |
509 | - tal:content="context/translationpermission/title">certain</a> |
510 | - permissions. |
511 | - <tal:permissions condition="context/required:launchpad.Edit"> |
512 | - You can modify permissions on the |
513 | - <a |
514 | - tal:define="link context/menu:navigation/translators" |
515 | - tal:attributes="href link/url" |
516 | - >Settings</a> page. |
517 | - </tal:permissions> |
518 | - </p> |
519 | - <h2>Translation for |
520 | - <span tal:replace="target/displayname">main</span></h2> |
521 | - <div tal:replace="structure target/@@+languages" /> |
522 | - <div style="height:1em;"></div> |
523 | - <div tal:replace="structure context/@@+rosetta-status-legend" /> |
524 | - <div tal:replace="structure context/@@+portlet-translatables" /> |
525 | + |
526 | + <div class="top-portlet"> |
527 | + </div> |
528 | + |
529 | + <div class="yui-g"> |
530 | + <div class="yui-u first"> |
531 | + <div class="portlet"> |
532 | + <h3>Translation details</h3> |
533 | + <p> |
534 | + Launchpad currently recommends translating |
535 | + <tal:target replace="structure target/fmt:link/+translations" |
536 | + >trunk</tal:target>. |
537 | + <tal:admins condition="context/required:launchpad.AnyPerson"> |
538 | + You can also |
539 | + <a tal:attributes="href target/fmt:url/+export" |
540 | + >download</a> or |
541 | + <a tal:attributes=" |
542 | + href target/fmt:url/+translations-upload" |
543 | + >upload</a> translations for |
544 | + <tal:target replace="structure target/name" |
545 | + >trunk</tal:target>. |
546 | + </tal:admins> |
547 | + </p> |
548 | + <p>To see all the translation files that are waiting to be |
549 | + imported, please look at |
550 | + <a tal:attributes="href context/fmt:url/+imports" |
551 | + tal:content="string:${context/displayname} import queue"> |
552 | + import queue</a>. |
553 | + </p> |
554 | + </div> |
555 | + <div class="portlet"> |
556 | + <h3>Permissions</h3> |
557 | + <p> |
558 | + <tal:permissions replace=" |
559 | + structure |
560 | + context/@@+portlet-translation-groups-and-permission"/> |
561 | + </p> |
562 | + </div> |
563 | + </div> |
564 | + <div class="yui-u"> |
565 | + <div> |
566 | + <tal:registrant-or-admin |
567 | + condition="admin_user"> |
568 | + <tal:has-obsolete-entries |
569 | + condition="context/obsolete_translatable_series"> |
570 | + <div tal:replace=" |
571 | + structure |
572 | + context/@@+portlet-obsolete-translatables" /> |
573 | + </tal:has-obsolete-entries> |
574 | + </tal:registrant-or-admin> |
575 | + </div> |
576 | + <div tal:replace="structure context/@@+portlet-translatables" /> |
577 | + </div> |
578 | + </div> |
579 | + |
580 | + <div class="yui-b"> |
581 | + <h2>Translation for |
582 | + <span tal:replace="target/displayname">main</span></h2> |
583 | + <div tal:replace="structure target/@@+languages" /> |
584 | + <div style="height:1em;"></div> |
585 | + <div tal:replace="structure context/@@+rosetta-status-legend" /> |
586 | + </div> |
587 | </tal:translatable> |
588 | </tal:uses-translations> |
589 | <tal:not-uses-translations condition="not: uses_translations"> |
590 | @@ -123,14 +155,6 @@ |
591 | </p> |
592 | </tal:other> |
593 | </tal:not-uses-translations> |
594 | - <tal:registrant-or-admin |
595 | - condition="admin_user"> |
596 | - <tal:has-obsolete-entries |
597 | - condition="context/obsolete_translatable_series"> |
598 | - <div |
599 | - tal:replace="structure context/@@+portlet-obsolete-translatables" /> |
600 | - </tal:has-obsolete-entries> |
601 | - </tal:registrant-or-admin> |
602 | </div> |
603 | </body> |
604 | </html> |
605 | |
606 | === modified file 'lib/lp/translations/templates/productseries-translations-languages.pt' |
607 | --- lib/lp/translations/templates/productseries-translations-languages.pt 2009-07-17 17:59:07 +0000 |
608 | +++ lib/lp/translations/templates/productseries-translations-languages.pt 2009-09-10 07:24:24 +0000 |
609 | @@ -3,7 +3,7 @@ |
610 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
611 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
612 | omit-tag=""> |
613 | - <table class="sortable listing" style="width:auto;" id="languagestats"> |
614 | + <table class="sortable listing" style="width:100%;" id="languagestats"> |
615 | <thead> |
616 | <tr> |
617 | <th>Language</th> |
618 | |
619 | === modified file 'lib/lp/translations/templates/productseries-translations.pt' |
620 | --- lib/lp/translations/templates/productseries-translations.pt 2009-07-17 17:59:07 +0000 |
621 | +++ lib/lp/translations/templates/productseries-translations.pt 2009-09-10 07:24:24 +0000 |
622 | @@ -70,7 +70,7 @@ |
623 | <tal:permissions condition="context/product/required:launchpad.Edit"> |
624 | You can modify permissions on the |
625 | <a |
626 | - tal:define="link context/product/menu:navigation/translators" |
627 | + tal:define="link context/product/menu:navigation/settings" |
628 | tal:attributes="href link/url" |
629 | >project settings</a> page. |
630 | </tal:permissions> |
631 | |
632 | === modified file 'lib/lp/translations/templates/project-translations.pt' |
633 | --- lib/lp/translations/templates/project-translations.pt 2009-07-17 17:59:07 +0000 |
634 | +++ lib/lp/translations/templates/project-translations.pt 2009-09-10 18:35:28 +0000 |
635 | @@ -2,80 +2,88 @@ |
636 | xmlns="http://www.w3.org/1999/xhtml" |
637 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
638 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
639 | - xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
640 | - xml:lang="en" |
641 | - lang="en" |
642 | - dir="ltr" |
643 | - metal:use-macro="view/macro:page/onecolumn" |
644 | - i18n:domain="launchpad" |
645 | + metal:use-macro="view/macro:page/main_only" |
646 | > |
647 | - <body> |
648 | - <metal:portlets fill-slot="portlets"> |
649 | - <tal:portlet |
650 | - replace="structure context/@@+portlet-translation-groups-and-permission" |
651 | - /> |
652 | - <tal:portlet replace="structure context/@@+portlet-preflangs" /> |
653 | - </metal:portlets> |
654 | - |
655 | - <metal:heading fill-slot="pageheading"> |
656 | - |
657 | - <tal:block condition="view/required:launchpad.Edit"> |
658 | - <p tal:condition="not: context/products" class="warning message"> |
659 | - There are no projects registered for |
660 | - <span tal:replace="context/displayname">project displayname</span>. |
661 | - <br /> |
662 | - You need to <a href="+newproduct">register another project that is |
663 | - part of <tal:project replace="context/displayname" /></a> or associate |
664 | - an existing project with it. |
665 | - </p> |
666 | - </tal:block> |
667 | - |
668 | - <tal:untranslatable condition="not: context/translatables"> |
669 | - <h1 tal:condition="context/required:launchpad.Edit"> |
670 | - How to set up translations |
671 | - </h1> |
672 | - <h1 tal:condition="not: context/required:launchpad.Edit"> |
673 | - Translation setup needed |
674 | - </h1> |
675 | - </tal:untranslatable> |
676 | - </metal:heading> |
677 | - |
678 | - <div metal:fill-slot="main"> |
679 | - |
680 | - <h2>Translatable applications</h2> |
681 | +<body> |
682 | + <div metal:fill-slot="main"> |
683 | + |
684 | + <h1>Translatable applications</h1> |
685 | + |
686 | + <div class="top-portlet"> |
687 | + <p tal:condition="context/translatables"> |
688 | + Select a project you want to translate into your own language. |
689 | + </p> |
690 | + <p tal:condition="not:context/translatables"> |
691 | + There are no translatable projects in |
692 | + <span tal:content="context/displayname">GNOME</span>. |
693 | + </p> |
694 | + <p tal:condition="not:view/required:launchpad.Edit"> |
695 | + If a project for <span tal:content="context/displayname">Project |
696 | + </span> is not listed here, get in touch with |
697 | + <a tal:replace="structure context/owner/fmt:link">owner</a> who is |
698 | + the administrator for the project. |
699 | + </p> |
700 | |
701 | <p> |
702 | - Select a project to begin translating it into your own language. |
703 | - If a project for <span tal:content="context/displayname">Project |
704 | - </span> is not listed here, check that it’s |
705 | - <a href="/projects">registered with Launchpad</a>, and follow the |
706 | - instructions described at |
707 | - <a href="https://help.launchpad.net/RosettaFAQ">RosettaFAQ</a> |
708 | - </p> |
709 | - |
710 | - <table class="listing"> |
711 | - <thead> |
712 | - <tr> |
713 | - <th>Project</th> |
714 | - <th>Title</th> |
715 | - </tr> |
716 | - </thead> |
717 | - <tbody> |
718 | - <tr tal:repeat="product context/translatables"> |
719 | - <td> |
720 | - <img alt="" src="/@@/product" /> |
721 | - <a tal:content="product/displayname" |
722 | - tal:attributes=" |
723 | - href product/fmt:url">Evolution</a> |
724 | - </td> |
725 | - <td> |
726 | - <span tal:replace="product/title"> |
727 | - The Evolution Groupware Application |
728 | - </span> |
729 | - </td> |
730 | - </tr> |
731 | - </tbody> |
732 | - </table> |
733 | - </div><!--main--> |
734 | - </body> |
735 | + <tal:permissions |
736 | + replace="structure |
737 | + context/@@+portlet-translation-groups-and-permission" |
738 | + /> |
739 | + </p> |
740 | + </div> |
741 | + |
742 | + <div class="yui-g"> |
743 | + <div class="yui-u first"> |
744 | + <div class="portlet" id="translatable-projects"> |
745 | + <h3>Translatable projects</h3> |
746 | + <dl tal:condition="context/translatables"> |
747 | + <tal:project repeat="product context/translatables"> |
748 | + <dt> |
749 | + <a tal:replace="structure product/fmt:link/+translations"> |
750 | + Evolution |
751 | + </a> |
752 | + </dt> |
753 | + <dd> |
754 | + <span tal:replace="product/title"> |
755 | + The Evolution Groupware Application |
756 | + </span> |
757 | + </dd> |
758 | + </tal:project> |
759 | + </dl> |
760 | + </div> |
761 | + </div> |
762 | + <div class="yui-u"> |
763 | + <div class="portlet" id="untranslatable-projects"> |
764 | + <h3>Other projects in |
765 | + <tal:group replace="context/displayname">GNOME</tal:group> |
766 | + </h3> |
767 | + <p> |
768 | + These projects are not yet set up for translation in Launchpad. |
769 | + </p> |
770 | + <dl tal:condition="view/untranslatables"> |
771 | + <tal:project repeat="product view/untranslatables"> |
772 | + <dt> |
773 | + <a tal:replace="structure product/fmt:link/+translations"> |
774 | + Evolution |
775 | + </a> |
776 | + </dt> |
777 | + <dd> |
778 | + <span tal:replace="product/title"> |
779 | + The Evolution Groupware Application |
780 | + </span> |
781 | + </dd> |
782 | + </tal:project> |
783 | + </dl> |
784 | + </div> |
785 | + </div> |
786 | + </div> |
787 | + <div class="yui-b"> |
788 | + <p tal:condition="view/required:launchpad.Edit"> |
789 | + <a class="add sprite" href="+newproduct">Add another project</a> |
790 | + </p> |
791 | + </div> |
792 | + |
793 | + |
794 | + </div><!--main--> |
795 | +</body> |
796 | </html> |
797 |
= Bug #427486 =
Migrate product- translations. pt and project- translations. pt pages to
3.0 layout with mostly mechanical changes.
Xmllint reports problem in a page I have touched just so it doesn't
OOPS, which is not migrated yet (next step), so that's where I'll fix
xmllint issues as well.
== Proposed fix ==
1. https:/ /translations. launchpad. dev/gnome (project page)
* Move permissions display and settings inline
* Add untranslated applications next to translated applications
(this is just a very minor step, which is why changes are considered
'mechanical': in the future, this page should aggregate statistics
over all translatable projects)
2. https:/ /translations. launchpad. dev/evolution /translations. launchpad. dev/firefox (not using translations, strictly mechanical changes)
https:/
* Move 'translation focus' (direct link, and upload and download links
for those who can see them) inline.
* Move 'import queue' link inline.
* Move permissions display and settings inline (reuse the same portlet)
* Use two column layout and list all translatable series on the top of
the page (people had trouble to find these when they were at the bottom)
* For those who manage translations for this project, also show a list of
all series which do not have translations with direct links on how they
can set them up
== Tests ==
Strictly relevant tests:
bin/test -vvt xx-productserie s-translation- export. txt -t xx-product- export. txt -t xx-project- translations. txt -t xx-product- translations. txt -t xx-translation- import- queue-targets. txt -t stories. translationgrou ps
But basically, all translations tests cover this:
bin/test -vvt 'translations. *stories'
== Demo and Q/A ==
https:/ /translations. launchpad. dev/gnome /translations. launchpad. dev/evolution /translations. launchpad. dev/firefox
https:/
https:/
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files: translations/ browser/ project. py translations/ browser/ configure. zcml translations/ stories/ standalone/ xx-product- translations. txt translations/ stories/ translationgrou ps/20-project- translationgrou p.txt translations/ stories/ standalone/ xx-product- export. txt translations/ templates/ hastranslationg roup-portlet- translation- groups- and-permission. pt translations/ templates/ productseries- translations. pt translations/ templates/ product- translations. pt translations/ browser/ product. py translations/ templates/ project- translations. pt translations/ stories/ productseries/ xx-productserie s-translation- export. txt translations/ stories/ importqueue/ xx-translation- import- queue-targets. txt translations/ stories/ translationgrou ps/46-test- distro- structured- permissions. txt translations/ templates/ product- portlet- translatables. pt translations/ templates/ productseries- translations- languages. pt translations/ stories/ translationgrou ps/15-product- translation- group.txt translations/ stories/ project/ xx-project- translations. ..
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/