Merge lp:~adiroiban/launchpad/bug-487137 into lp:launchpad

Proposed by Adi Roiban
Status: Rejected
Rejected by: Данило Шеган
Proposed branch: lp:~adiroiban/launchpad/bug-487137
Merge into: lp:launchpad
Diff against target: 402 lines (+108/-57)
9 files modified
lib/canonical/launchpad/security.py (+24/-0)
lib/lp/translations/browser/configure.zcml (+3/-3)
lib/lp/translations/browser/customlanguagecode.py (+1/-1)
lib/lp/translations/stories/standalone/custom-language-codes.txt (+55/-47)
lib/lp/translations/templates/customlanguagecode-index.pt (+1/-1)
lib/lp/translations/templates/customlanguagecode-remove.pt (+18/-0)
lib/lp/translations/templates/customlanguagecodes-index.pt (+4/-3)
lib/lp/translations/templates/product-portlet-translatables.pt (+1/-1)
lib/lp/translations/templates/sourcepackage-translations.pt (+1/-1)
To merge this branch: bzr merge lp:~adiroiban/launchpad/bug-487137
Reviewer Review Type Date Requested Status
Michael Nelson (community) code Approve
Review via email: mp+23901@code.launchpad.net

Commit message

Allow Rosetta Experts to administer custom language codes.

Description of the change

= Bug 487137 =

Now that we have the custom language codes UI (bug 271747), we should allow Translations experts to create and remove custom language codes.

This was always planned, but didn't fit in the original branch.

== Proposed fix ==

Use launchpad.TranslationsAdmin for checking admin permissions for custom language codes.
Allow Launchpad Admin and Rosetta Admin launchpad.TranslationsAdmin rights on ICustomLanguageCode and IHasCustomLanguageCodes.

== Pre-implementation notes ==

None yet.

== Implementation details ==

Nothing special.

I don't know what is the best method for testing permission, since all permission checking tests should be done using a Launchpad admins and a Rosetta expert.

'make lint' sometimes gives me > bzr: ERROR: unknown command "pipes"

== Tests ==

lp-test custom-language-codes

== Demo and Q/A ==

Login as Rosetta Administrator.
Go to a product or sourcepackage page:

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

You should see a link for defining custom language codes.
Click on the link.
Add a language code.
Click on the new language code.
Remove the language code.

= Launchpad lint =

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

Linting changed files:
  lib/canonical/launchpad/security.py
  lib/lp/translations/browser/configure.zcml
  lib/lp/translations/browser/customlanguagecode.py
  lib/lp/translations/stories/standalone/custom-language-codes.txt
  lib/lp/translations/templates/customlanguagecode-index.pt
  lib/lp/translations/templates/customlanguagecodes-index.pt
  lib/lp/translations/templates/product-portlet-translatables.pt
  lib/lp/translations/templates/sourcepackage-translations.pt

To post a comment you must log in.
Revision history for this message
Michael Nelson (michael.nelson) wrote :
Download full text (4.3 KiB)

Hi Adi!

Thanks for yet another branch. The test is failing for me locally, and I've a few typo fixes below. Once they're fixed up, r=me.

Thanks!

On Thu, Apr 22, 2010 at 5:19 AM, Adi Roiban <email address hidden> wrote:
> Adi Roiban has proposed merging lp:~adiroiban/launchpad/bug-487137 into lp:launchpad/devel.
...
>
> == Tests ==<email address hidden>
>
> lp-test custom-language-codes

Running the test results in a failure:
http://pastebin.ubuntu.com/420372/

>
> == Demo and Q/A ==
>
> Login as Rosetta Administrator.
> Go to a product or sourcepackage page:
>
> https://translations.launchpad.dev/evolution
> https://translations.launchpad.dev/ubuntu/+source/evolution
>
> You should see a link for defining custom language codes.
> Click on the link.
> Add a language code.
> Click on the new language code.
> Remove the language code.

Great. Strangely, reverting your security.py change and logging in as <email address hidden> still allows me to create language codes, just not delete them.

