> >
> > -
> > +
> > + These
> > Evolution
> > - is translated by
> > + translations are managed by
> >
> > - Serbian translators — if you need help, or your
> > - translations are not being reviewed, please get in touch with them.
> > + Serbian translators.
> >
> >
> > -
> > - There is no team to translate
> > +
> > + There is no team to manage
> > Evolution
> > - to
> > + translations to
> > > tal:content="context/language/englishname">Serbian.
> > To set one up, please get in touch with
> > - > - >Launchpad Translators
> > - coordinator.
> > + > + >Launchpad Translators.
> >
> >
> > -
> > -
> > - Choose a template name to begin translating.
> > +
> > +
>
> You used the same id in 3 different elements above. I understand these
> elements are not expected to be present in the page at the same time,
> but that's not very clear and if we have a bug and more than one of them
> ends up in the page, we'll have even more problems. In this case you
> can wrap everything with a
with the id you want, like this:
Hope it is ok now.
>
>
> First
>
>
> Second
>
>
> Third
>
>
>
> > + There is no translation group to manage
> > +
Evolution
> > + translations.
> > +
> > +
> > +
> + condition="view/translation_group">
>
> Oops, there's a bug here. This
will not be left out when there's no
> translation group because tal doesn't understand the bare 'condition='
> above -- it has to be a 'tal:condition=', although you can use a bare
> 'condition=' when you use a tal element (e.g. ' condition="...">').
It should be fixed.
> This also suggests to me that we're missing a test to show that the
> access level description is left out when there's no translation group.
New test for no translation group added.
Also I'm testing the links.
Hope browser.getLink('something',index=1) is working.
> > +
> > + You can add suggestions for these translations.
> > +
> > Templates which are more important to translate are listed first.
> >
> >
>
Here is the new diff.
=== modified file 'lib/lp/translations/browser/serieslanguage.py'
--- lib/lp/translations/browser/serieslanguage.py 2009-12-11 16:09:04 +0000
+++ lib/lp/translations/browser/serieslanguage.py 2009-12-11 19:53:07 +0000
@@ -76,7 +76,7 @@
@property
def access_level_description(self):
if self.user is None:
- return ("You are not logged in. Please log in to work " +
+ return ("You are not logged in. Please log in to work "
"on translations.")
translations_person = ITranslationsPerson(self.user)
@@ -89,11 +89,21 @@
translations_contact_link = PersonFormatterAPI(
self.translation_group.owner).link(None)
+ if translations_contact_link is None:
+ #Having no translation group is a valid case, but the
+ #template should not call access_level_description for
+ #this condition.
+ #We return a blank screen since the information about
+ #missing group is displaying in a different section
+ return ""
+
if not translations_person.translations_relicensing_agreement:
translation_license_url = PersonFormatterAPI(
- translations_person).url() + '/translations/+licensing'
- return ("To make translations in Launchpad you need to " +
- "agree with the " +
+ translations_person).url(
+ view_name='+licensing',
+ rootsite='translations')
+ return ("To make translations in Launchpad you need to "
+ "agree with the "
"Translations licensing.") % (
translation_license_url)
@@ -103,23 +113,23 @@
return "You can add and review translations."
if sample_pofile.canAddSuggestions(self.user):
- return ("Your suggestions will be held for review by " +
- "the managers of these translations. If you " +
- "need help, or your translations are not being " +
- "reviewed, please get in touch with " +
- "%s") % translations_contact_link
+ return ("Your suggestions will be held for review by "
+ "%s. If you need help, or your translations are "
+ "not being reviewed, please get in touch with "
+ "%s.") % (
+ translations_contact_link,
+ translations_contact_link)
permission = sample_pofile.translationpermission
if permission == TranslationPermission.CLOSED:
- return ("These templates can be translated only by " +
- "its managers")
+ return ("These templates can be translated only by "
+ "its managers.")
- # no-managers
if self.translation_team is None:
- return ("Since there is nobody to manage translation " +
- "approvals into this language, your cannot add " +
- "new suggestions. If you are interested in making " +
- "translations, please contact %s") % (
+ return ("Since there is nobody to manage translation "
+ "approvals into this language, your cannot add "
+ "new suggestions. If you are interested in making "
+ "translations, please contact %s.") % (
translations_contact_link)
raise AssertionError(
@@ -145,7 +155,7 @@
series = self.context.productseries
super(ProductSeriesLanguageView, self).initialize(
series=series,
- translationgroup=series.product.translationgroup)
+ translationgroup=series.product.translationgroup)
self.context.recalculateCounts()
self.parent = self.series.product
=== modified file 'lib/lp/translations/stories/standalone/xx-serieslanguage-index.txt'
--- lib/lp/translations/stories/standalone/xx-serieslanguage-index.txt 2009-12-11 16:15:33 +0000
+++ lib/lp/translations/stories/standalone/xx-serieslanguage-index.txt 2009-12-11 19:45:10 +0000
@@ -46,7 +46,7 @@
... find_tag_by_id(user_browser.contents, 'group-team-info'))
There is no translation group to manage Ubuntu translations.
-Create a translation group for Ubuntu, togheter with a translation
+Create a translation group for Ubuntu, together with a translation
person for managing Ubuntu Spanish translations and set translation
policy to RESTRICTED.
This is done to so see what the page will look like when they exist.
@@ -63,7 +63,8 @@
>>> utg = factory.makeTranslationGroup(
... owner=utc_team, name='utg', title='Ubuntu Translation Group')
>>> st_coordinator = factory.makePerson(
- ... displayname='Ubuntu Spanish Translator')
+ ... name="ubuntu-l10n-es",
+ ... displayname='Ubuntu Spanish Translators')
>>> ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
>>> ubuntu.translationgroup = utg
@@ -84,7 +85,7 @@
>>> print extract_text(
... find_tag_by_id(user_browser.contents, 'group-team-info'))
- These Ubuntu translations are managed by Ubuntu Spanish Translator.
+ These Ubuntu translations are managed by Ubuntu Spanish Translators.
Authenticated users can add suggestion but will be held for review by
the members of Spanish translations team.
@@ -92,33 +93,77 @@
>>> print extract_text(
... find_tag_by_id(
... user_browser.contents, 'translation-access-level'))
- Your suggestions will be held for review by the managers of
- these translations. If you need help, ...
- please get in touch with Ubuntu Spanish Translator...
+ Your suggestions will be held for review by
+ Ubuntu Spanish Translator...
+ please get in touch with Ubuntu Spanish Translators...
+
+Users will see three references to the team managing these translations.
+
+ >>> print user_browser.getLink(
+ ... 'Ubuntu Spanish Translator',index=0).url
+ http://launchpad.dev/~ubuntu-l10n-es
+
+ >>> print user_browser.getLink(
+ ... 'Ubuntu Spanish Translator',index=1).url
+ http://launchpad.dev/~ubuntu-l10n-es
+
+ >>> print user_browser.getLink(
+ ... 'Ubuntu Spanish Translator',index=2).url
+ http://launchpad.dev/~ubuntu-l10n-es
Catalan has no translation team for managing translations and since
there is no one to review the work, authenticated users can not add
suggestions.
- >>> user_browser.open('http://translations.launchpad.dev/ubuntu/hoary/')
+ >>> user_browser.open(
+ ... 'http://translations.launchpad.dev/ubuntu/hoary/')
>>> user_browser.getLink('Catalan').click()
>>> print user_browser.url
http://translations.launchpad.dev/ubuntu/hoary/+lang/ca
- >>> print extract_text(find_tag_by_id(user_browser.contents, 'group-team-info'))
+ >>> print extract_text(
+ ... find_tag_by_id(user_browser.contents, 'group-team-info'))
There is no team to manage ... To set one up, please get in touch
with Ubuntu Translation Coordinators.
- >>> print extract_text(find_tag_by_id(user_browser.contents, 'translation-access-level'))
+ >>> print extract_text(find_tag_by_id(
+ ... user_browser.contents, 'translation-access-level'))
Since there is nobody to manage translation ...
your cannot add new suggestions. If you are interested in making
translations, please contact Ubuntu Translation Coordinators...
+ >>> print user_browser.getLink(
+ ... 'Ubuntu Translation Coordinators',index=0).url
+ http://launchpad.dev/~utc-team
+ >>> print user_browser.getLink(
+ ... 'Ubuntu Translation Coordinators',index=1).url
+ http://launchpad.dev/~utc-team
+
Members of translation team and translations admins have full access to
translations. They can add and review translations.
- >>> admin_browser.open('http://translations.launchpad.dev/ubuntu/hoary/+lang/ro')
- >>> print extract_text(find_tag_by_id(admin_browser.contents, 'translation-access-level'))
+ >>> admin_browser.open(
+ ... 'http://translations.launchpad.dev/ubuntu/hoary/+lang/ro')
+ >>> print extract_text(find_tag_by_id(
+ ... admin_browser.contents, 'translation-access-level'))
You can add and review translations...
+
+For project with no translation teams, translators see a note stating
+there is no group. No access level information is displayed in this case.
+
+ >>> login('')
+ >>> ubuntu.translationgroup = None
+ >>> logout()
+
+ >>> user_browser.open(
+ ... 'http://translations.launchpad.dev/ubuntu/hoary/+lang/ro')
+ >>> print extract_text(
+ ... find_tag_by_id(user_browser.contents, 'group-team-info'))
+ There is no translation group to manage Ubuntu translations.
+
+ >>> print extract_text(find_tag_by_id(
+ ... user_browser.contents, 'translation-access-level'))
+ Templates which are more important to translate are listed first.
+
The details of the page are tested at the view level.
=== modified file 'lib/lp/translations/templates/serieslanguage-index.pt'
--- lib/lp/translations/templates/serieslanguage-index.pt 2009-12-11 16:09:04 +0000
+++ lib/lp/translations/templates/serieslanguage-index.pt 2009-12-11 19:42:33 +0000
@@ -16,40 +16,43 @@
-
-
- These
- Evolution
- translations are managed by
-
- Serbian translators.
-
+
+
+
+ These
+ Evolution
+ translations are managed by
+
+ Serbian translators.
+
-
- There is no team to manage
- Evolution
- translations to
- Serbian.
- To set one up, please get in touch with
- Launchpad Translators.
-
-
-
-
- There is no translation group to manage
- Evolution
- translations.
-
-
-
-
+
+ There is no team to manage
+ Evolution
+ translations to
+ Serbian.
+ To set one up, please get in touch with
+ Launchpad Translators.
+
+
+
+
+ There is no translation group to manage
+ Evolution
+ translations.
+
+
+
+
+
You can add suggestions for these translations.
Templates which are more important to translate are listed first.
--
Adi Roiban