Merge lp:~danilo/launchpad/bug-516317 into lp:launchpad

Proposed by Данило Шеган
Status: Merged
Approved by: Данило Шеган
Approved revision: no longer in the source branch.
Merged at revision: 12155
Proposed branch: lp:~danilo/launchpad/bug-516317
Merge into: lp:launchpad
Diff against target: 654 lines (+88/-112)
21 files modified
lib/canonical/launchpad/pagetests/basics/notfound-traversals.txt (+2/-2)
lib/lp/registry/browser/configure.zcml (+0/-7)
lib/lp/registry/browser/distribution.py (+2/-2)
lib/lp/registry/browser/product.py (+1/-9)
lib/lp/registry/configure.zcml (+2/-8)
lib/lp/registry/interfaces/distribution.py (+4/-3)
lib/lp/registry/interfaces/product.py (+2/-2)
lib/lp/translations/browser/configure.zcml (+5/-6)
lib/lp/translations/browser/distribution.py (+10/-9)
lib/lp/translations/browser/product.py (+11/-14)
lib/lp/translations/stories/distribution/xx-distribution-translations.txt (+6/-5)
lib/lp/translations/stories/standalone/xx-potemplate-index.txt (+9/-18)
lib/lp/translations/stories/translationfocus/xx-product-translationfocus.txt (+6/-4)
lib/lp/translations/stories/translationgroups/10-distro-translation-group.txt (+3/-3)
lib/lp/translations/stories/translationgroups/15-product-translation-group.txt (+4/-4)
lib/lp/translations/stories/translationgroups/45-test-distro-restricted-permissions.txt (+2/-1)
lib/lp/translations/stories/translationgroups/46-test-distro-structured-permissions.txt (+1/-1)
lib/lp/translations/stories/translationgroups/xx-change-translation-policy.txt (+10/-9)
lib/lp/translations/templates/distribution-translations.pt (+4/-0)
lib/lp/translations/templates/hastranslationgroup-portlet-translation-groups-and-permission.pt (+0/-5)
lib/lp/translations/templates/project-translations.pt (+4/-0)
To merge this branch: bzr merge lp:~danilo/launchpad/bug-516317
Reviewer Review Type Date Requested Status
Henning Eggers (community) ui,code Approve
Launchpad code reviewers Pending
Review via email: mp+44746@code.launchpad.net

Commit message

[r=henninge][ui=henninge][bug=516317] Sanitize and unify translation settings pages.

Description of the change

= Bug 516317 =

Merge +settings and +configure-translations page and update the links which say "Change permissions" to say "Configure translations".

Caveats:

- At the moment, products have double link to "configure translations" page: http://people.canonical.com/~danilo/screenshots/evolution-translations.png.
- At the moment, Ubuntu doesn't have "configure translations" near the top, even though I think it should (where it says what's the default focus): http://people.canonical.com/~danilo/screenshots/ubuntu-translations.png
- I haven't updated the project group page (see eg. https://translations.launchpad.dev/gnome) because you can't change anything but permissions there
- Ideally, we'd have all this ajaxified and we could eg. change permissions just-in-place, be able to set up per-series translation settings while choosing translation focus... But hey :)
- I am unsure about "custom language codes" link: I feel it should be close to "Configure translations" link (maybe even available from the settings page)

Though I'd like to fix all of these, I still think getting these onto single translations configuration page is a win in itself and I'd probably be happy if I get your input on the first two points: should I keep the double "configure translations" link on the project page (I'd like to get rid of the first one, but since that one was added by registry, I want second opinion :), and what should I do for the distro page (I'd like to have a "change" button near the translation focus description)?

FWIW, remaining lint issue is due to comment being treated as empty line.

== Tests ==

bin/test -cvvm lp.translations -t stories

== Demo and Q/A ==

https://translations.launchpad.dev/evolution
https://translations.launchpad.dev/ubuntu

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/registry/configure.zcml
  lib/lp/registry/browser/configure.zcml
  lib/lp/registry/browser/product.py
  lib/lp/registry/interfaces/distribution.py
  lib/lp/registry/interfaces/product.py
  lib/lp/translations/browser/configure.zcml
  lib/lp/translations/browser/distribution.py
  lib/lp/translations/browser/product.py
  lib/lp/translations/stories/distribution/xx-distribution-translations.txt
  lib/lp/translations/stories/standalone/xx-potemplate-index.txt
  lib/lp/translations/stories/translationfocus/xx-product-translationfocus.txt
  lib/lp/translations/stories/translationgroups/10-distro-translation-group.txt
  lib/lp/translations/stories/translationgroups/15-product-translation-group.txt
  lib/lp/translations/stories/translationgroups/46-test-distro-structured-permissions.txt
  lib/lp/translations/stories/translationgroups/xx-change-translation-policy.txt
  lib/lp/translations/templates/hastranslationgroup-portlet-translation-groups-and-permission.pt

./lib/lp/registry/interfaces/product.py
     982: E301 expected 1 blank line, found 2

To post a comment you must log in.
Revision history for this message
Henning Eggers (henninge) wrote :