I see it's not really part of this branch, but when removing a language there is no text (other than the main heading, breadcrumbs and the remove or cancel options). It looks a bit strange, and any text would just be repeating what the main heading already says, but adding the label to the form might look less strange... see what you think (as it's not part of this branch, I'll leave it up to you).

> === modified file 'lib/canonical/launchpad/security.py'
> --- lib/canonical/launchpad/security.py 2010-04-18 22:31:40 +0000
> +++ lib/canonical/launchpad/security.py 2010-04-22 03:19:15 +0000
> @@ -112,6 +112,8 @@
> from lp.blueprints.interfaces.sprintspecification import (
> ISprintSpecification)
> from lp.registry.interfaces.teammembership import ITeamMembership
> +from lp.translations.interfaces.customlanguagecode import (
> + ICustomLanguageCode, IHasCustomLanguageCodes)
> from lp.translations.interfaces.translationgroup import (
> ITranslationGroup, ITranslationGroupSet)
> from lp.translations.interfaces.translationimportqueue import (
> @@ -1652,6 +1654,28 @@
> usedfor = ILanguage
>
>
> +class AdminCustomLanguageCodes(OnlyRosettaExpertsAndAdmins):
> + """Controls administration of custom language codes.
> +
> + Rosetta expters and Launchpad administrators can admister custom language

s/expters/experts
s/admister/administer

> + codes.
> + """
> +
> + permission = 'launchpad.TranslationsAdmin'
> + usedfor = IHasCustomLanguageCodes
> +
> +
> +class AdminCustomLanguageCode(OnlyRosettaExpertsAndAdmins):
> + """Controls administration for a custom language code.
> +
> + Rosetta expters and Launchpad administrators can admister a custom

as above.

> + language code.
> + """
> +
> + permission = 'launchpad.TranslationsAdmin'
> + usedfor = ICustomLanguageCode
> +
> +
> class AccessBranch(AuthorizationBase):
> """Controls visibility of branches.
>
>

> === modified file 'lib/lp/translations/stories/standalone/custom-language-codes.txt'
> --- lib/lp/translations/stories/standalone/custom-language-codes.txt 2010-03-11 20:54:36 +0000
> +++ lib/lp/translations/stories/standalone/custom-language-codes.txt 2010-04-22 03:19:15 +0000
....

Read more...

review: Approve (code)
Revision history for this message
Adi Roiban (adiroiban) wrote :
Download full text (7.1 KiB)

> Hi Adi!
>
> Thanks for yet another branch. The test is failing for me locally, and I've a
> few typo fixes below. Once they're fixed up, r=me.

Thanks for taking the time and review this branch!
Please see my inline comments.

[snip]

> > lp-test custom-language-codes
>
> Running the test results in a failure:
> http://pastebin.ubuntu.com/420372/

Test fixed.
It was my fault for changing the test and not running it again.

> > == Demo and Q/A ==
> >
> > Login as Rosetta Administrator.
> > Go to a product or sourcepackage page:
> >
> > https://translations.launchpad.dev/evolution
> > https://translations.launchpad.dev/ubuntu/+source/evolution
> >
> > You should see a link for defining custom language codes.
> > Click on the link.
> > Add a language code.
> > Click on the new language code.
> > Remove the language code.
>
> Great. Strangely, reverting your security.py change and logging in as
> <email address hidden> still allows me to create language codes, just not delete them.

Yes. It should work for IProduct since Rosetta Experts have already translations admin right on IProduct which implements IHasCustomLangaugeCode. They don't have this right on ISourcePackage which also implement IHasCustomLangaugeCode.

> I see it's not really part of this branch, but when removing a language there
> is no text (other than the main heading, breadcrumbs and the remove or cancel
> options). It looks a bit strange, and any text would just be repeating what
> the main heading already says, but adding the label to the form might look
> less strange... see what you think (as it's not part of this branch, I'll
> leave it up to you).

I have added the text:
You are going to remove the custom language code "LC".

> > === modified file 'lib/canonical/launchpad/security.py'
> > --- lib/canonical/launchpad/security.py 2010-04-18 22:31:40 +0000
> > +++ lib/canonical/launchpad/security.py 2010-04-22 03:19:15 +0000
> > @@ -112,6 +112,8 @@
> > from lp.blueprints.interfaces.sprintspecification import (
> > ISprintSpecification)
> > from lp.registry.interfaces.teammembership import ITeamMembership
> > +from lp.translations.interfaces.customlanguagecode import (
> > + ICustomLanguageCode, IHasCustomLanguageCodes)
> > from lp.translations.interfaces.translationgroup import (
> > ITranslationGroup, ITranslationGroupSet)
> > from lp.translations.interfaces.translationimportqueue import (
> > @@ -1652,6 +1654,28 @@
> > usedfor = ILanguage
> >
> >
> > +class AdminCustomLanguageCodes(OnlyRosettaExpertsAndAdmins):
> > + """Controls administration of custom language codes.
> > +
> > + Rosetta expters and Launchpad administrators can admister custom
> language
>
> s/expters/experts
> s/admister/administer

Fixed.

> > + codes.
> > + """
> > +
> > + permission = 'launchpad.TranslationsAdmin'
> > + usedfor = IHasCustomLanguageCodes
> > +
> > +
> > +class AdminCustomLanguageCode(OnlyRosettaExpertsAndAdmins):
> > + """Controls administration for a custom language code.
> > +
> > + Rosetta expters and Launchpad administrators can admister a custom
>
> as above.

Fixed.
[snip]
> > -An administrator sees the link to the custom language codes on a
> ...

Read more...

Revision history for this message
Michael Nelson (michael.nelson) wrote :

Great, thanks for those changes Adi.

Just ping me and I'll send this off to land if you're happy with it.

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

Henning has picked up this branch and massaged it for landing. Thanks Adi for the work on it so far :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/security.py'
2--- lib/canonical/launchpad/security.py 2010-04-20 08:01:41 +0000
3+++ lib/canonical/launchpad/security.py 2010-04-22 16:33:28 +0000
4@@ -112,6 +112,8 @@
5 from lp.blueprints.interfaces.sprintspecification import (
6 ISprintSpecification)
7 from lp.registry.interfaces.teammembership import ITeamMembership
8+from lp.translations.interfaces.customlanguagecode import (
9+ ICustomLanguageCode, IHasCustomLanguageCodes)
10 from lp.translations.interfaces.translationgroup import (
11 ITranslationGroup, ITranslationGroupSet)
12 from lp.translations.interfaces.translationimportqueue import (
13@@ -1652,6 +1654,28 @@
14 usedfor = ILanguage
15
16
17+class AdminCustomLanguageCodes(OnlyRosettaExpertsAndAdmins):
18+ """Controls administration of custom language codes.
19+
20+ Rosetta experts and Launchpad administrators can administer custom
21+ language codes.
22+ """
23+
24+ permission = 'launchpad.TranslationsAdmin'
25+ usedfor = IHasCustomLanguageCodes
26+
27+
28+class AdminCustomLanguageCode(OnlyRosettaExpertsAndAdmins):
29+ """Controls administration for a custom language code.
30+
31+ Rosetta experts and Launchpad administrators can administer a custom
32+ language code.
33+ """
34+
35+ permission = 'launchpad.TranslationsAdmin'
36+ usedfor = ICustomLanguageCode
37+
38+
39 class AccessBranch(AuthorizationBase):
40 """Controls visibility of branches.
41
42
43=== modified file 'lib/lp/translations/browser/configure.zcml'
44--- lib/lp/translations/browser/configure.zcml 2010-04-19 08:11:52 +0000
45+++ lib/lp/translations/browser/configure.zcml 2010-04-22 16:33:28 +0000
46@@ -1001,9 +1001,9 @@
47 <browser:page
48 name="+remove"
49 for="lp.translations.interfaces.customlanguagecode.ICustomLanguageCode"
50- permission="launchpad.Admin"
51+ permission="launchpad.TranslationsAdmin"
52 class="lp.translations.browser.customlanguagecode.CustomLanguageCodeRemoveView"
53- template="../../app/templates/generic-edit.pt"
54+ template="../templates/customlanguagecode-remove.pt"
55 layer="canonical.launchpad.layers.TranslationsLayer"/>
56
57 <!-- IHasCustomLanguageCodes -->
58@@ -1021,7 +1021,7 @@
59 layer="canonical.launchpad.layers.TranslationsLayer"
60 class="lp.translations.browser.customlanguagecode.CustomLanguageCodeAddView"
61 template="../templates/customlanguagecode-add.pt"
62- permission="launchpad.Admin"/>
63+ permission="launchpad.TranslationsAdmin"/>
64
65 </facet>
66 </configure>
67
68=== modified file 'lib/lp/translations/browser/customlanguagecode.py'
69--- lib/lp/translations/browser/customlanguagecode.py 2009-11-13 16:18:54 +0000
70+++ lib/lp/translations/browser/customlanguagecode.py 2010-04-22 16:33:28 +0000
71@@ -11,7 +11,7 @@
72 'CustomLanguageCodeView',
73 'HasCustomLanguageCodesNavigation',
74 'HasCustomLanguageCodesTraversalMixin',
75- ]
76+ ]
77
78
79 import re
80
81=== modified file 'lib/lp/translations/stories/standalone/custom-language-codes.txt'
82--- lib/lp/translations/stories/standalone/custom-language-codes.txt 2010-03-11 20:54:36 +0000
83+++ lib/lp/translations/stories/standalone/custom-language-codes.txt 2010-04-22 16:33:28 +0000
84@@ -11,7 +11,6 @@
85 Custom language codes are attached to either a product or a source
86 package.
87
88- >>> import re
89 >>> from zope.component import getUtility
90 >>> from zope.security.proxy import removeSecurityProxy
91 >>> from canonical.launchpad.interfaces.launchpad import (
92@@ -35,9 +34,10 @@
93 >>> logout()
94
95 >>> owner_browser = setupBrowser("Basic o@example.com:test")
96+ >>> rosetta_admin_browser = setupRosettaExpertBrowser()
97
98-An administrator sees the link to the custom language codes on a
99-project's main translations page.
100+A Launchpad administrator or Rosetta expert sees the link to the custom
101+language codes on a project's main translations page.
102
103 >>> admin_browser.open(product_page)
104 >>> tag = find_custom_language_codes_link(admin_browser)
105@@ -46,10 +46,17 @@
106 define custom language codes
107 for this project.
108
109+ >>> rosetta_admin_browser.open(product_page)
110+ >>> tag = find_custom_language_codes_link(rosetta_admin_browser)
111+ >>> print extract_text(tag.renderContents())
112+ If necessary, you may
113+ define custom language codes
114+ for this project.
115+
116 The link goes to the custom language codes management page.
117
118- >>> admin_browser.getLink("define custom language codes").click()
119- >>> custom_language_codes_page = admin_browser.url
120+ >>> rosetta_admin_browser.getLink("define custom language codes").click()
121+ >>> custom_language_codes_page = rosetta_admin_browser.url
122
123 Non-admins, even the project's owner, don't see this link. We do not
124 advertise this feature, since the proper solution is generally to use
125@@ -61,26 +68,26 @@
126
127 Initially the page shows no custom language codes for the project.
128
129- >>> tag = find_tag_by_id(admin_browser.contents, 'empty')
130+ >>> tag = find_tag_by_id(rosetta_admin_browser.contents, 'empty')
131 >>> print extract_text(tag.renderContents())
132 No custom language codes have been defined.
133
134 The admin can add a custom language code.
135
136- >>> admin_browser.getLink("Add a custom language code").click()
137- >>> add_page = admin_browser.url
138+ >>> rosetta_admin_browser.getLink("Add a custom language code").click()
139+ >>> add_page = rosetta_admin_browser.url
140
141- >>> admin_browser.getControl("Language code:").value = 'no'
142- >>> admin_browser.getControl("Language:").value = ['nn']
143- >>> admin_browser.getControl("Add").click()
144+ >>> rosetta_admin_browser.getControl("Language code:").value = 'no'
145+ >>> rosetta_admin_browser.getControl("Language:").value = ['nn']
146+ >>> rosetta_admin_browser.getControl("Add").click()
147
148 This leads back to the custom language codes overview, where the new
149 code is now shown.
150
151- >>> admin_browser.url == custom_language_codes_page
152+ >>> rosetta_admin_browser.url == custom_language_codes_page
153 True
154
155- >>> tag = find_tag_by_id(admin_browser.contents, 'nonempty')
156+ >>> tag = find_tag_by_id(rosetta_admin_browser.contents, 'nonempty')
157 >>> print extract_text(tag.renderContents())
158 Foo uses the following custom language codes:
159 Code... ...maps to language
160@@ -89,8 +96,8 @@
161 There is an overview page for the custom code, though there's not much
162 to see there.
163
164- >>> admin_browser.getLink("no").click()
165- >>> main = find_main_content(admin_browser.contents)
166+ >>> rosetta_admin_browser.getLink("no").click()
167+ >>> main = find_main_content(rosetta_admin_browser.contents)
168 >>> print extract_text(main.renderContents())
169 Foo Translations Custom language code ...no...
170 For Foo, uploads with the language code
171@@ -102,26 +109,27 @@
172
173 The overview page leads back to the custom language codes overview.
174
175- >>> code_page = admin_browser.url
176- >>> admin_browser.getLink("custom language codes overview").click()
177- >>> admin_browser.url == custom_language_codes_page
178+ >>> code_page = rosetta_admin_browser.url
179+ >>> rosetta_admin_browser.getLink(
180+ ... "custom language codes overview").click()
181+ >>> rosetta_admin_browser.url == custom_language_codes_page
182 True
183
184- >>> admin_browser.open(code_page)
185+ >>> rosetta_admin_browser.open(code_page)
186
187 There is also a link for removing codes. The admin follows the link and
188 removes the "no" custom language code.
189
190- >>> admin_browser.getLink("remove custom language code").click()
191- >>> remove_page = admin_browser.url
192- >>> admin_browser.getControl("Remove").click()
193+ >>> rosetta_admin_browser.getLink("remove custom language code").click()
194+ >>> remove_page = rosetta_admin_browser.url
195+ >>> rosetta_admin_browser.getControl("Remove").click()
196
197 This leads back to the overview page.
198
199- >>> admin_browser.url == custom_language_codes_page
200+ >>> rosetta_admin_browser.url == custom_language_codes_page
201 True
202
203- >>> tag = find_tag_by_id(admin_browser.contents, 'empty')
204+ >>> tag = find_tag_by_id(rosetta_admin_browser.contents, 'empty')
205 >>> print extract_text(tag.renderContents())
206 No custom language codes have been defined.
207
208@@ -155,10 +163,10 @@
209 And naturally, if an admin creates a custom language code again, a
210 non-admin can't remove it.
211
212- >>> admin_browser.open(add_page)
213- >>> admin_browser.getControl("Language code:").value = 'no'
214- >>> admin_browser.getControl("Language:").value = ['nn']
215- >>> admin_browser.getControl("Add").click()
216+ >>> rosetta_admin_browser.open(add_page)
217+ >>> rosetta_admin_browser.getControl("Language code:").value = 'no'
218+ >>> rosetta_admin_browser.getControl("Language:").value = ['nn']
219+ >>> rosetta_admin_browser.getControl("Add").click()
220
221 >>> owner_browser.open(custom_language_codes_page)
222 >>> tag = find_tag_by_id(owner_browser.contents, 'nonempty')
223@@ -210,36 +218,36 @@
224 ... rootsite="translations")
225 >>> logout()
226
227- >>> admin_browser.open(package_page)
228+ >>> rosetta_admin_browser.open(package_page)
229
230 Of course in this case, the notice about there being no custom language
231 codes talks about a package, not a project.
232
233- >>> tag = find_custom_language_codes_link(admin_browser)
234+ >>> tag = find_custom_language_codes_link(rosetta_admin_browser)
235 >>> print extract_text(tag.renderContents())
236 If necessary, you may
237 define custom language codes
238 for this package.
239
240- >>> admin_browser.getLink("define custom language codes").click()
241- >>> custom_language_codes_page = admin_browser.url
242+ >>> rosetta_admin_browser.getLink("define custom language codes").click()
243+ >>> custom_language_codes_page = rosetta_admin_browser.url
244
245- >>> tag = find_tag_by_id(admin_browser.contents, 'empty')
246+ >>> tag = find_tag_by_id(rosetta_admin_browser.contents, 'empty')
247 >>> print extract_text(tag.renderContents())
248 No custom language codes have been defined.
249
250 Again, an admin can add a language code.
251
252- >>> admin_browser.getLink("Add a custom language code").click()
253- >>> add_page = admin_browser.url
254+ >>> rosetta_admin_browser.getLink("Add a custom language code").click()
255+ >>> add_page = rosetta_admin_browser.url
256
257- >>> admin_browser.getControl("Language code:").value = 'pt-br'
258- >>> admin_browser.getControl("Language:").value = ['pt_BR']
259- >>> admin_browser.getControl("Add").click()
260+ >>> rosetta_admin_browser.getControl("Language code:").value = 'pt-br'
261+ >>> rosetta_admin_browser.getControl("Language:").value = ['pt_BR']
262+ >>> rosetta_admin_browser.getControl("Add").click()
263
264 The language code is displayed.
265
266- >>> tag = find_tag_by_id(admin_browser.contents, 'nonempty')
267+ >>> tag = find_tag_by_id(rosetta_admin_browser.contents, 'nonempty')
268 >>> print extract_text(tag.renderContents())
269 bar in distro uses the following custom language codes:
270 Code... ...maps to language
271@@ -248,15 +256,15 @@
272 It's also displayed identically on the same package but in another
273 release series of the same distribution.
274
275- >>> admin_browser.open(page_in_other_series)
276- >>> tag = find_custom_language_codes_link(admin_browser)
277+ >>> rosetta_admin_browser.open(page_in_other_series)
278+ >>> tag = find_custom_language_codes_link(rosetta_admin_browser)
279 >>> print extract_text(tag.renderContents())
280 If necessary, you may
281 define custom language codes
282 for this package.
283
284- >>> admin_browser.getLink("define custom language codes").click()
285- >>> tag = find_tag_by_id(admin_browser.contents, 'nonempty')
286+ >>> rosetta_admin_browser.getLink("define custom language codes").click()
287+ >>> tag = find_tag_by_id(rosetta_admin_browser.contents, 'nonempty')
288 >>> print extract_text(tag.renderContents())
289 bar in distro uses the following custom language codes:
290 Code... ...maps to language
291@@ -265,13 +273,13 @@
292
293 The new code has a link there...
294
295- >>> admin_browser.getLink("pt-br").click()
296+ >>> rosetta_admin_browser.getLink("pt-br").click()
297
298 ...and can be deleted.
299
300- >>> admin_browser.getLink("remove custom language code").click()
301- >>> admin_browser.getControl("Remove").click()
302+ >>> rosetta_admin_browser.getLink("remove custom language code").click()
303+ >>> rosetta_admin_browser.getControl("Remove").click()
304
305- >>> tag = find_tag_by_id(admin_browser.contents, 'empty')
306+ >>> tag = find_tag_by_id(rosetta_admin_browser.contents, 'empty')
307 >>> print extract_text(tag.renderContents())
308 No custom language codes have been defined.
309
310=== modified file 'lib/lp/translations/templates/customlanguagecode-index.pt'
311--- lib/lp/translations/templates/customlanguagecode-index.pt 2009-11-05 14:45:13 +0000
312+++ lib/lp/translations/templates/customlanguagecode-index.pt 2010-04-22 16:33:28 +0000
313@@ -26,7 +26,7 @@
314
315 <div class="portlet">
316 <ul class="horizontal">
317- <li tal:condition="context/required:launchpad.Admin">
318+ <li tal:condition="context/required:launchpad.TranslationsAdmin">
319 <a class="remove sprite"
320 tal:attributes="href context/fmt:url/+remove">
321 remove custom language code
322
323=== added file 'lib/lp/translations/templates/customlanguagecode-remove.pt'
324--- lib/lp/translations/templates/customlanguagecode-remove.pt 1970-01-01 00:00:00 +0000
325+++ lib/lp/translations/templates/customlanguagecode-remove.pt 2010-04-22 16:33:28 +0000
326@@ -0,0 +1,18 @@
327+<html
328+ xmlns="http://www.w3.org/1999/xhtml"
329+ xmlns:tal="http://xml.zope.org/namespaces/tal"
330+ xmlns:metal="http://xml.zope.org/namespaces/metal"
331+ xmlns:i18n="http://xml.zope.org/namespaces/i18n"
332+ metal:use-macro="view/macro:page/main_only"
333+ i18n:domain="launchpad">
334+ <body>
335+ <div metal:fill-slot="main">
336+ <div metal:use-macro="context/@@launchpad_form/form">
337+ <div metal:fill-slot="extra_info" class="documentDescription">
338+ You are going to remove the custom language code
339+ '<tal:language-code replace="view/code" />'.
340+ </div>
341+ </div>
342+ </div>
343+ </body>
344+</html>
345
346=== modified file 'lib/lp/translations/templates/customlanguagecodes-index.pt'
347--- lib/lp/translations/templates/customlanguagecodes-index.pt 2009-11-05 14:45:13 +0000
348+++ lib/lp/translations/templates/customlanguagecodes-index.pt 2010-04-22 16:33:28 +0000
349@@ -33,7 +33,8 @@
350 <tr>
351 <th>Code...</th>
352 <th>...maps to language</th>
353- <th tal:condition="context/required:launchpad.Admin"></th>
354+ <th tal:condition="context/required:launchpad.TranslationsAdmin">
355+ </th>
356 </tr>
357 </thead>
358 <tbody>
359@@ -51,7 +52,7 @@
360 &mdash;
361 </tal:nolanguage>
362 </td>
363- <td tal:condition="context/required:launchpad.Admin">
364+ <td tal:condition="context/required:launchpad.TranslationsAdmin">
365 <a tal:attributes="href entry/fmt:url/+remove"
366 alt="Remove"
367 title="Remove"
368@@ -70,7 +71,7 @@
369
370 <div>
371 <a tal:attributes="href context/fmt:url/+add-custom-language-code"
372- tal:condition="context/required:launchpad.Admin"
373+ tal:condition="context/required:launchpad.TranslationsAdmin"
374 class="add sprite">
375 Add a custom language code
376 </a>
377
378=== modified file 'lib/lp/translations/templates/product-portlet-translatables.pt'
379--- lib/lp/translations/templates/product-portlet-translatables.pt 2009-11-17 10:17:34 +0000
380+++ lib/lp/translations/templates/product-portlet-translatables.pt 2010-04-22 16:33:28 +0000
381@@ -65,7 +65,7 @@
382 </div>
383
384 <div class="portlet"
385- tal:condition="context/required:launchpad.Admin"
386+ tal:condition="context/required:launchpad.TranslationsAdmin"
387 id="custom-language-codes">
388 If necessary, you may
389 <a tal:attributes="href context/fmt:url/+custom-language-codes"
390
391=== modified file 'lib/lp/translations/templates/sourcepackage-translations.pt'
392--- lib/lp/translations/templates/sourcepackage-translations.pt 2009-11-17 10:17:34 +0000
393+++ lib/lp/translations/templates/sourcepackage-translations.pt 2010-04-22 16:33:28 +0000
394@@ -39,7 +39,7 @@
395 <a tal:attributes="href context/menu:navigation/download/url">
396 download a full tarball</a> with translations.
397 </p>
398- <p tal:condition="context/required:launchpad.Admin"
399+ <p tal:condition="context/distribution_sourcepackage/required:launchpad.TranslationsAdmin"
400 id="custom-language-codes">
401 If necessary, you may
402 <a tal:attributes="href context/distribution_sourcepackage/fmt:url/+custom-language-codes"