Merge lp://qastaging/~henninge/launchpad/bug-427959 into lp://qastaging/launchpad

Proposed by Henning Eggers
Status: Merged
Approved by: Henning Eggers
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp://qastaging/~henninge/launchpad/bug-427959
Merge into: lp://qastaging/launchpad
Diff against target: None lines
To merge this branch: bzr merge lp://qastaging/~henninge/launchpad/bug-427959
Reviewer Review Type Date Requested Status
Jeroen T. Vermeulen (community) code Approve
Review via email: mp+11952@code.qastaging.launchpad.net
To post a comment you must log in.
Revision history for this message
Henning Eggers (henninge) wrote :

= Summary =

Converted translationmessage-translate page to 3.0 UI design.

= Implementation details =

As the views for both tm-translate and pofile-translate inherit from BaseTranslationView I moved the label property into the base view.

= Launchpad lint =

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

Linting changed files:
  lib/lp/translations/browser/pofile.py
  lib/lp/translations/browser/translationmessage.py
  lib/lp/translations/stories/standalone/xx-pofile-details.txt
  lib/lp/translations/templates/translationmessage-translate.pt

== Pylint notices ==

lib/lp/translations/browser/translationmessage.py
    111: [W0233, POTMsgSetBatchNavigator.__init__] __init__ method from a non direct base class 'BatchNavigator' is called

This is a known problem because the base BatchNavigator from lazr is not a new-style class.

Revision history for this message
Henning Eggers (henninge) wrote :

=== modified file 'lib/canonical/launchpad/pagetitles.py'
--- lib/canonical/launchpad/pagetitles.py 2009-09-16 22:32:36 +0000
+++ lib/canonical/launchpad/pagetitles.py 2009-09-17 08:56:32 +0000
@@ -1022,10 +1022,4 @@

 translationimportqueueentry_index = 'Translation import queue entry'

-def translationmessage_translate(context, view):
- """Return the page to translate a template into a language per message."""
- return 'Translating %s into %s' % (
- context.pofile.potemplate.displayname,
- context.pofile.language.englishname)
-
 unauthorized = 'Error: Not authorized'

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Two points discussed on IRC:

1. The nav links ought to be reusable. You filed bug 431249 for that,
which is good enough for me.

2. Better for pagetests to "print" page titles than to dump them and
include the quotes (which could in principle be 'x', "x", u'x', or u"x")
in the test output.

That said, God speed!

Jeroen

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/translations/browser/pofile.py'
2--- lib/lp/translations/browser/pofile.py 2009-09-16 15:27:39 +0000
3+++ lib/lp/translations/browser/pofile.py 2009-09-17 08:41:05 +0000
4@@ -668,15 +668,6 @@
5 DEFAULT_SHOW = 'all'
6 DEFAULT_SIZE = 10
7
8- @property
9- def label(self):
10- """Return the page to translate a template into a language."""
11- if self.form_is_writeable:
12- form_label = 'Translating into %s'
13- else:
14- form_label = 'Browsing %s translation'
15- return form_label % self.context.language.englishname
16-
17 def initialize(self):
18 self.pofile = self.context
19 translations_person = ITranslationsPerson(self.user, None)
20
21=== modified file 'lib/lp/translations/browser/translationmessage.py'
22--- lib/lp/translations/browser/translationmessage.py 2009-09-04 11:54:50 +0000
23+++ lib/lp/translations/browser/translationmessage.py 2009-09-17 08:41:05 +0000
24@@ -226,6 +226,15 @@
25 # over just two or three.
26 MAX_PLURAL_FORMS = 100
27
28+ @property
29+ def label(self):
30+ """The label will be used as the main page heading."""
31+ if self.form_is_writeable:
32+ form_label = 'Translating into %s'
33+ else:
34+ form_label = 'Browsing %s translation'
35+ return form_label % self.context.language.englishname
36+
37 def initialize(self):
38 assert self.pofile, "Child class must define self.pofile"
39
40
41=== modified file 'lib/lp/translations/stories/standalone/xx-pofile-details.txt'
42--- lib/lp/translations/stories/standalone/xx-pofile-details.txt 2009-09-17 00:52:54 +0000
43+++ lib/lp/translations/stories/standalone/xx-pofile-details.txt 2009-09-17 08:41:05 +0000
44@@ -101,7 +101,7 @@
45 >>> anon_browser.url
46 'http://translations.launchpad.dev/evolution/trunk/+pots/evolution-2.2/es/14/+translate'
47 >>> anon_browser.title
48- 'Translating evolution-2.2 in Evolution trunk into Spanish'
49+ 'Translations : Series trunk : Evolution'
50
51
52 == Invalid input ==
53
54=== modified file 'lib/lp/translations/templates/translationmessage-translate.pt'
55--- lib/lp/translations/templates/translationmessage-translate.pt 2009-07-17 18:46:25 +0000
56+++ lib/lp/translations/templates/translationmessage-translate.pt 2009-09-17 07:28:30 +0000
57@@ -3,10 +3,7 @@
58 xmlns:tal="http://xml.zope.org/namespaces/tal"
59 xmlns:metal="http://xml.zope.org/namespaces/metal"
60 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
61- xml:lang="en"
62- lang="en"
63- dir="ltr"
64- metal:use-macro="view/macro:page/onecolumn"
65+ metal:use-macro="view/macro:page/main_only"
66 i18n:domain="launchpad"
67 >
68 <body>
69@@ -29,34 +26,25 @@
70
71 <div metal:fill-slot="main">
72
73-
74- <div>
75- <a tal:attributes="href context/pofile/potemplate/fmt:url"
76- tal:content="context/pofile/potemplate/title">
77- evolution 2.10 template
78- </a>
79- </div>
80-
81- <tal:form-not-writeable condition="not:view/form_is_writeable">
82- <h1>
83- Browsing
84- <tal:language replace="context/pofile/language/englishname">
85- Spanish
86- </tal:language>
87- translation
88- </h1>
89- </tal:form-not-writeable>
90- <tal:form-writeable condition="view/form_is_writeable">
91- <h1>
92- Translating into
93- <tal:language replace="context/pofile/language/englishname">
94- Spanish
95- </tal:language>
96- </h1>
97- </tal:form-writeable>
98-
99 <tal:havepluralforms condition="view/has_plural_form_information">
100
101+ <!-- Navigation -->
102+ <ul class="horizontal" style="margin-top: 1em; margin-bottom: 1em;"
103+ tal:define="navigation_menu context/menu:navigation">
104+ <li
105+ tal:define="link navigation_menu/download"
106+ tal:condition="link/enabled"
107+ tal:content="structure link/render"></li>
108+ <li
109+ tal:define="link navigation_menu/upload"
110+ tal:condition="link/enabled"
111+ tal:content="structure link/render"></li>
112+ <li
113+ tal:define="link navigation_menu/details"
114+ tal:condition="link/enabled"
115+ tal:content="structure link/render"></li>
116+ </ul>
117+
118 <!-- Alternative suggestions. -->
119 <div metal:define-macro="editform">
120 <form method="get" action="+translate">