Hi Danilo,
thank you for doing this and also for pointing out the caveats - makes life easy for me. ;)

I think there should be only one "Configure translations" link and it should be near the top. I guess the intention of that placement near the help link is to make it easy for project maintainers to start on translations. That is not so important on distributions as they don't get started very often. Also, the current placement at the bottom is in the "permissions" portlet but this page is not just about permissions any more, even before this branch. So, a general placement in the top portlet seems logical.

Another little thing: The check box on the distribution configuration page is labelled "Translations for this project are done in Launchpad" - can you put "distribution" there, please?

Cheers,
Henning

review: Needs Fixing (ui)
Revision history for this message
Данило Шеган (danilo) wrote :

Ok, I've got rid of the double link and added a top-level link for the distribution. I didn't change "project" to "distribution" for official_rosetta in the interface since it's still extended by other interfaces like IProduct.

Revision history for this message
Henning Eggers (henninge) wrote :
Download full text (8.4 KiB)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Danilo,
thank you for this branch, great improvement in this. I am happy with you
landing this but please consider my few little comments.

 review approve code,ui

Cheers,
Henning

> === modified file 'lib/lp/registry/browser/configure.zcml'
> === modified file 'lib/lp/registry/browser/distribution.py'
> --- lib/lp/registry/browser/distribution.py 2010-12-16 19:59:20 +0000
> +++ lib/lp/registry/browser/distribution.py 2010-12-29 12:49:35 +0000
> @@ -430,7 +430,7 @@
> def configure_translations(self):
> text = 'Configure translations'
> summary = 'Allow users to provide translations for this project.'
> - return Link('+edit', text, summary, icon='edit')
> + return Link('+configure-translations', text, summary, icon='edit')

This may be missing a site="translations" parameter but I just checked the
other links on the project page and they all go to the root site. In fact they
seem to be available on all sites. All other links to +configure-translations
go to the translations site. I don't know if there is some kind of concept
behind this setup or if it is just an oversight.

For a distribution, +configure-translations is only available on the
translations site. This adds to my confusion here.

But I don't think you need to do anything about it now. ;)

>
>
> class DerivativeDistributionOverviewMenu(DistributionOverviewMenu):
>
> === modified file 'lib/lp/registry/browser/product.py'
> === modified file 'lib/lp/registry/configure.zcml'
> === modified file 'lib/lp/registry/interfaces/distribution.py'
> --- lib/lp/registry/interfaces/distribution.py 2010-12-01 11:26:57 +0000
> +++ lib/lp/registry/interfaces/distribution.py 2010-12-29 12:49:35 +0000
> @@ -284,9 +284,9 @@
> "get the full functionality of LP")
>
> translation_focus = Choice(
> - title=_("Translation Focus"),
> + title=_("Translation focus"),
> description=_(
> - "The DistroSeries that should get the translation effort focus."),
> + "The release series translators should focus on."),

"The release series *that* translators should focus on." is much better to read.

