launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #02248
[Merge] lp:~danilo/launchpad/bug-516317 into lp:launchpad
Данило Шеган has proposed merging lp:~danilo/launchpad/bug-516317 into lp:launchpad.
Requested reviews:
Henning Eggers (henninge): ui
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
#516317 Product:+changetranslators should become +settings
https://bugs.launchpad.net/bugs/516317
For more details, see:
https://code.launchpad.net/~danilo/launchpad/bug-516317/+merge/44746
= 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
--
https://code.launchpad.net/~danilo/launchpad/bug-516317/+merge/44746
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~danilo/launchpad/bug-516317 into lp:launchpad.
=== modified file 'lib/lp/registry/browser/configure.zcml'
--- lib/lp/registry/browser/configure.zcml 2010-12-20 20:16:02 +0000
+++ lib/lp/registry/browser/configure.zcml 2010-12-27 17:51:32 +0000
@@ -1443,13 +1443,6 @@
template="../../app/templates/generic-edit.pt"
class="lp.registry.browser.product.ProductConfigureBlueprintsView"/>
<browser:page
- for="lp.registry.interfaces.product.IProduct"
- facet="overview"
- permission="launchpad.Edit"
- name="+configure-translations"
- template="../../app/templates/generic-edit.pt"
- class="lp.registry.browser.product.ProductConfigureTranslationsView"/>
- <browser:page
name="+branding"
for="lp.registry.interfaces.product.IProduct"
facet="overview"
=== modified file 'lib/lp/registry/browser/product.py'
--- lib/lp/registry/browser/product.py 2010-12-21 17:18:59 +0000
+++ lib/lp/registry/browser/product.py 2010-12-27 17:51:32 +0000
@@ -15,7 +15,6 @@
'ProductConfigureBase',
'ProductConfigureAnswersView',
'ProductConfigureBlueprintsView',
- 'ProductConfigureTranslationsView',
'ProductDownloadFileMixin',
'ProductDownloadFilesView',
'ProductEditPeopleView',
@@ -1432,13 +1431,6 @@
usage_fieldname = 'blueprints_usage'
-class ProductConfigureTranslationsView(ProductConfigureBase):
- """View class to configure the Launchpad Translations for a project."""
-
- label = "Configure translations"
- usage_fieldname = 'translations_usage'
-
-
class ProductConfigureAnswersView(ProductConfigureBase):
"""View class to configure the Launchpad Answers for a project."""
=== modified file 'lib/lp/registry/configure.zcml'
--- lib/lp/registry/configure.zcml 2010-12-15 22:05:43 +0000
+++ lib/lp/registry/configure.zcml 2010-12-27 17:51:32 +0000
@@ -1107,6 +1107,7 @@
<require
permission="launchpad.TranslationsAdmin"
set_attributes="
+ official_rosetta
translation_focus
translationgroup
translationpermission"/>
@@ -1124,13 +1125,6 @@
set_schema="lp.registry.interfaces.product.IProductModerateRestricted"
set_attributes="active private_bugs "/>
- <!-- Changes to official_rosetta must be available to Launchpad
- Translations admins so we need its own permission. -->
-
- <require
- permission="launchpad.TranslationsAdmin"
- set_attributes="official_rosetta"/>
-
<!-- IHasAliases -->
<allow
@@ -1400,7 +1394,6 @@
official_answers
official_blueprints
official_malone
- official_rosetta
owner
security_contact
summary
@@ -1413,6 +1406,7 @@
permission="launchpad.TranslationsAdmin"
set_attributes="
language_pack_admin
+ official_rosetta
translationgroup
translationpermission
translation_focus"/>
=== 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-27 17:51:32 +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."),
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-27 17:51:32 +0000
@@ -679,11 +679,11 @@
translation_focus = exported(
ReferenceChoice(
- title=_("Translation Focus"), required=False,
+ title=_("Translation focus"), required=False,
vocabulary='FilteredProductSeries',
schema=IProductSeries,
description=_(
- 'The ProductSeries where translations are focused.')))
+ 'Project series translators should focus on.')))
translatable_packages = Attribute(
"A list of the source packages for this product that can be "
=== modified file 'lib/lp/translations/browser/configure.zcml'
--- lib/lp/translations/browser/configure.zcml 2010-12-22 12:05:12 +0000
+++ lib/lp/translations/browser/configure.zcml 2010-12-27 17:51:32 +0000
@@ -809,12 +809,12 @@
template="../templates/hastranslationimports-index.pt"
layer="lp.translations.publisher.TranslationsLayer"/>
<browser:page
- name="+settings"
+ name="+configure-translations"
for="lp.registry.interfaces.product.IProduct"
+ facet="overview"
class="lp.translations.browser.product.ProductSettingsView"
permission="launchpad.TranslationsAdmin"
- template="../templates/set-translators.pt"
- layer="lp.translations.publisher.TranslationsLayer"/>
+ template="../templates/set-translators.pt"/>
<browser:pages
for="lp.registry.interfaces.product.IProduct"
permission="zope.Public"
=== modified file 'lib/lp/translations/browser/distribution.py'
--- lib/lp/translations/browser/distribution.py 2010-09-23 14:33:51 +0000
+++ lib/lp/translations/browser/distribution.py 2010-12-27 17:51:32 +0000
@@ -44,7 +44,7 @@
@enabled_with_permission('launchpad.TranslationsAdmin')
def settings(self):
- text = 'Change permissions'
+ text = 'Configure translations'
return Link('+settings', text, icon='edit', site='translations')
@enabled_with_permission('launchpad.TranslationsAdmin')
@@ -129,13 +129,14 @@
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"
+ page_title = "Settings"
+ field_names = [
+ "official_rosetta",
+ "translation_focus",
+ "translationgroup",
+ "translationpermission",
+ ]
@property
def cancel_url(self):
=== modified file 'lib/lp/translations/browser/product.py'
--- lib/lp/translations/browser/product.py 2010-09-23 14:33:51 +0000
+++ lib/lp/translations/browser/product.py 2010-12-27 17:51:32 +0000
@@ -20,7 +20,7 @@
from canonical.launchpad.webapp.authorization import check_permission
from canonical.launchpad.webapp.menu import NavigationMenu
from lp.app.enums import service_uses_launchpad
-from lp.registry.browser.product import ProductEditView
+from lp.registry.browser.product import ProductConfigureBase
from lp.registry.interfaces.product import IProduct
from lp.registry.interfaces.productseries import IProductSeries
from lp.registry.interfaces.series import SeriesStatus
@@ -45,8 +45,9 @@
@enabled_with_permission('launchpad.TranslationsAdmin')
def settings(self):
- text = 'Change permissions'
- return Link('+settings', text, icon='edit', site='translations')
+ text = 'Configure translations'
+ return Link(
+ '+configure-translations', text, icon='edit', site='translations')
@enabled_with_permission('launchpad.AnyPerson')
def translationdownload(self):
@@ -70,21 +71,17 @@
return Link(link, text, icon='translation')
-class ProductSettingsView(TranslationsMixin, ProductEditView):
- label = "Set permissions and policies"
- page_title = "Permissions and policies"
+class ProductSettingsView(TranslationsMixin, ProductConfigureBase):
+ label = "Configure translations"
+ page_title = "Configure translations"
+ usage_fieldname = "translations_usage"
field_names = [
+ usage_fieldname,
+ "translation_focus",
"translationgroup",
"translationpermission",
- "translation_focus",
]
- @property
- def cancel_url(self):
- return canonical_url(self.context, rootsite="translations")
-
- next_url = cancel_url
-
class ProductView(LaunchpadView):
=== modified file 'lib/lp/translations/stories/distribution/xx-distribution-translations.txt'
--- lib/lp/translations/stories/distribution/xx-distribution-translations.txt 2010-09-27 20:22:00 +0000
+++ lib/lp/translations/stories/distribution/xx-distribution-translations.txt 2010-12-27 17:51:32 +0000
@@ -1,4 +1,5 @@
-= Distribution translations =
+Distribution translations
+=========================
This page shows a list of PO templates contained within all source
packages for the distroseries that is the translation focus for a
@@ -91,7 +92,7 @@
>>> logout()
We should get latest release as the translation focus.
-
+
>>> browser.open('http://translations.launchpad.dev/debian')
>>> browser.url
'http://translations.launchpad.dev/debian'
@@ -134,11 +135,11 @@
... auth='Basic jeff.waugh@xxxxxxxxxxxxxxx:jdub')
>>> editor_browser.open('http://launchpad.dev/ubuntu')
>>> editor_browser.getLink('Change details').click()
- >>> editor_browser.getControl('Translation Focus').displayValue
+ >>> editor_browser.getControl('Translation focus').displayValue
['ubuntu hoary']
- >>> editor_browser.getControl('Translation Focus').displayValue = [
+ >>> editor_browser.getControl('Translation focus').displayValue = [
... 'ubuntu grumpy']
>>> editor_browser.getControl('Change', index=3).click()
>>> editor_browser.getLink('Change details').click()
- >>> editor_browser.getControl('Translation Focus').displayValue
+ >>> editor_browser.getControl('Translation focus').displayValue
['ubuntu grumpy']
=== modified file 'lib/lp/translations/stories/standalone/xx-potemplate-index.txt'
--- lib/lp/translations/stories/standalone/xx-potemplate-index.txt 2010-09-02 22:26:01 +0000
+++ lib/lp/translations/stories/standalone/xx-potemplate-index.txt 2010-12-27 17:51:32 +0000
@@ -40,7 +40,7 @@
Afrikaans 22 ... ... — —
Japanese 21 ... ... ... Carlos...
Sotho, Southern 22 ... ... — —
- Spanish 15 1 1 ... Valentina Commissari
+ Spanish 15 1 1 ... Valent...
Xhosa 22 ... ... ... —
Zulu 22 ... ... — —
@@ -117,7 +117,8 @@
A source package with five templates is created.
>>> from zope.component import getUtility
- >>> from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities
+ >>> from canonical.launchpad.interfaces.launchpad import (
+ ... ILaunchpadCelebrities)
>>> login('admin@xxxxxxxxxxxxx')
>>> ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
@@ -209,9 +210,6 @@
A product series with 7 templates is created.
- >>> from zope.component import getUtility
- >>> from canonical.launchpad.interfaces.launchpad import (
- ... ILaunchpadCelebrities)
>>> from lp.app.enums import ServiceUsage
>>> login('admin@xxxxxxxxxxxxx')
>>> product = factory.makeProduct(name="fusa",
@@ -281,9 +279,9 @@
>>> user_browser.getLink('download').click()
>>> print user_browser.url
- http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+export
+ http://trans.../ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+export
-Translation administrators will see both download and upload links.
+Translation administrators will see both download and upload links.
Beside administering this template, "Change permissions"
and "Change details" should be also accessible.
@@ -292,33 +290,33 @@
... 'ubuntu/hoary/+source/evolution/+pots/evolution-2.2')
>>> admin_browser.getLink('upload').click()
>>> print admin_browser.url
- http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+upload
+ http://trans.../ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+upload
>>> admin_browser.open(
... 'http://translations.launchpad.dev/'
... 'ubuntu/hoary/+source/evolution/+pots/evolution-2.2')
>>> admin_browser.getLink('download').click()
>>> print admin_browser.url
- http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+export
+ http://trans.../ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+export
>>> admin_browser.open(
... 'http://translations.launchpad.dev/'
... 'ubuntu/hoary/+source/evolution/+pots/evolution-2.2')
>>> admin_browser.getLink('Administer this template').click()
>>> print admin_browser.url
- http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+admin
+ http://trans.../ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+admin
>>> admin_browser.open(
... 'http://translations.launchpad.dev/'
... 'ubuntu/hoary/+source/evolution/+pots/evolution-2.2')
>>> admin_browser.getLink('Change details').click()
>>> print admin_browser.url
- http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+edit
+ http://trans.../ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+edit
>>> admin_browser.open(
... 'http://translations.launchpad.dev/'
... 'ubuntu/hoary/+source/evolution/+pots/evolution-2.2')
- >>> admin_browser.getLink('Change permissions').click()
+ >>> admin_browser.getLink('Configure translations').click()
>>> print admin_browser.url
http://translations.launchpad.dev/ubuntu/+settings
=== modified file 'lib/lp/translations/stories/translationfocus/xx-product-translationfocus.txt'
--- lib/lp/translations/stories/translationfocus/xx-product-translationfocus.txt 2010-10-06 20:49:58 +0000
+++ lib/lp/translations/stories/translationfocus/xx-product-translationfocus.txt 2010-12-27 17:51:32 +0000
@@ -12,12 +12,12 @@
Only admin users are able to change the translation focus of a product.
Unprivileged users can see the recommended series for translation,
-but have no access to the 'Change permissions' menu.
+but have no access to the 'Configure translations' menu.
>>> admin_browser.open(fooproject_url)
>>> print extract_text(
... find_tags_by_class(admin_browser.contents, 'edit sprite')[1])
- Change permissions
+ Configure translations
>>> browser.open(fooproject_url)
>>> print extract_text(
@@ -85,5 +85,6 @@
>>> browser.open(fooproject_url)
>>> print extract_text(find_tags_by_class(browser.contents, 'portlet')[0])
Translation details...
- Launchpad currently recommends translating... Fooproject other-series series.
+ Launchpad currently recommends translating...
+ Fooproject other-series series.
...
=== modified file 'lib/lp/translations/stories/translationgroups/10-distro-translation-group.txt'
--- lib/lp/translations/stories/translationgroups/10-distro-translation-group.txt 2010-10-05 20:25:59 +0000
+++ lib/lp/translations/stories/translationgroups/10-distro-translation-group.txt 2010-12-27 17:51:32 +0000
@@ -21,14 +21,14 @@
>>> ubuntu_owner_browser = setupBrowser(
... auth='Basic colin.watson@xxxxxxxxxxxxxxx:test')
>>> ubuntu_owner_browser.open(anon_browser.url)
- >>> ubuntu_owner_browser.getLink('Change permissions').click()
+ >>> ubuntu_owner_browser.getLink('Configure translations').click()
>>> print ubuntu_owner_browser.title
- Set translation permissions for Ubuntu...
+ Settings : Translations : Ubuntu
Other users cannot access this page, nor see the menu link to it.
>>> user_browser.open(anon_browser.url)
- >>> user_browser.getLink('Change permissions').click()
+ >>> user_browser.getLink('Configure translations').click()
Traceback (most recent call last):
...
LinkNotFoundError
=== modified file 'lib/lp/translations/stories/translationgroups/15-product-translation-group.txt'
--- lib/lp/translations/stories/translationgroups/15-product-translation-group.txt 2010-10-06 20:49:58 +0000
+++ lib/lp/translations/stories/translationgroups/15-product-translation-group.txt 2010-12-27 17:51:32 +0000
@@ -32,11 +32,11 @@
group and permissions.
>>> translations_page_url = netapplet_owner_browser.url
- >>> netapplet_owner_browser.getLink('Change permissions').click()
+ >>> netapplet_owner_browser.getLink('Configure translations').click()
>>> change_translators_url = netapplet_owner_browser.url
>>> print netapplet_owner_browser.title
- Permissions and policies...
+ Configure translations : Translations : NetApplet
>>> print netapplet_owner_browser.getControl(
... 'Translation group').displayOptions
@@ -47,11 +47,11 @@
... 'Translation group').displayValue
['(no value)']
-Ordinary users cannot see the "Change permissions" link or the page it
+Ordinary users cannot see the "Configure translations" link or the page it
leads to.
>>> user_browser.open(translations_page_url)
- >>> user_browser.getLink('Change permissions').click()
+ >>> user_browser.getLink('Configure translations').click()
Traceback (most recent call last):
...
LinkNotFoundError
=== modified file 'lib/lp/translations/stories/translationgroups/46-test-distro-structured-permissions.txt'
--- lib/lp/translations/stories/translationgroups/46-test-distro-structured-permissions.txt 2010-08-24 22:23:17 +0000
+++ lib/lp/translations/stories/translationgroups/46-test-distro-structured-permissions.txt 2010-12-27 17:51:32 +0000
@@ -15,7 +15,7 @@
as the translation group for the netapplet product...
>>> admin_browser.getLink('Translations').click()
- >>> admin_browser.getLink('Change permissions').click()
+ >>> admin_browser.getLink('Configure translations').click()
>>> admin_browser.getControl('Translation group').displayOptions
['(no value)', 'Single-language Translators',
'The PolyGlot Translation Group', 'Just a testing team']
=== modified file 'lib/lp/translations/stories/translationgroups/xx-change-translation-policy.txt'
--- lib/lp/translations/stories/translationgroups/xx-change-translation-policy.txt 2010-08-31 18:10:51 +0000
+++ lib/lp/translations/stories/translationgroups/xx-change-translation-policy.txt 2010-12-27 17:51:32 +0000
@@ -19,20 +19,20 @@
>>> po_browser = setupBrowser("Basic po@xxxxxx:test")
Visiting the main products translations page, product owners and Rosetta
-administrators sees the "Change permissions" link, leading to the
+administrators sees the "Configure translations" link, leading to the
translations settings page.
>>> re_browser.open(
... 'http://translations.launchpad.dev/chestii')
- >>> re_browser.getLink('Change permissions').click()
+ >>> re_browser.getLink('Configure translations').click()
>>> print re_browser.url
- http://translations.launchpad.dev/chestii/+settings
+ http://translations.launchpad.dev/chestii/+configure-translations
>>> po_browser.open(
... 'http://translations.launchpad.dev/chestii')
- >>> po_browser.getLink('Change permissions').click()
+ >>> po_browser.getLink('Configure translations').click()
>>> print po_browser.url
- http://translations.launchpad.dev/chestii/+settings
+ http://translations.launchpad.dev/chestii/+configure-translations
From the settings page, translations group and translation permissions
can be changed.
@@ -58,7 +58,7 @@
>>> dtc_browser.open(
... 'http://translations.launchpad.dev/chestii')
- >>> dtc_browser.getLink('Change permissions')
+ >>> dtc_browser.getLink('Configure translations')
Traceback (most recent call last):
...
LinkNotFoundError...
@@ -66,7 +66,8 @@
An attempt to access the translations policy url will not be authorized.
>>> browser.open(
- ... 'http://translations.launchpad.dev/chestii/+settings')
+ ... 'http://translations.launchpad.dev/'
+ ... 'chestii/+configure-translations')
Traceback (most recent call last):
...
Unauthorized...
@@ -80,7 +81,7 @@
>>> dtc_browser.open(
... 'http://translations.launchpad.dev/ubuntu')
- >>> dtc_browser.getLink('Change permissions').click()
+ >>> dtc_browser.getLink('Configure translations').click()
>>> print dtc_browser.url
http://translations.launchpad.dev/ubuntu/+settings
=== modified file 'lib/lp/translations/templates/hastranslationgroup-portlet-translation-groups-and-permission.pt'
--- lib/lp/translations/templates/hastranslationgroup-portlet-translation-groups-and-permission.pt 2010-02-16 21:21:14 +0000
+++ lib/lp/translations/templates/hastranslationgroup-portlet-translation-groups-and-permission.pt 2010-12-27 17:51:32 +0000
@@ -14,7 +14,7 @@
</p>
<div tal:condition="context/required:launchpad.TranslationsAdmin">
<a tal:replace="structure context/menu:translations/settings/fmt:link">
- Change permissions
+ Settings
</a>
</div>
</div>
Follow ups