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".
> > + 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
> > -project's main translations page.
> > +An Launchpad administrator or Rosetta expert sees the link to the custom
>
> s/An/A
Fixed.
> > +language codes on a project's main translations page.
> >
> > >>> admin_browser.open(product_page)
> > - >>> tag = find_custom_language_codes_link(admin_browser)
> > + >>> tag = find_custom_language_codes_link(rosetta_admin_browser)
>
> I'm guessing this is the source of the test failure ^^^, I'm assuming you
> meant to find the custom language codes using the admin_browser here (which
> just opened the product page), as you test the rosetta admin browser below?
Yes. That was the problem.
[snip]
Here is the latest diff:
=== modified file 'lib/canonical/launchpad/security.py'
--- lib/canonical/launchpad/security.py 2010-04-22 02:55:27 +0000
+++ lib/canonical/launchpad/security.py 2010-04-22 16:24:36 +0000
@@ -1657,8 +1657,8 @@
class AdminCustomLanguageCodes(OnlyRosettaExpertsAndAdmins):
"""Controls administration of custom language codes.
- Rosetta expters and Launchpad administrators can admister custom language
- codes.
+ Rosetta experts and Launchpad administrators can administer custom
+ language codes.
"""
permission = 'launchpad.TranslationsAdmin'
@@ -1668,7 +1668,7 @@
class AdminCustomLanguageCode(OnlyRosettaExpertsAndAdmins):
"""Controls administration for a custom language code.
- Rosetta expters and Launchpad administrators can admister a custom
+ Rosetta experts and Launchpad administrators can administer a custom
language code.
"""
-An Launchpad administrator or Rosetta expert sees the link to the custom
+A Launchpad administrator or Rosetta expert sees the link to the custom
language codes on a project's main translations page.
>>> admin_browser.open(product_page)
- >>> tag = find_custom_language_codes_link(rosetta_admin_browser)
+ >>> tag = find_custom_language_codes_link(admin_browser)
>>> print extract_text(tag.renderContents())
If necessary, you may
define custom language codes
> 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 pastebin. ubuntu. com/420372/
>
> Running the test results in a failure:
> http://
Test fixed.
It was my fault for changing the test and not running it again.
> > == Demo and Q/A == /translations. launchpad. dev/evolution /translations. launchpad. dev/ubuntu/ +source/ evolution
> >
> > Login as Rosetta Administrator.
> > Go to a product or sourcepackage page:
> >
> > https:/
> > https:/
> >
> > 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 IHasCustomLanga ugeCode. They don't have this right on ISourcePackage which also implement IHasCustomLanga ugeCode.
> 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' launchpad/ security. py 2010-04-18 22:31:40 +0000 launchpad/ security. py 2010-04-22 03:19:15 +0000 interfaces. sprintspecifica tion import ( ation) interfaces. teammembership import ITeamMembership .interfaces. customlanguagec ode import ( Code, IHasCustomLangu ageCodes) .interfaces. translationgrou p import ( upSet) .interfaces. translationimpo rtqueue import ( uageCodes( OnlyRosettaExpe rtsAndAdmins) : administer
> > --- lib/canonical/
> > +++ lib/canonical/
> > @@ -112,6 +112,8 @@
> > from lp.blueprints.
> > ISprintSpecific
> > from lp.registry.
> > +from lp.translations
> > + ICustomLanguage
> > from lp.translations
> > ITranslationGroup, ITranslationGro
> > from lp.translations
> > @@ -1652,6 +1654,28 @@
> > usedfor = ILanguage
> >
> >
> > +class AdminCustomLang
> > + """Controls administration of custom language codes.
> > +
> > + Rosetta expters and Launchpad administrators can admister custom
> language
>
> s/expters/experts
> s/admister/
Fixed.
> > + codes. TranslationsAdm in' ageCodes uageCode( OnlyRosettaExpe rtsAndAdmins) :
> > + """
> > +
> > + permission = 'launchpad.
> > + usedfor = IHasCustomLangu
> > +
> > +
> > +class AdminCustomLang
> > + """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
> > -project's main translations page.
> > +An Launchpad administrator or Rosetta expert sees the link to the custom
>
> s/An/A
Fixed.
> > +language codes on a project's main translations page. open(product_ page) language_ codes_link( admin_browser) language_ codes_link( rosetta_ admin_browser)
> >
> > >>> admin_browser.
> > - >>> tag = find_custom_
> > + >>> tag = find_custom_
>
> I'm guessing this is the source of the test failure ^^^, I'm assuming you
> meant to find the custom language codes using the admin_browser here (which
> just opened the product page), as you test the rosetta admin browser below?
Yes. That was the problem.
[snip]
Here is the latest diff:
=== modified file 'lib/canonical/ launchpad/ security. py' launchpad/ security. py 2010-04-22 02:55:27 +0000 launchpad/ security. py 2010-04-22 16:24:36 +0000 uageCodes( OnlyRosettaExpe rtsAndAdmins) :
--- lib/canonical/
+++ lib/canonical/
@@ -1657,8 +1657,8 @@
class AdminCustomLang
"""Controls administration of custom language codes.
- Rosetta expters and Launchpad administrators can admister custom language
- codes.
+ Rosetta experts and Launchpad administrators can administer custom
+ language codes.
"""
permission = 'launchpad. TranslationsAdm in' uageCode( OnlyRosettaExpe rtsAndAdmins) :
@@ -1668,7 +1668,7 @@
class AdminCustomLang
"""Controls administration for a custom language code.
- Rosetta expters and Launchpad administrators can admister a custom
+ Rosetta experts and Launchpad administrators can administer a custom
language code.
"""
=== modified file 'lib/lp/ translations/ browser/ configure. zcml' translations/ browser/ configure. zcml 2010-04-22 02:55:27 +0000 translations/ browser/ configure. zcml 2010-04-22 16:21:23 +0000
for=" lp.translations .interfaces. customlanguagec ode.ICustomLang uageCode"
permission= "launchpad. TranslationsAdm in"
class= "lp.translation s.browser. customlanguagec ode.CustomLangu ageCodeRemoveVi ew" "../../ app/templates/ generic- edit.pt" "../templates/ customlanguagec ode-remove. pt"
layer= "canonical. launchpad. layers. TranslationsLay er"/>
--- lib/lp/
+++ lib/lp/
@@ -1003,7 +1003,7 @@
- template=
+ template=
<!-- IHasCustomLangu ageCodes -->
=== modified file 'lib/lp/ translations/ stories/ standalone/ custom- language- codes.txt' translations/ stories/ standalone/ custom- language- codes.txt 2010-04-22 03:16:53 +0000 translations/ stories/ standalone/ custom- language- codes.txt 2010-04-22 16:24:47 +0000 admin_browser = setupRosettaExp ertBrowser( )
--- lib/lp/
+++ lib/lp/
@@ -36,11 +36,11 @@
>>> owner_browser = setupBrowser("Basic <email address hidden>:test")
>>> rosetta_
-An Launchpad administrator or Rosetta expert sees the link to the custom
+A Launchpad administrator or Rosetta expert sees the link to the custom
language codes on a project's main translations page.
>>> admin_browser. open(product_ page) language_ codes_link( rosetta_ admin_browser) language_ codes_link( admin_browser) text(tag. renderContents( ))
- >>> tag = find_custom_
+ >>> tag = find_custom_
>>> print extract_
If necessary, you may
define custom language codes
=== added file 'lib/lp/ translations/ templates/ customlanguagec ode-remove. pt' translations/ templates/ customlanguagec ode-remove. pt 1970-01-01 00:00:00 +0000 translations/ templates/ customlanguagec ode-remove. pt 2010-04-22 16:27:44 +0000 www.w3. org/1999/ xhtml" xml.zope. org/namespaces/ tal" xml.zope. org/namespaces/ metal" xml.zope. org/namespaces/ i18n" macro=" view/macro: page/main_ only" "launchpad" > slot="main" > macro=" context/ @@launchpad_ form/form" > slot="extra_ info" class=" documentDescrip tion">
--- lib/lp/
+++ lib/lp/
@@ -0,0 +1,18 @@
+<html
+ xmlns="http://
+ xmlns:tal="http://
+ xmlns:metal="http://
+ xmlns:i18n="http://
+ metal:use-
+ i18n:domain=
+ <body>
+ <div metal:fill-
+ <div metal:use-
+ <div metal:fill-
+ You are going to remove the custom language code
+ '<tal:language-code replace="view/code" />'.
+ </div>
+ </div>
+ </div>
+ </body>
+</html>