> required=False,
> vocabulary='FilteredDistroSeries')
>
> @@ -636,7 +636,8 @@
> archive = ubuntu.main_archive
> series = ubuntu.current_series
> print archive.getPublishedSources(exact_match=True,
> - source_name="apport", distro_series=series)[0].source_package_version
> + source_name="apport",
> + distro_series=series)[0].source_package_version
> """
> export_as_webservice_entry()
>
>
> === modified file 'lib/lp/registry/interfaces/product.py'
> --- lib/lp/registry/interfaces/product.py 2010-12-01 11:26:57 +0000
> +++ lib/lp/registry/interfaces/product.py 2010-12-29 12:49:35 +0000
> @@ -679,11 +679,11 @@
>
> translation_focus = exported(
> ReferenceChoice(
> - title=_("Translation Focus"), required=False,
> + title=_("Translation focus"), required=False,
> vocabulary='FilteredProductSeries',
> schema=IProductSeri...

Read more...

review: Approve (code,ui)
Revision history for this message
Henning Eggers (henninge) :
review: Approve (ui,code)
Revision history for this message
Данило Шеган (danilo) wrote :

Henning, thanks again for the review. I didn't apply all of your
comments though, so see below.

У сре, 29. 12 2010. у 16:08 +0000, Henning Eggers пише:
>
> This may be missing a site="translations" parameter but I just checked
> the other links on the project page and they all go to the root site.
> In fact they seem to be available on all sites. All other links to
> +configure-translations go to the translations site. I don't know if
> there is some kind of concept behind this setup or if it is just an
> oversight.
>
> For a distribution, +configure-translations is only available on the
> translations site. This adds to my confusion here.

Indeed. As explained on IRC, all this is intentional, but just because
I touch on work done by others. Ideally, I think we should just let
them live on the translations site, but that should be made a general
policy. I didn't change distribution one because that one is basically
entirely different, and I brought them only slightly closer together (by
using the same page ID and narrative).

> > + "The release series translators should focus on."),
>
> "The release series *that* translators should focus on." is much
> better to read.

I disagree, and looking online, so do many others (especially in
writing). I've still adjusted it (in both places) so as to make my nice
reviewer happy :)

As for the facet attribute, entire section is included in <facet
facet="translations"> tag so I wanted to cancel it out explicitely.
Still, considering it's useless, I removed it.

> > class DistributionSettingsView(TranslationsMixin,
> DistributionEditView):
> > - label = "Set permissions and policies"
> > - field_names = ["translationgroup", "translationpermission"]
> > -
> > - @property
> > - def page_title(self):
> > - return "Set translation permissions for %s" % (
> > - self.context.displayname)
> > + label = "Translations settings"
>
> Yeah! Finally this page is converted to 3.0! ;) I think, though, that
> it is custom to include the displayname of the context in the label.

I believe that we (LP team) have had a long discussion about this in the
past, and agreed that it isn't. The result of not including it makes
the following critical elements as such:

| Settings : Translations : Ubuntu (Browser title)
+-------------------------------------------------
| __
| / \ Ubuntu Linux
| \ /
| ^^ Overview Code Bugs *Translations* Answers
|
| <h1>Translation settings</h1>
| Ubuntu > Translations > Settings

And I hold a very strong opinion that including context is not necessary
considering[*] context is mentioned in the page title, at the top of the
page and in breadcrumbs right after the heading. The only decent
argument in favor of including it I could ever hear is that it is better
for search engines. But, with context being so prominent anyway, I
doubt it will make much of a difference.

[*] "...considering *that* context...", if you please :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/pagetests/basics/notfound-traversals.txt'
2--- lib/canonical/launchpad/pagetests/basics/notfound-traversals.txt 2010-12-16 19:27:54 +0000
3+++ lib/canonical/launchpad/pagetests/basics/notfound-traversals.txt 2010-12-30 20:12:18 +0000
4@@ -147,8 +147,8 @@
5 >>> check("/ubuntu/+edit", auth=True)
6 >>> check("/ubuntu/+reassign", auth=True)
7 >>> check("/ubuntu/+selectmemberteam", auth=True)
8->>> check("/ubuntu/+settings", host='translations.launchpad.dev',
9-... auth=True)
10+>>> check("/ubuntu/+configure-translations",
11+... host='translations.launchpad.dev', auth=True)
12 >>> check("/ubuntu/hoary/+addmilestone", auth=True)
13 >>> check("/ubuntu/+addspec", auth=True)
14 >>> check("/ubuntu/+imports", host='translations.launchpad.dev')
15
16=== modified file 'lib/lp/registry/browser/configure.zcml'
17--- lib/lp/registry/browser/configure.zcml 2010-12-20 20:16:02 +0000
18+++ lib/lp/registry/browser/configure.zcml 2010-12-30 20:12:18 +0000
19@@ -1443,13 +1443,6 @@
20 template="../../app/templates/generic-edit.pt"
21 class="lp.registry.browser.product.ProductConfigureBlueprintsView"/>
22 <browser:page
23- for="lp.registry.interfaces.product.IProduct"
24- facet="overview"
25- permission="launchpad.Edit"
26- name="+configure-translations"
27- template="../../app/templates/generic-edit.pt"
28- class="lp.registry.browser.product.ProductConfigureTranslationsView"/>
29- <browser:page
30 name="+branding"
31 for="lp.registry.interfaces.product.IProduct"
32 facet="overview"
33
34=== modified file 'lib/lp/registry/browser/distribution.py'
35--- lib/lp/registry/browser/distribution.py 2010-12-16 19:59:20 +0000
36+++ lib/lp/registry/browser/distribution.py 2010-12-30 20:12:18 +0000
37@@ -426,11 +426,11 @@
38 summary = 'Enable tracking of feature planning.'
39 return Link('+edit', text, summary, icon='edit')
40
41- @enabled_with_permission('launchpad.Edit')
42+ @enabled_with_permission('launchpad.TranslationsAdmin')
43 def configure_translations(self):
44 text = 'Configure translations'
45 summary = 'Allow users to provide translations for this project.'
46- return Link('+edit', text, summary, icon='edit')
47+ return Link('+configure-translations', text, summary, icon='edit')
48
49
50 class DerivativeDistributionOverviewMenu(DistributionOverviewMenu):
51
52=== modified file 'lib/lp/registry/browser/product.py'
53--- lib/lp/registry/browser/product.py 2010-12-21 17:18:59 +0000
54+++ lib/lp/registry/browser/product.py 2010-12-30 20:12:18 +0000
55@@ -15,7 +15,6 @@
56 'ProductConfigureBase',
57 'ProductConfigureAnswersView',
58 'ProductConfigureBlueprintsView',
59- 'ProductConfigureTranslationsView',
60 'ProductDownloadFileMixin',
61 'ProductDownloadFilesView',
62 'ProductEditPeopleView',
63@@ -525,7 +524,7 @@
64 summary = 'Specify where bugs are tracked for this project'
65 return Link('+configure-bugtracker', text, summary, icon='edit')
66
67- @enabled_with_permission('launchpad.Edit')
68+ @enabled_with_permission('launchpad.TranslationsAdmin')
69 def configure_translations(self):
70 text = 'Configure translations'
71 summary = 'Allow users to submit translations for this project'
72@@ -1432,13 +1431,6 @@
73 usage_fieldname = 'blueprints_usage'
74
75
76-class ProductConfigureTranslationsView(ProductConfigureBase):
77- """View class to configure the Launchpad Translations for a project."""
78-
79- label = "Configure translations"
80- usage_fieldname = 'translations_usage'
81-
82-
83 class ProductConfigureAnswersView(ProductConfigureBase):
84 """View class to configure the Launchpad Answers for a project."""
85
86
87=== modified file 'lib/lp/registry/configure.zcml'
88--- lib/lp/registry/configure.zcml 2010-12-15 22:05:43 +0000
89+++ lib/lp/registry/configure.zcml 2010-12-30 20:12:18 +0000
90@@ -1107,6 +1107,7 @@
91 <require
92 permission="launchpad.TranslationsAdmin"
93 set_attributes="
94+ official_rosetta
95 translation_focus
96 translationgroup
97 translationpermission"/>
98@@ -1124,13 +1125,6 @@
99 set_schema="lp.registry.interfaces.product.IProductModerateRestricted"
100 set_attributes="active private_bugs "/>
101
102- <!-- Changes to official_rosetta must be available to Launchpad
103- Translations admins so we need its own permission. -->
104-
105- <require
106- permission="launchpad.TranslationsAdmin"
107- set_attributes="official_rosetta"/>
108-
109 <!-- IHasAliases -->
110
111 <allow
112@@ -1400,7 +1394,6 @@
113 official_answers
114 official_blueprints
115 official_malone
116- official_rosetta
117 owner
118 security_contact
119 summary
120@@ -1413,6 +1406,7 @@
121 permission="launchpad.TranslationsAdmin"
122 set_attributes="
123 language_pack_admin
124+ official_rosetta
125 translationgroup
126 translationpermission
127 translation_focus"/>
128
129=== modified file 'lib/lp/registry/interfaces/distribution.py'
130--- lib/lp/registry/interfaces/distribution.py 2010-12-01 11:26:57 +0000
131+++ lib/lp/registry/interfaces/distribution.py 2010-12-30 20:12:18 +0000
132@@ -284,9 +284,9 @@
133 "get the full functionality of LP")
134
135 translation_focus = Choice(
136- title=_("Translation Focus"),
137+ title=_("Translation focus"),
138 description=_(
139- "The DistroSeries that should get the translation effort focus."),
140+ "The release series that translators should focus on."),
141 required=False,
142 vocabulary='FilteredDistroSeries')
143
144@@ -636,7 +636,8 @@
145 archive = ubuntu.main_archive
146 series = ubuntu.current_series
147 print archive.getPublishedSources(exact_match=True,
148- source_name="apport", distro_series=series)[0].source_package_version
149+ source_name="apport",
150+ distro_series=series)[0].source_package_version
151 """
152 export_as_webservice_entry()
153
154
155=== modified file 'lib/lp/registry/interfaces/product.py'
156--- lib/lp/registry/interfaces/product.py 2010-12-01 11:26:57 +0000
157+++ lib/lp/registry/interfaces/product.py 2010-12-30 20:12:18 +0000
158@@ -679,11 +679,11 @@
159
160 translation_focus = exported(
161 ReferenceChoice(
162- title=_("Translation Focus"), required=False,
163+ title=_("Translation focus"), required=False,
164 vocabulary='FilteredProductSeries',
165 schema=IProductSeries,
166 description=_(
167- 'The ProductSeries where translations are focused.')))
168+ 'Project series that translators should focus on.')))
169
170 translatable_packages = Attribute(
171 "A list of the source packages for this product that can be "
172
173=== modified file 'lib/lp/translations/browser/configure.zcml'
174--- lib/lp/translations/browser/configure.zcml 2010-12-22 12:05:12 +0000
175+++ lib/lp/translations/browser/configure.zcml 2010-12-30 20:12:18 +0000
176@@ -809,12 +809,11 @@
177 template="../templates/hastranslationimports-index.pt"
178 layer="lp.translations.publisher.TranslationsLayer"/>
179 <browser:page
180- name="+settings"
181+ name="+configure-translations"
182 for="lp.registry.interfaces.product.IProduct"
183 class="lp.translations.browser.product.ProductSettingsView"
184 permission="launchpad.TranslationsAdmin"
185- template="../templates/set-translators.pt"
186- layer="lp.translations.publisher.TranslationsLayer"/>
187+ template="../templates/configure-translations.pt"/>
188 <browser:pages
189 for="lp.registry.interfaces.product.IProduct"
190 permission="zope.Public"
191@@ -872,7 +871,7 @@
192 for="lp.registry.interfaces.projectgroup.IProjectGroup"
193 class="lp.translations.browser.project.ProjectSettingsView"
194 permission="launchpad.TranslationsAdmin"
195- template="../templates/set-translators.pt"
196+ template="../templates/configure-translations.pt"
197 layer="lp.translations.publisher.TranslationsLayer"/>
198
199 <!-- Distribution -->
200@@ -903,11 +902,11 @@
201 class="lp.translations.browser.translations.HelpTranslateButtonView"
202 permission="zope.Public"/>
203 <browser:page
204- name="+settings"
205+ name="+configure-translations"
206 for="lp.registry.interfaces.distribution.IDistribution"
207 class="lp.translations.browser.distribution.DistributionSettingsView"
208 permission="launchpad.TranslationsAdmin"
209- template="../templates/set-translators.pt"
210+ template="../templates/configure-translations.pt"
211 layer="lp.translations.publisher.TranslationsLayer"/>
212 <browser:page
213 for="lp.registry.interfaces.distribution.IDistribution"
214
215=== modified file 'lib/lp/translations/browser/distribution.py'
216--- lib/lp/translations/browser/distribution.py 2010-09-23 14:33:51 +0000
217+++ lib/lp/translations/browser/distribution.py 2010-12-30 20:12:18 +0000
218@@ -44,7 +44,7 @@
219
220 @enabled_with_permission('launchpad.TranslationsAdmin')
221 def settings(self):
222- text = 'Change permissions'
223+ text = 'Configure translations'
224 return Link('+settings', text, icon='edit', site='translations')
225
226 @enabled_with_permission('launchpad.TranslationsAdmin')
227@@ -106,7 +106,7 @@
228
229 def can_configure_translations(self):
230 """Whether or not the user can configure translations."""
231- return check_permission("launchpad.Edit", self.context)
232+ return check_permission("launchpad.TranslationsAdmin", self.context)
233
234 def is_translations_admin(self):
235 """Whether or not the user is a translations admin."""
236@@ -129,13 +129,14 @@
237
238
239 class DistributionSettingsView(TranslationsMixin, DistributionEditView):
240- label = "Set permissions and policies"
241- field_names = ["translationgroup", "translationpermission"]
242-
243- @property
244- def page_title(self):
245- return "Set translation permissions for %s" % (
246- self.context.displayname)
247+ label = "Translations settings"
248+ page_title = "Settings"
249+ field_names = [
250+ "official_rosetta",
251+ "translation_focus",
252+ "translationgroup",
253+ "translationpermission",
254+ ]
255
256 @property
257 def cancel_url(self):
258
259=== modified file 'lib/lp/translations/browser/product.py'
260--- lib/lp/translations/browser/product.py 2010-09-23 14:33:51 +0000
261+++ lib/lp/translations/browser/product.py 2010-12-30 20:12:18 +0000
262@@ -20,7 +20,7 @@
263 from canonical.launchpad.webapp.authorization import check_permission
264 from canonical.launchpad.webapp.menu import NavigationMenu
265 from lp.app.enums import service_uses_launchpad
266-from lp.registry.browser.product import ProductEditView
267+from lp.registry.browser.product import ProductConfigureBase
268 from lp.registry.interfaces.product import IProduct
269 from lp.registry.interfaces.productseries import IProductSeries
270 from lp.registry.interfaces.series import SeriesStatus
271@@ -45,8 +45,9 @@
272
273 @enabled_with_permission('launchpad.TranslationsAdmin')
274 def settings(self):
275- text = 'Change permissions'
276- return Link('+settings', text, icon='edit', site='translations')
277+ text = 'Configure translations'
278+ return Link(
279+ '+configure-translations', text, icon='edit', site='translations')
280
281 @enabled_with_permission('launchpad.AnyPerson')
282 def translationdownload(self):
283@@ -70,21 +71,17 @@
284 return Link(link, text, icon='translation')
285
286
287-class ProductSettingsView(TranslationsMixin, ProductEditView):
288- label = "Set permissions and policies"
289- page_title = "Permissions and policies"
290+class ProductSettingsView(TranslationsMixin, ProductConfigureBase):
291+ label = "Configure translations"
292+ page_title = "Configure translations"
293+ usage_fieldname = "translations_usage"
294 field_names = [
295+ usage_fieldname,
296+ "translation_focus",
297 "translationgroup",
298 "translationpermission",
299- "translation_focus",
300 ]
301
302- @property
303- def cancel_url(self):
304- return canonical_url(self.context, rootsite="translations")
305-
306- next_url = cancel_url
307-
308
309 class ProductView(LaunchpadView):
310
311@@ -110,7 +107,7 @@
312
313 def can_configure_translations(self):
314 """Whether or not the user can configure translations."""
315- return check_permission("launchpad.Edit", self.context)
316+ return check_permission("launchpad.TranslationsAdmin", self.context)
317
318 def is_translations_admin(self):
319 """Whether or not the user is a translations admin."""
320
321=== modified file 'lib/lp/translations/stories/distribution/xx-distribution-translations.txt'
322--- lib/lp/translations/stories/distribution/xx-distribution-translations.txt 2010-09-27 20:22:00 +0000
323+++ lib/lp/translations/stories/distribution/xx-distribution-translations.txt 2010-12-30 20:12:18 +0000
324@@ -1,4 +1,5 @@
325-= Distribution translations =
326+Distribution translations
327+=========================
328
329 This page shows a list of PO templates contained within all source
330 packages for the distroseries that is the translation focus for a
331@@ -91,7 +92,7 @@
332 >>> logout()
333
334 We should get latest release as the translation focus.
335-
336+
337 >>> browser.open('http://translations.launchpad.dev/debian')
338 >>> browser.url
339 'http://translations.launchpad.dev/debian'
340@@ -134,11 +135,11 @@
341 ... auth='Basic jeff.waugh@ubuntulinux.com:jdub')
342 >>> editor_browser.open('http://launchpad.dev/ubuntu')
343 >>> editor_browser.getLink('Change details').click()
344- >>> editor_browser.getControl('Translation Focus').displayValue
345+ >>> editor_browser.getControl('Translation focus').displayValue
346 ['ubuntu hoary']
347- >>> editor_browser.getControl('Translation Focus').displayValue = [
348+ >>> editor_browser.getControl('Translation focus').displayValue = [
349 ... 'ubuntu grumpy']
350 >>> editor_browser.getControl('Change', index=3).click()
351 >>> editor_browser.getLink('Change details').click()
352- >>> editor_browser.getControl('Translation Focus').displayValue
353+ >>> editor_browser.getControl('Translation focus').displayValue
354 ['ubuntu grumpy']
355
356=== modified file 'lib/lp/translations/stories/standalone/xx-potemplate-index.txt'
357--- lib/lp/translations/stories/standalone/xx-potemplate-index.txt 2010-09-02 22:26:01 +0000
358+++ lib/lp/translations/stories/standalone/xx-potemplate-index.txt 2010-12-30 20:12:18 +0000
359@@ -40,7 +40,7 @@
360 Afrikaans 22 ... ... &mdash; &mdash;
361 Japanese 21 ... ... ... Carlos...
362 Sotho, Southern 22 ... ... &mdash; &mdash;
363- Spanish 15 1 1 ... Valentina Commissari
364+ Spanish 15 1 1 ... Valent...
365 Xhosa 22 ... ... ... &mdash;
366 Zulu 22 ... ... &mdash; &mdash;
367
368@@ -117,7 +117,8 @@
369 A source package with five templates is created.
370
371 >>> from zope.component import getUtility
372- >>> from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities
373+ >>> from canonical.launchpad.interfaces.launchpad import (
374+ ... ILaunchpadCelebrities)
375
376 >>> login('admin@canonical.com')
377 >>> ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
378@@ -209,9 +210,6 @@
379
380 A product series with 7 templates is created.
381
382- >>> from zope.component import getUtility
383- >>> from canonical.launchpad.interfaces.launchpad import (
384- ... ILaunchpadCelebrities)
385 >>> from lp.app.enums import ServiceUsage
386 >>> login('admin@canonical.com')
387 >>> product = factory.makeProduct(name="fusa",
388@@ -281,9 +279,9 @@
389
390 >>> user_browser.getLink('download').click()
391 >>> print user_browser.url
392- http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+export
393+ http://trans.../ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+export
394
395-Translation administrators will see both download and upload links.
396+Translation administrators will see both download and upload links.
397 Beside administering this template, "Change permissions"
398 and "Change details" should be also accessible.
399
400@@ -292,34 +290,27 @@
401 ... 'ubuntu/hoary/+source/evolution/+pots/evolution-2.2')
402 >>> admin_browser.getLink('upload').click()
403 >>> print admin_browser.url
404- http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+upload
405+ http://trans.../ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+upload
406
407 >>> admin_browser.open(
408 ... 'http://translations.launchpad.dev/'
409 ... 'ubuntu/hoary/+source/evolution/+pots/evolution-2.2')
410 >>> admin_browser.getLink('download').click()
411 >>> print admin_browser.url
412- http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+export
413+ http://trans.../ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+export
414
415 >>> admin_browser.open(
416 ... 'http://translations.launchpad.dev/'
417 ... 'ubuntu/hoary/+source/evolution/+pots/evolution-2.2')
418 >>> admin_browser.getLink('Administer this template').click()
419 >>> print admin_browser.url
420- http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+admin
421+ http://trans.../ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+admin
422
423 >>> admin_browser.open(
424 ... 'http://translations.launchpad.dev/'
425 ... 'ubuntu/hoary/+source/evolution/+pots/evolution-2.2')
426 >>> admin_browser.getLink('Change details').click()
427 >>> print admin_browser.url
428- http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+edit
429-
430- >>> admin_browser.open(
431- ... 'http://translations.launchpad.dev/'
432- ... 'ubuntu/hoary/+source/evolution/+pots/evolution-2.2')
433- >>> admin_browser.getLink('Change permissions').click()
434- >>> print admin_browser.url
435- http://translations.launchpad.dev/ubuntu/+settings
436+ http://trans.../ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+edit
437
438
439
440=== modified file 'lib/lp/translations/stories/translationfocus/xx-product-translationfocus.txt'
441--- lib/lp/translations/stories/translationfocus/xx-product-translationfocus.txt 2010-10-06 20:49:58 +0000
442+++ lib/lp/translations/stories/translationfocus/xx-product-translationfocus.txt 2010-12-30 20:12:18 +0000
443@@ -12,12 +12,13 @@
444
445 Only admin users are able to change the translation focus of a product.
446 Unprivileged users can see the recommended series for translation,
447-but have no access to the 'Change permissions' menu.
448+but have no access to the 'Configure translations' menu.
449
450 >>> admin_browser.open(fooproject_url)
451 >>> print extract_text(
452- ... find_tags_by_class(admin_browser.contents, 'edit sprite')[1])
453- Change permissions
454+ ... find_tags_by_class(admin_browser.contents,
455+ ... 'menu-link-configure_translations')[0])
456+ Configure translations
457
458 >>> browser.open(fooproject_url)
459 >>> print extract_text(
460@@ -85,5 +86,6 @@
461 >>> browser.open(fooproject_url)
462 >>> print extract_text(find_tags_by_class(browser.contents, 'portlet')[0])
463 Translation details...
464- Launchpad currently recommends translating... Fooproject other-series series.
465+ Launchpad currently recommends translating...
466+ Fooproject other-series series.
467 ...
468
469=== modified file 'lib/lp/translations/stories/translationgroups/10-distro-translation-group.txt'
470--- lib/lp/translations/stories/translationgroups/10-distro-translation-group.txt 2010-10-05 20:25:59 +0000
471+++ lib/lp/translations/stories/translationgroups/10-distro-translation-group.txt 2010-12-30 20:12:18 +0000
472@@ -21,14 +21,14 @@
473 >>> ubuntu_owner_browser = setupBrowser(
474 ... auth='Basic colin.watson@ubuntulinux.com:test')
475 >>> ubuntu_owner_browser.open(anon_browser.url)
476- >>> ubuntu_owner_browser.getLink('Change permissions').click()
477+ >>> ubuntu_owner_browser.getLink('Configure translations').click()
478 >>> print ubuntu_owner_browser.title
479- Set translation permissions for Ubuntu...
480+ Settings : Translations : Ubuntu
481
482 Other users cannot access this page, nor see the menu link to it.
483
484 >>> user_browser.open(anon_browser.url)
485- >>> user_browser.getLink('Change permissions').click()
486+ >>> user_browser.getLink('Configure translations').click()
487 Traceback (most recent call last):
488 ...
489 LinkNotFoundError
490
491=== modified file 'lib/lp/translations/stories/translationgroups/15-product-translation-group.txt'
492--- lib/lp/translations/stories/translationgroups/15-product-translation-group.txt 2010-10-06 20:49:58 +0000
493+++ lib/lp/translations/stories/translationgroups/15-product-translation-group.txt 2010-12-30 20:12:18 +0000
494@@ -32,11 +32,11 @@
495 group and permissions.
496
497 >>> translations_page_url = netapplet_owner_browser.url
498- >>> netapplet_owner_browser.getLink('Change permissions').click()
499+ >>> netapplet_owner_browser.getLink('Configure translations').click()
500 >>> change_translators_url = netapplet_owner_browser.url
501
502 >>> print netapplet_owner_browser.title
503- Permissions and policies...
504+ Configure translations : Translations : NetApplet
505
506 >>> print netapplet_owner_browser.getControl(
507 ... 'Translation group').displayOptions
508@@ -47,11 +47,11 @@
509 ... 'Translation group').displayValue
510 ['(no value)']
511
512-Ordinary users cannot see the "Change permissions" link or the page it
513+Ordinary users cannot see the "Configure translations" link or the page it
514 leads to.
515
516 >>> user_browser.open(translations_page_url)
517- >>> user_browser.getLink('Change permissions').click()
518+ >>> user_browser.getLink('Configure translations').click()
519 Traceback (most recent call last):
520 ...
521 LinkNotFoundError
522
523=== modified file 'lib/lp/translations/stories/translationgroups/45-test-distro-restricted-permissions.txt'
524--- lib/lp/translations/stories/translationgroups/45-test-distro-restricted-permissions.txt 2010-04-13 16:06:52 +0000
525+++ lib/lp/translations/stories/translationgroups/45-test-distro-restricted-permissions.txt 2010-12-30 20:12:18 +0000
526@@ -8,7 +8,8 @@
527 >>> browser.addHeader('Authorization', 'Basic no-priv@canonical.com:test')
528
529 >>> admin_browser.open(
530- ... 'http://translations.launchpad.dev/ubuntu/+settings')
531+ ... 'http://translations.launchpad.dev/ubuntu/'
532+ ... '+configure-translations')
533
534 >>> admin_browser.getControl(
535 ... 'Translation permissions policy').value = ['RESTRICTED']
536
537=== modified file 'lib/lp/translations/stories/translationgroups/46-test-distro-structured-permissions.txt'
538--- lib/lp/translations/stories/translationgroups/46-test-distro-structured-permissions.txt 2010-08-24 22:23:17 +0000
539+++ lib/lp/translations/stories/translationgroups/46-test-distro-structured-permissions.txt 2010-12-30 20:12:18 +0000
540@@ -15,7 +15,7 @@
541 as the translation group for the netapplet product...
542
543 >>> admin_browser.getLink('Translations').click()
544- >>> admin_browser.getLink('Change permissions').click()
545+ >>> admin_browser.getLink('Configure translations').click()
546 >>> admin_browser.getControl('Translation group').displayOptions
547 ['(no value)', 'Single-language Translators',
548 'The PolyGlot Translation Group', 'Just a testing team']
549
550=== modified file 'lib/lp/translations/stories/translationgroups/xx-change-translation-policy.txt'
551--- lib/lp/translations/stories/translationgroups/xx-change-translation-policy.txt 2010-08-31 18:10:51 +0000
552+++ lib/lp/translations/stories/translationgroups/xx-change-translation-policy.txt 2010-12-30 20:12:18 +0000
553@@ -19,20 +19,20 @@
554 >>> po_browser = setupBrowser("Basic po@ex.com:test")
555
556 Visiting the main products translations page, product owners and Rosetta
557-administrators sees the "Change permissions" link, leading to the
558+administrators sees the "Configure translations" link, leading to the
559 translations settings page.
560
561 >>> re_browser.open(
562 ... 'http://translations.launchpad.dev/chestii')
563- >>> re_browser.getLink('Change permissions').click()
564+ >>> re_browser.getLink('Configure translations').click()
565 >>> print re_browser.url
566- http://translations.launchpad.dev/chestii/+settings
567+ http://translations.launchpad.dev/chestii/+configure-translations
568
569 >>> po_browser.open(
570 ... 'http://translations.launchpad.dev/chestii')
571- >>> po_browser.getLink('Change permissions').click()
572+ >>> po_browser.getLink('Configure translations').click()
573 >>> print po_browser.url
574- http://translations.launchpad.dev/chestii/+settings
575+ http://translations.launchpad.dev/chestii/+configure-translations
576
577 From the settings page, translations group and translation permissions
578 can be changed.
579@@ -58,7 +58,7 @@
580
581 >>> dtc_browser.open(
582 ... 'http://translations.launchpad.dev/chestii')
583- >>> dtc_browser.getLink('Change permissions')
584+ >>> dtc_browser.getLink('Configure translations')
585 Traceback (most recent call last):
586 ...
587 LinkNotFoundError...
588@@ -66,7 +66,8 @@
589 An attempt to access the translations policy url will not be authorized.
590
591 >>> browser.open(
592- ... 'http://translations.launchpad.dev/chestii/+settings')
593+ ... 'http://translations.launchpad.dev/'
594+ ... 'chestii/+configure-translations')
595 Traceback (most recent call last):
596 ...
597 Unauthorized...
598@@ -80,9 +81,9 @@
599
600 >>> dtc_browser.open(
601 ... 'http://translations.launchpad.dev/ubuntu')
602- >>> dtc_browser.getLink('Change permissions').click()
603+ >>> dtc_browser.getLink('Configure translations').click()
604 >>> print dtc_browser.url
605- http://translations.launchpad.dev/ubuntu/+settings
606+ http://translations.launchpad.dev/ubuntu/+configure-translations
607
608 >>> dtc_browser.getControl('Translation group').value = [
609 ... 'ubuntu-translators']
610
611=== renamed file 'lib/lp/translations/templates/set-translators.pt' => 'lib/lp/translations/templates/configure-translations.pt'
612=== modified file 'lib/lp/translations/templates/distribution-translations.pt'
613--- lib/lp/translations/templates/distribution-translations.pt 2010-10-10 21:54:16 +0000
614+++ lib/lp/translations/templates/distribution-translations.pt 2010-12-30 20:12:18 +0000
615@@ -48,6 +48,10 @@
616 <tal:target replace="structure target/fmt:link/+translations"
617 >trunk</tal:target>.
618 </p>
619+ <p tal:condition="view/can_configure_translations">
620+ <a tal:replace="structure context/menu:overview/configure_translations/fmt:link"/>
621+ </p>
622+
623 </div>
624 <div class="yui-g">
625 <div class="yui-u first">
626
627=== modified file 'lib/lp/translations/templates/hastranslationgroup-portlet-translation-groups-and-permission.pt'
628--- lib/lp/translations/templates/hastranslationgroup-portlet-translation-groups-and-permission.pt 2010-02-16 21:21:14 +0000
629+++ lib/lp/translations/templates/hastranslationgroup-portlet-translation-groups-and-permission.pt 2010-12-30 20:12:18 +0000
630@@ -12,9 +12,4 @@
631 tal:content="context/translationpermission/title">certain</a>
632 permissions.
633 </p>
634- <div tal:condition="context/required:launchpad.TranslationsAdmin">
635- <a tal:replace="structure context/menu:translations/settings/fmt:link">
636- Change permissions
637- </a>
638- </div>
639 </div>
640
641=== modified file 'lib/lp/translations/templates/project-translations.pt'
642--- lib/lp/translations/templates/project-translations.pt 2010-10-26 21:26:27 +0000
643+++ lib/lp/translations/templates/project-translations.pt 2010-12-30 20:12:18 +0000
644@@ -38,6 +38,10 @@
645 context/@@+portlet-translation-groups-and-permission"
646 />
647 </p>
648+ <p tal:condition="view/required:launchpad.TranslationsAdmin">
649+ <a tal:replace="
650+ structure context/menu:translations/settings/fmt:link"/>
651+ </p>
652 </div>
653
654 <div class="yui-g">