Merge lp:~danilo/launchpad/bug-423836-a into lp:~danilo/launchpad/bug-427264
- bug-423836-a
- Merge into bug-427264
Status: | Merged |
---|---|
Merge reported by: | Данило Шеган |
Merged at revision: | not available |
Proposed branch: | lp:~danilo/launchpad/bug-423836-a |
Merge into: | lp:~danilo/launchpad/bug-427264 |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~danilo/launchpad/bug-423836-a |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Nelson (community) | code | Approve | |
Данило Шеган | Pending | ||
Review via email: mp+11512@code.launchpad.net |
Commit message
Description of the change
Данило Шеган (danilo) wrote : | # |
Michael Nelson (michael.nelson) wrote : | # |
Wow - a huge amount of work has gone into this Danilo!
I've mainly got a few questions below, but there was one thing that needs fixing - a CSS rule that I think you meant to apply just to your table, but applies globally to all th's.
Phew! I'm glad you managed to split them up now - I don't think I could sensibly do another review today :)
Cheers,
-Michael
> === modified file 'lib/canonical/
> --- lib/canonical/
> +++ lib/canonical/
> @@ -748,6 +748,38 @@
> padding: 2px 1em 2px 2px;
> }
>
> +/* Translations statistics and legend.
> + *
> + * Examples:
> + * https:/
> + * https:/
> + */
Great to see examples in there as recommended the other week!
> +
> +div.translatio
> + padding-top: 2em;
> + padding-bottom: 1em;
> +}
Note: although we didn't get to it in the reviewers meeting on 09/09/09,
I saw that barry had an agenda item:
* 4-space indents for CSS styles [barry]
Also, if that table can get large, and you want to do easy
alternate-
tbody.translati
which works in FF3.5, webkit/chromium etc., without having to add markup.
See http://
if you're interested.
This CSS could possibly be much simpler if you put
the 'translation-stats' class on the table element (instead of on the
tbody). Then you could remove the overall-
> +tbody.
table.translati
(that way you don't need a separate rule for the tfoot below.)
> + text-align:center;
> +}
> +tbody.
table.translati
(no difference there).
> + text-align:left;
> +}
> +tfoot tr.overall-
Yikes - careful there. This actually reads currently as:
"Apply the following styles to any td's inside a tr...etc., or *any* th."
So, for example, you can see this is being applied to th's at:
https:/
Anyway, if you updated the class as suggested above, you could write it
as:
table.translati
> + background-color: #f7f7f7;
> + border: 0px;
> + border-top: 2px solid #d2d2d2;
> + border-bottom: 2px solid #d2d2d2;
> + padding-top: 5px;
> + padding-bottom: 5px;
> + font-weight: bold;
> +}
> +tfoot tr.overall-
table.translati
> + text-align:left;
> +}
> +tfoot tr.overall-
table.translati
> + text-align:center;
> +}
> table.narrow-
> width: 45em;
> }
>
[snip]
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -5,17 +5,26 @@
>
> __meta...
Данило Шеган (danilo) wrote : | # |
Hi Michael,
Thanks a lot for the review. Comments inline.
У чет, 10. 09 2009. у 14:44 +0000, Michael Nelson пише:
> I've mainly got a few questions below, but there was one thing that
> needs fixing - a CSS rule that I think you meant to apply just to your
> table, but applies globally to all th's.
Indeed, this is something I forgot to fix up from the 'prototyping'
phase.
> > === modified file 'lib/canonical/
> > --- lib/canonical/
> > +++ lib/canonical/
...
> > +
> > +div.translatio
> > + padding-top: 2em;
> > + padding-bottom: 1em;
> > +}
>
> Note: although we didn't get to it in the reviewers meeting on 09/09/09,
> I saw that barry had an agenda item:
>
> * 4-space indents for CSS styles [barry]
Fixed.
> Also, if that table can get large, and you want to do easy
> alternate-
>
> tbody.translati
Oh, I know about that CSS3 feature. However, considering my main
browser is Epiphany which still uses xulrunner 1.9 (I believe shared
with Firefox 2 or 3), I am not personally interested :)
Just kidding, I am not going to change styles on existing table too
much, if at all. I am trying to make this mostly mechanical.
> This CSS could possibly be much simpler if you put
> the 'translation-stats' class on the table element (instead of on the
> tbody). Then you could remove the overall-
That's actually what I started with. However, fighting legacy CSS code
is hell. 'table.listing tbody td' takes precedence over
'table.
class='listing' on these tables, though, simply because I am not trying
to solve all the problems with these pages. It's mostly mechanical
changes, and no real redesign.
> > +tbody.
>
> table.translati
>
> (that way you don't need a separate rule for the tfoot below.)
Actually, the 'cascading' of CSS seems to cause me problems in at least
Epiphany (xulrunner 1.9): if I set the rule up like that (that's what I
started with), it doesn't get picked up. I'll play a bit more with CSS
and will follow up.
It's good to know that even CSS precedence rules differ between
browsers. :(
> > +tfoot tr.overall-
>
> Yikes - careful there. This actually reads currently as:
>
> "Apply the following styles to any td's inside a tr...etc., or *any* th."
>
> So, for example, you can see this is being applied to th's at:
>
> https:/
Right, fixed.
> > === modified file 'lib/lp/
...
> >
> > + @property
> > + def page_title(self):
> > + return self.context.title
> > +
>
> Just note that you will probably need to remove this soon - when barry's
> branch lands that calculates the <title> automatically. It should only
> be overridden here in special cases (yes, this changed... see the points
> under "Here are the specific coding recommendations fo...
1 | === modified file 'lib/canonical/launchpad/icing/style-3-0.css' | |||
2 | --- lib/canonical/launchpad/icing/style-3-0.css 2009-09-09 18:52:48 +0000 | |||
3 | +++ lib/canonical/launchpad/icing/style-3-0.css 2009-09-11 06:26:18 +0000 | |||
4 | @@ -695,32 +695,32 @@ | |||
5 | 695 | /* ==== Translations hand-made forms ==== */ | 695 | /* ==== Translations hand-made forms ==== */ |
6 | 696 | 696 | ||
7 | 697 | form.translations div.fields { | 697 | form.translations div.fields { |
9 | 698 | padding: 1em; | 698 | padding: 1em; |
10 | 699 | } | 699 | } |
11 | 700 | 700 | ||
12 | 701 | form.translations div.actions { | 701 | form.translations div.actions { |
16 | 702 | padding: 1em; | 702 | padding: 1em; |
17 | 703 | text-align: right; | 703 | text-align: right; |
18 | 704 | clear:both; | 704 | clear:both; |
19 | 705 | } | 705 | } |
20 | 706 | 706 | ||
21 | 707 | form.translations input { | 707 | form.translations input { |
24 | 708 | padding-left: 0.5em; | 708 | padding-left: 0.5em; |
25 | 709 | padding-right: 0.5em; | 709 | padding-right: 0.5em; |
26 | 710 | } | 710 | } |
27 | 711 | 711 | ||
28 | 712 | form.translations select { | 712 | form.translations select { |
31 | 713 | margin-left: 0.5em; | 713 | margin-left: 0.5em; |
32 | 714 | padding-right: 0.5em; | 714 | padding-right: 0.5em; |
33 | 715 | } | 715 | } |
34 | 716 | 716 | ||
35 | 717 | form.translations label { | 717 | form.translations label { |
38 | 718 | padding-left: 0.5em; | 718 | padding-left: 0.5em; |
39 | 719 | padding-right: 1em; | 719 | padding-right: 1em; |
40 | 720 | } | 720 | } |
41 | 721 | 721 | ||
42 | 722 | form.translations .listbox label { | 722 | form.translations .listbox label { |
44 | 723 | padding: 2px 1em 2px 2px; | 723 | padding: 2px 1em 2px 2px; |
45 | 724 | } | 724 | } |
46 | 725 | 725 | ||
47 | 726 | /* Provide top-alignment for radio boxes and longer explanations | 726 | /* Provide top-alignment for radio boxes and longer explanations |
48 | @@ -731,21 +731,21 @@ | |||
49 | 731 | * https://translations.launchpad.dev/evolution/trunk/+pots/evolution-2.2/+export | 731 | * https://translations.launchpad.dev/evolution/trunk/+pots/evolution-2.2/+export |
50 | 732 | */ | 732 | */ |
51 | 733 | form.translations div.alignment .content { | 733 | form.translations div.alignment .content { |
53 | 734 | float:left; | 734 | float:left; |
54 | 735 | } | 735 | } |
55 | 736 | form.translations div.alignment .selector { | 736 | form.translations div.alignment .selector { |
59 | 737 | margin-right: 0.5em; | 737 | margin-right: 0.5em; |
60 | 738 | float: left; | 738 | float: left; |
61 | 739 | clear: both; | 739 | clear: both; |
62 | 740 | } | 740 | } |
63 | 741 | form.translations div.alignment .content label { | 741 | form.translations div.alignment .content label { |
67 | 742 | padding: 0px; | 742 | padding: 0px; |
68 | 743 | margin: 0px; | 743 | margin: 0px; |
69 | 744 | font-weight: bold; | 744 | font-weight: bold; |
70 | 745 | } | 745 | } |
71 | 746 | form.translations div.alignment .secondary label { | 746 | form.translations div.alignment .secondary label { |
74 | 747 | font-weight: normal; | 747 | font-weight: normal; |
75 | 748 | padding: 2px 1em 2px 2px; | 748 | padding: 2px 1em 2px 2px; |
76 | 749 | } | 749 | } |
77 | 750 | 750 | ||
78 | 751 | /* Translations statistics and legend. | 751 | /* Translations statistics and legend. |
79 | @@ -756,30 +756,31 @@ | |||
80 | 756 | */ | 756 | */ |
81 | 757 | 757 | ||
82 | 758 | div.translations-legend { | 758 | div.translations-legend { |
85 | 759 | padding-top: 2em; | 759 | padding-top: 2em; |
86 | 760 | padding-bottom: 1em; | 760 | padding-bottom: 1em; |
87 | 761 | } | 761 | } |
88 | 762 | tbody.translation-stats td { | 762 | tbody.translation-stats td { |
90 | 763 | text-align:center; | 763 | text-align:center; |
91 | 764 | } | 764 | } |
92 | 765 | tbody.translation-stats td.template-name { | 765 | tbody.translation-stats td.template-name { |
106 | 766 | text-align:left; | 766 | text-align:left; |
107 | 767 | } | 767 | } |
108 | 768 | tfoot tr.overall-translation-stats td, th { | 768 | tfoot tr.overall-translation-stats td, |
109 | 769 | background-color: #f7f7f7; | 769 | tfoot tr.overall-translation-stats th { |
110 | 770 | border: 0px; | 770 | background-color: #f7f7f7; |
111 | 771 | border-top: 2px solid #d2d2d2; | 771 | border: 0px; |
112 | 772 | border-bottom: 2px solid #d2d2d2; | 772 | border-top: 2px solid #d2d2d2; |
113 | 773 | padding-top: 5px; | 773 | border-bottom: 2px solid #d2d2d2; |
114 | 774 | padding-bottom: 5px; | 774 | padding-top: 5px; |
115 | 775 | font-weight: bold; | 775 | padding-bottom: 5px; |
116 | 776 | } | 776 | font-weight: bold; |
117 | 777 | tfoot tr.overall-translation-stats th { | 777 | } |
118 | 778 | text-align:left; | 778 | tfoot tr.overall-translation-stats th { |
119 | 779 | text-align:left; | ||
120 | 779 | } | 780 | } |
121 | 780 | tfoot tr.overall-translation-stats td { | 781 | tfoot tr.overall-translation-stats td { |
123 | 781 | text-align:center; | 782 | text-align:center; |
124 | 782 | } | 783 | } |
125 | 783 | table.narrow-listing { | 784 | table.narrow-listing { |
127 | 784 | width: 45em; | 785 | width: 45em; |
128 | 785 | } | 786 | } |
129 | 786 | 787 | ||
130 | === added file 'lib/lp/translations/browser/tests/test_distroserieslanguage_views.py' | |||
131 | --- lib/lp/translations/browser/tests/test_distroserieslanguage_views.py 1970-01-01 00:00:00 +0000 | |||
132 | +++ lib/lp/translations/browser/tests/test_distroserieslanguage_views.py 2009-09-11 06:42:33 +0000 | |||
133 | @@ -0,0 +1,72 @@ | |||
134 | 1 | # Copyright 2009 Canonical Ltd. This software is licensed under the | ||
135 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | ||
136 | 3 | |||
137 | 4 | __metaclass__ = type | ||
138 | 5 | |||
139 | 6 | import transaction | ||
140 | 7 | import unittest | ||
141 | 8 | |||
142 | 9 | from zope.component import getUtility | ||
143 | 10 | |||
144 | 11 | from lp.translations.browser.distroserieslanguage import ( | ||
145 | 12 | DistroSeriesLanguageView) | ||
146 | 13 | from lp.translations.interfaces.translator import ITranslatorSet | ||
147 | 14 | from canonical.launchpad.webapp.servers import LaunchpadTestRequest | ||
148 | 15 | from canonical.testing import LaunchpadZopelessLayer | ||
149 | 16 | from lp.translations.browser.distroseries import DistroSeriesView | ||
150 | 17 | from lp.services.worlddata.interfaces.language import ILanguageSet | ||
151 | 18 | from lp.testing import TestCaseWithFactory, login_person | ||
152 | 19 | |||
153 | 20 | |||
154 | 21 | class TestDistroSeriesLanguage(TestCaseWithFactory): | ||
155 | 22 | """Test DistroSeriesLanguage view.""" | ||
156 | 23 | |||
157 | 24 | layer = LaunchpadZopelessLayer | ||
158 | 25 | |||
159 | 26 | def setUp(self): | ||
160 | 27 | # Create a distroseries that uses translations. | ||
161 | 28 | TestCaseWithFactory.setUp(self) | ||
162 | 29 | self.distroseries = self.factory.makeDistroRelease() | ||
163 | 30 | self.distroseries.distribution.official_rosetta = True | ||
164 | 31 | self.language = getUtility(ILanguageSet).getLanguageByCode('sr') | ||
165 | 32 | sourcepackagename = self.factory.makeSourcePackageName() | ||
166 | 33 | potemplate = self.factory.makePOTemplate( | ||
167 | 34 | distroseries=self.distroseries, | ||
168 | 35 | sourcepackagename=sourcepackagename) | ||
169 | 36 | pofile = self.factory.makePOFile('sr', potemplate) | ||
170 | 37 | self.distroseries.updateStatistics(transaction) | ||
171 | 38 | self.dsl = self.distroseries.distroserieslanguages[0] | ||
172 | 39 | self.view = DistroSeriesLanguageView( | ||
173 | 40 | self.dsl, LaunchpadTestRequest()) | ||
174 | 41 | |||
175 | 42 | def test_empty_view(self): | ||
176 | 43 | self.assertEquals(self.view.translation_group, None) | ||
177 | 44 | self.assertEquals(self.view.translation_team, None) | ||
178 | 45 | self.assertEquals(self.view.context, self.dsl) | ||
179 | 46 | |||
180 | 47 | def test_translation_group(self): | ||
181 | 48 | group = self.factory.makeTranslationGroup( | ||
182 | 49 | self.distroseries.distribution.owner, url=None) | ||
183 | 50 | self.distroseries.distribution.translationgroup = group | ||
184 | 51 | self.assertEquals(self.view.translation_group, group) | ||
185 | 52 | |||
186 | 53 | def test_translation_team(self): | ||
187 | 54 | # Just having a group doesn't mean there's a translation | ||
188 | 55 | # team as well. | ||
189 | 56 | group = self.factory.makeTranslationGroup( | ||
190 | 57 | self.distroseries.distribution.owner, url=None) | ||
191 | 58 | self.distroseries.distribution.translationgroup = group | ||
192 | 59 | self.assertEquals(self.view.translation_team, None) | ||
193 | 60 | |||
194 | 61 | # Setting a translator for this languages makes it | ||
195 | 62 | # appear as the translation_team. | ||
196 | 63 | team = self.factory.makeTeam() | ||
197 | 64 | translator = getUtility(ITranslatorSet).new( | ||
198 | 65 | group, self.language, team) | ||
199 | 66 | # Recreate the view because we are using a cached property. | ||
200 | 67 | self.view = DistroSeriesLanguageView( | ||
201 | 68 | self.dsl, LaunchpadTestRequest()) | ||
202 | 69 | self.assertEquals(self.view.translation_team, translator) | ||
203 | 70 | |||
204 | 71 | def test_suite(): | ||
205 | 72 | return unittest.TestLoader().loadTestsFromName(__name__) | ||
206 | 0 | 73 | ||
207 | === modified file 'lib/lp/translations/doc/distroseries-language.txt' | |||
208 | --- lib/lp/translations/doc/distroseries-language.txt 2009-07-14 12:37:42 +0000 | |||
209 | +++ lib/lp/translations/doc/distroseries-language.txt 2009-09-11 06:46:22 +0000 | |||
210 | @@ -19,6 +19,11 @@ | |||
211 | 19 | >>> spanish = getUtility(ILanguageSet)['es'] | 19 | >>> spanish = getUtility(ILanguageSet)['es'] |
212 | 20 | >>> hoary_spanish = hoary.getDistroSeriesLanguage(spanish) | 20 | >>> hoary_spanish = hoary.getDistroSeriesLanguage(spanish) |
213 | 21 | 21 | ||
214 | 22 | DistroSeriesLanguage provides basic `title` describing what is it about. | ||
215 | 23 | |||
216 | 24 | >>> hoary_spanish.title | ||
217 | 25 | Spanish translations of Ubuntu Hoary | ||
218 | 26 | |||
219 | 22 | In DistroSeriesLanguage.pofiles we find real POFiles for the given | 27 | In DistroSeriesLanguage.pofiles we find real POFiles for the given |
220 | 23 | DistroSeries in the given language. That is, translations that actually | 28 | DistroSeries in the given language. That is, translations that actually |
221 | 24 | contain messages. | 29 | contain messages. |
222 | 25 | 30 | ||
223 | === modified file 'lib/lp/translations/model/distroserieslanguage.py' | |||
224 | --- lib/lp/translations/model/distroserieslanguage.py 2009-09-09 11:57:25 +0000 | |||
225 | +++ lib/lp/translations/model/distroserieslanguage.py 2009-09-11 06:45:34 +0000 | |||
226 | @@ -58,10 +58,6 @@ | |||
227 | 58 | self.distroseries.displayname) | 58 | self.distroseries.displayname) |
228 | 59 | 59 | ||
229 | 60 | @property | 60 | @property |
230 | 61 | def text(self): | ||
231 | 62 | return self.language.englishname | ||
232 | 63 | |||
233 | 64 | @property | ||
234 | 65 | def pofiles(self): | 61 | def pofiles(self): |
235 | 66 | return POFile.select(''' | 62 | return POFile.select(''' |
236 | 67 | POFile.language = %s AND | 63 | POFile.language = %s AND |
237 | 68 | 64 |
Michael Nelson (michael.nelson) wrote : | # |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Данило Шеган wrote:
> Hi Michael,
>
> Thanks a lot for the review. Comments inline.
>
Thanks for the changes! r=me - some comments below.
Cheers,
Michael.
>
>> This CSS could possibly be much simpler if you put
>> the 'translation-stats' class on the table element (instead of on the
>> tbody). Then you could remove the overall-
>
> That's actually what I started with. However, fighting legacy CSS code
> is hell. 'table.listing tbody td' takes precedence over
> 'table.
> class='listing' on these tables, though, simply because I am not trying
> to solve all the problems with these pages. It's mostly mechanical
> changes, and no real redesign.
OK. It's up to you, but I'm guessing:
table.listing.
would take precedence (ie. selecting both classes - as it's more
specific). I'm not fussed either way - what you've got works, and it's
not a huge improvement to remove one class.
>
>>> +tbody.
>> table.translati
>>
>> (that way you don't need a separate rule for the tfoot below.)
>
> Actually, the 'cascading' of CSS seems to cause me problems in at least
> Epiphany (xulrunner 1.9): if I set the rule up like that (that's what I
> started with), it doesn't get picked up. I'll play a bit more with CSS
> and will follow up.
>
> It's good to know that even CSS precedence rules differ between
> browsers. :(
Really? That is very strange. Try the more specific one I mentioned
above - selecting both classes - I'd be interested to know why it was
been over-ruled... is there something like firebug for epiphany?
>
>>> +tfoot tr.overall-
>> Yikes - careful there. This actually reads currently as:
>>
>> "Apply the following styles to any td's inside a tr...etc., or *any* th."
>>
>> So, for example, you can see this is being applied to th's at:
>>
>> https:/
>
> Right, fixed.
Great.
>
>>> === modified file 'lib/lp/
> ...
>>>
>>> + @property
>>> + def page_title(self):
>>> + return self.context.title
>>> +
>> Just note that you will probably need to remove this soon - when barry's
>> branch lands that calculates the <title> automatically. It should only
>> be overridden here in special cases (yes, this changed... see the points
>> under "Here are the specific coding recommendations for your templates"
>> at: https:/
>
> At the moment, I either can't remove it from pagetitles.py or I have to
> define it like this. And yes, I am completely aware of the work Barry's
> doing, and I am completely aware that I'll have to go through all the
> translations pages to make sure that breadcrumbs, page titles, h2's and
> h1's make sense on them. And that's exactly what I was planning to do
> anyway.
Well *sorrrry* - I'd forgotten it was you helping barry with the rules -
in previous reviews people haven't been aware. Next time I'll just keep
my mouth shut ;)
>
>>> @@ -25...
Michael Nelson (michael.nelson) : | # |
Данило Шеган (danilo) wrote : | # |
У пет, 11. 09 2009. у 07:18 +0000, Michael Nelson пише:
> >> This CSS could possibly be much simpler if you put
> >> the 'translation-stats' class on the table element (instead of on the
> >> tbody). Then you could remove the overall-
> >
> > That's actually what I started with. However, fighting legacy CSS code
> > is hell. 'table.listing tbody td' takes precedence over
> > 'table.
> > class='listing' on these tables, though, simply because I am not trying
> > to solve all the problems with these pages. It's mostly mechanical
> > changes, and no real redesign.
>
> OK. It's up to you, but I'm guessing:
>
> table.listing.
> would take precedence (ie. selecting both classes - as it's more
> specific). I'm not fussed either way - what you've got works, and it's
> not a huge improvement to remove one class.
Actually, it seems the problem was the 'tr' I had in when I tried this.
It "suddenly" just works.
Btw, I wouldn't think of combining classes like this, so thanks for the
pointer: I am sure it'll be useful in the future, but the simpler stuff
works here :)
> >>> +tbody.
> >> table.translati
> >>
> >> (that way you don't need a separate rule for the tfoot below.)
> >
> > Actually, the 'cascading' of CSS seems to cause me problems in at least
> > Epiphany (xulrunner 1.9): if I set the rule up like that (that's what I
> > started with), it doesn't get picked up. I'll play a bit more with CSS
> > and will follow up.
> >
> > It's good to know that even CSS precedence rules differ between
> > browsers. :(
>
> Really? That is very strange. Try the more specific one I mentioned
> above - selecting both classes - I'd be interested to know why it was
> been over-ruled... is there something like firebug for epiphany?
Oh, it seems they don't differ: I was using a CSS rule with 'tr' in it
as well, and that probably caused problems. With that removed, it works
in Epiphany as well.
Also, I was under the impression that you tried this out in Firefox 3.5:
I did try this out in whatever-
is how I've seen that it doesn't really work properly). There is not
yet anything like firebug for epiphany, so in hard cases, I resort to
firefox :)
> Well *sorrrry* - I'd forgotten it was you helping barry with the rules -
> in previous reviews people haven't been aware. Next time I'll just keep
> my mouth shut ;)
Not at all! I think you should keep mentioning it: it's important that
everybody is aware of it.
> > Perhaps it'd make some sense for me to provide Navigation class for
> > ITranslationGro
> > arises in the future. Or perhaps just comment that this doesn't show up
> > in the request.
> > class.
> >
> > What do you think?
>
> I think a comment would be fine - it would have cleared up my confusion.
Done.
> No problem - I hope you didn't feel patronized by me pointing out things
> that were already obvious to you.
Don't worry at a...
1 | === modified file 'lib/canonical/launchpad/icing/style-3-0.css' | |||
2 | --- lib/canonical/launchpad/icing/style-3-0.css 2009-09-11 06:57:21 +0000 | |||
3 | +++ lib/canonical/launchpad/icing/style-3-0.css 2009-09-11 08:20:21 +0000 | |||
4 | @@ -685,6 +685,9 @@ table.listing thead { | |||
5 | 685 | table.listing th { | 685 | table.listing th { |
6 | 686 | font-weight: bold; | 686 | font-weight: bold; |
7 | 687 | } | 687 | } |
8 | 688 | table.narrow-listing { | ||
9 | 689 | width: 45em; | ||
10 | 690 | } | ||
11 | 688 | 691 | ||
12 | 689 | ul.language, li.language { | 692 | ul.language, li.language { |
13 | 690 | list-style-image: url(/@@/language); | 693 | list-style-image: url(/@@/language); |
14 | @@ -759,14 +762,14 @@ div.translations-legend { | |||
15 | 759 | padding-top: 2em; | 762 | padding-top: 2em; |
16 | 760 | padding-bottom: 1em; | 763 | padding-bottom: 1em; |
17 | 761 | } | 764 | } |
19 | 762 | tbody.translation-stats td { | 765 | table.translation-stats td { |
20 | 763 | text-align:center; | 766 | text-align:center; |
21 | 764 | } | 767 | } |
23 | 765 | tbody.translation-stats td.template-name { | 768 | table.translation-stats td.template-name { |
24 | 766 | text-align:left; | 769 | text-align:left; |
25 | 767 | } | 770 | } |
28 | 768 | tfoot tr.overall-translation-stats td, | 771 | table.translation-stats tfoot td, |
29 | 769 | tfoot tr.overall-translation-stats th { | 772 | table.translation-stats tfoot th { |
30 | 770 | background-color: #f7f7f7; | 773 | background-color: #f7f7f7; |
31 | 771 | border: 0px; | 774 | border: 0px; |
32 | 772 | border-top: 2px solid #d2d2d2; | 775 | border-top: 2px solid #d2d2d2; |
33 | @@ -775,12 +778,9 @@ tfoot tr.overall-translation-stats th { | |||
34 | 775 | padding-bottom: 5px; | 778 | padding-bottom: 5px; |
35 | 776 | font-weight: bold; | 779 | font-weight: bold; |
36 | 777 | } | 780 | } |
38 | 778 | tfoot tr.overall-translation-stats th { | 781 | table.translation-stats tfoot th { |
39 | 779 | text-align:left; | 782 | text-align:left; |
40 | 780 | } | 783 | } |
42 | 781 | tfoot tr.overall-translation-stats td { | 784 | table.translation-stats tfoot td { |
43 | 782 | text-align:center; | 785 | text-align:center; |
44 | 783 | } | 786 | } |
45 | 784 | table.narrow-listing { | ||
46 | 785 | width: 45em; | ||
47 | 786 | } | ||
48 | 787 | 787 | ||
49 | === modified file 'lib/lp/translations/browser/tests/test_breadcrumbs.py' | |||
50 | --- lib/lp/translations/browser/tests/test_breadcrumbs.py 2009-09-10 10:27:20 +0000 | |||
51 | +++ lib/lp/translations/browser/tests/test_breadcrumbs.py 2009-09-11 08:20:13 +0000 | |||
52 | @@ -104,6 +104,9 @@ class TestTranslationGroupsBreadcrumbs(B | |||
53 | 104 | group_set = getUtility(ITranslationGroupSet) | 104 | group_set = getUtility(ITranslationGroupSet) |
54 | 105 | url = canonical_url(group_set, rootsite='translations') | 105 | url = canonical_url(group_set, rootsite='translations') |
55 | 106 | # Translation group listing is top-level, so no breadcrumbs show up. | 106 | # Translation group listing is top-level, so no breadcrumbs show up. |
56 | 107 | # Note that the first parameter is an empty list because | ||
57 | 108 | # ITranslationGroupSet doesn't register Navigation class, and | ||
58 | 109 | # thus doesn't show up in request.traversed_objects. | ||
59 | 107 | self._testContextBreadcrumbs( | 110 | self._testContextBreadcrumbs( |
60 | 108 | [], [], [], | 111 | [], [], [], |
61 | 109 | url=url) | 112 | url=url) |
62 | 110 | 113 | ||
63 | === modified file 'lib/lp/translations/templates/serieslanguage-index.pt' | |||
64 | --- lib/lp/translations/templates/serieslanguage-index.pt 2009-09-09 18:52:48 +0000 | |||
65 | +++ lib/lp/translations/templates/serieslanguage-index.pt 2009-09-11 08:20:21 +0000 | |||
66 | @@ -51,7 +51,7 @@ | |||
67 | 51 | <div style="max-width:840px;"> | 51 | <div style="max-width:840px;"> |
68 | 52 | <tal:navigation replace="structure view/batchnav/@@+navigation-links-upper" /> | 52 | <tal:navigation replace="structure view/batchnav/@@+navigation-links-upper" /> |
69 | 53 | 53 | ||
71 | 54 | <table class="listing sortable" id="translationstatuses"> | 54 | <table class="listing sortable translation-stats"> |
72 | 55 | <thead> | 55 | <thead> |
73 | 56 | <tr> | 56 | <tr> |
74 | 57 | <th>Template Name</th> | 57 | <th>Template Name</th> |
75 | @@ -64,7 +64,7 @@ | |||
76 | 64 | <th>By</th> | 64 | <th>By</th> |
77 | 65 | </tr> | 65 | </tr> |
78 | 66 | </thead> | 66 | </thead> |
80 | 67 | <tbody class="translation-stats"> | 67 | <tbody> |
81 | 68 | <tr tal:repeat="entry view/pofiles" | 68 | <tr tal:repeat="entry view/pofiles" |
82 | 69 | tal:attributes="id string:${entry/potemplate/name}"> | 69 | tal:attributes="id string:${entry/potemplate/name}"> |
83 | 70 | <td class="template-name"> | 70 | <td class="template-name"> |
84 | @@ -159,7 +159,7 @@ | |||
85 | 159 | </td> | 159 | </td> |
86 | 160 | </tr> | 160 | </tr> |
87 | 161 | <tfoot> | 161 | <tfoot> |
89 | 162 | <tr class="overall-translation-stats"> | 162 | <tr> |
90 | 163 | <th>Overall statistics:</th> | 163 | <th>Overall statistics:</th> |
91 | 164 | <td><span tal:replace="context/messageCount">N</span></td> | 164 | <td><span tal:replace="context/messageCount">N</span></td> |
92 | 165 | <td> | 165 | <td> |
93 | 166 | 166 |
Preview Diff
1 | === modified file 'lib/canonical/launchpad/icing/style-3-0.css' | |||
2 | --- lib/canonical/launchpad/icing/style-3-0.css 2009-09-05 03:17:24 +0000 | |||
3 | +++ lib/canonical/launchpad/icing/style-3-0.css 2009-09-09 18:52:48 +0000 | |||
4 | @@ -748,6 +748,38 @@ | |||
5 | 748 | padding: 2px 1em 2px 2px; | 748 | padding: 2px 1em 2px 2px; |
6 | 749 | } | 749 | } |
7 | 750 | 750 | ||
8 | 751 | /* Translations statistics and legend. | ||
9 | 752 | * | ||
10 | 753 | * Examples: | ||
11 | 754 | * https://translations.launchpad.dev/ubuntu/hoary/+lang/es | ||
12 | 755 | * https://translations.launchpad.dev/evolution/trunk/+lang/es | ||
13 | 756 | */ | ||
14 | 757 | |||
15 | 758 | div.translations-legend { | ||
16 | 759 | padding-top: 2em; | ||
17 | 760 | padding-bottom: 1em; | ||
18 | 761 | } | ||
19 | 762 | tbody.translation-stats td { | ||
20 | 763 | text-align:center; | ||
21 | 764 | } | ||
22 | 765 | tbody.translation-stats td.template-name { | ||
23 | 766 | text-align:left; | ||
24 | 767 | } | ||
25 | 768 | tfoot tr.overall-translation-stats td, th { | ||
26 | 769 | background-color: #f7f7f7; | ||
27 | 770 | border: 0px; | ||
28 | 771 | border-top: 2px solid #d2d2d2; | ||
29 | 772 | border-bottom: 2px solid #d2d2d2; | ||
30 | 773 | padding-top: 5px; | ||
31 | 774 | padding-bottom: 5px; | ||
32 | 775 | font-weight: bold; | ||
33 | 776 | } | ||
34 | 777 | tfoot tr.overall-translation-stats th { | ||
35 | 778 | text-align:left; | ||
36 | 779 | } | ||
37 | 780 | tfoot tr.overall-translation-stats td { | ||
38 | 781 | text-align:center; | ||
39 | 782 | } | ||
40 | 751 | table.narrow-listing { | 783 | table.narrow-listing { |
41 | 752 | width: 45em; | 784 | width: 45em; |
42 | 753 | } | 785 | } |
43 | 754 | 786 | ||
44 | === modified file 'lib/canonical/launchpad/pagetitles.py' | |||
45 | --- lib/canonical/launchpad/pagetitles.py 2009-09-10 01:35:03 +0000 | |||
46 | +++ lib/canonical/launchpad/pagetitles.py 2009-09-10 10:27:20 +0000 | |||
47 | @@ -399,8 +399,6 @@ | |||
48 | 399 | 399 | ||
49 | 400 | distroseries_queue = ContextTitle('Queue for %s') | 400 | distroseries_queue = ContextTitle('Queue for %s') |
50 | 401 | 401 | ||
51 | 402 | distroserieslanguage_index = ContextTitle('%s') | ||
52 | 403 | |||
53 | 404 | distroseriessourcepackagerelease_index = ContextTitle('%s') | 402 | distroseriessourcepackagerelease_index = ContextTitle('%s') |
54 | 405 | 403 | ||
55 | 406 | errorservice_config = 'Configure error log' | 404 | errorservice_config = 'Configure error log' |
56 | 407 | 405 | ||
57 | === modified file 'lib/lp/translations/browser/configure.zcml' | |||
58 | --- lib/lp/translations/browser/configure.zcml 2009-09-01 11:09:53 +0000 | |||
59 | +++ lib/lp/translations/browser/configure.zcml 2009-09-10 10:27:20 +0000 | |||
60 | @@ -35,12 +35,9 @@ | |||
61 | 35 | <browser:page | 35 | <browser:page |
62 | 36 | name="+products-with-translations" | 36 | name="+products-with-translations" |
63 | 37 | template="../templates/rosetta-products.pt"/> | 37 | template="../templates/rosetta-products.pt"/> |
65 | 38 | 38 | ||
66 | 39 | <!-- portlets --> | 39 | <!-- portlets --> |
71 | 40 | 40 | ||
68 | 41 | <browser:page | ||
69 | 42 | name="+portlet-stats" | ||
70 | 43 | template="../templates/rosetta-portlet-stats.pt"/> | ||
72 | 44 | <browser:page | 41 | <browser:page |
73 | 45 | name="+portlet-groups" | 42 | name="+portlet-groups" |
74 | 46 | template="../templates/rosetta-portlet-groups.pt"/> | 43 | template="../templates/rosetta-portlet-groups.pt"/> |
75 | @@ -155,19 +152,22 @@ | |||
76 | 155 | <browser:url | 152 | <browser:url |
77 | 156 | for="lp.translations.interfaces.distroserieslanguage.IDistroSeriesLanguage" | 153 | for="lp.translations.interfaces.distroserieslanguage.IDistroSeriesLanguage" |
78 | 157 | path_expression="string:+lang/${language/code}" | 154 | path_expression="string:+lang/${language/code}" |
80 | 158 | attribute_to_parent="distroseries"/> | 155 | attribute_to_parent="distroseries" |
81 | 156 | rootsite="translations"/> | ||
82 | 157 | <browser:navigation | ||
83 | 158 | module="lp.translations.browser.distroserieslanguage" | ||
84 | 159 | classes=" | ||
85 | 160 | DistroSeriesLanguageNavigation"/> | ||
86 | 159 | <browser:defaultView | 161 | <browser:defaultView |
87 | 160 | for="lp.translations.interfaces.distroserieslanguage.IDistroSeriesLanguage" | 162 | for="lp.translations.interfaces.distroserieslanguage.IDistroSeriesLanguage" |
89 | 161 | name="+index"/> | 163 | name="+index" |
90 | 164 | layer="canonical.launchpad.layers.TranslationsLayer"/> | ||
91 | 162 | <browser:pages | 165 | <browser:pages |
92 | 163 | for="lp.translations.interfaces.distroserieslanguage.IDistroSeriesLanguage" | 166 | for="lp.translations.interfaces.distroserieslanguage.IDistroSeriesLanguage" |
93 | 164 | permission="zope.Public" | 167 | permission="zope.Public" |
94 | 165 | facet="translations" | 168 | facet="translations" |
95 | 166 | layer="canonical.launchpad.layers.TranslationsLayer"> | 169 | layer="canonical.launchpad.layers.TranslationsLayer"> |
96 | 167 | <browser:page | 170 | <browser:page |
97 | 168 | name="+portlet-stats" | ||
98 | 169 | template="../templates/distroserieslanguage-portlet-stats.pt"/> | ||
99 | 170 | <browser:page | ||
100 | 171 | name="+rosetta-status-legend" | 171 | name="+rosetta-status-legend" |
101 | 172 | template="../templates/rosetta-status-legend.pt"/> | 172 | template="../templates/rosetta-status-legend.pt"/> |
102 | 173 | </browser:pages> | 173 | </browser:pages> |
103 | @@ -175,7 +175,7 @@ | |||
104 | 175 | name="+index" | 175 | name="+index" |
105 | 176 | permission="zope.Public" | 176 | permission="zope.Public" |
106 | 177 | for="lp.translations.interfaces.distroserieslanguage.IDistroSeriesLanguage" | 177 | for="lp.translations.interfaces.distroserieslanguage.IDistroSeriesLanguage" |
108 | 178 | template="../templates/distroserieslanguage-index.pt" | 178 | template="../templates/serieslanguage-index.pt" |
109 | 179 | class="lp.translations.browser.distroserieslanguage.DistroSeriesLanguageView" | 179 | class="lp.translations.browser.distroserieslanguage.DistroSeriesLanguageView" |
110 | 180 | facet="translations" | 180 | facet="translations" |
111 | 181 | layer="canonical.launchpad.layers.TranslationsLayer"/> | 181 | layer="canonical.launchpad.layers.TranslationsLayer"/> |
112 | @@ -906,9 +906,6 @@ | |||
113 | 906 | <browser:page | 906 | <browser:page |
114 | 907 | name="+langchart" | 907 | name="+langchart" |
115 | 908 | template="../templates/distroseries-langchart.pt"/> | 908 | template="../templates/distroseries-langchart.pt"/> |
116 | 909 | <browser:page | ||
117 | 910 | name="+potlist" | ||
118 | 911 | template="../templates/object-pots.pt"/> | ||
119 | 912 | </browser:pages> | 909 | </browser:pages> |
120 | 913 | <browser:page | 910 | <browser:page |
121 | 914 | for="lp.registry.interfaces.distroseries.IDistroSeries" | 911 | for="lp.registry.interfaces.distroseries.IDistroSeries" |
122 | 915 | 912 | ||
123 | === modified file 'lib/lp/translations/browser/distroserieslanguage.py' | |||
124 | --- lib/lp/translations/browser/distroserieslanguage.py 2009-07-17 00:26:05 +0000 | |||
125 | +++ lib/lp/translations/browser/distroserieslanguage.py 2009-09-10 09:45:00 +0000 | |||
126 | @@ -5,17 +5,26 @@ | |||
127 | 5 | 5 | ||
128 | 6 | __metaclass__ = type | 6 | __metaclass__ = type |
129 | 7 | 7 | ||
131 | 8 | __all__ = ['DistroSeriesLanguageView'] | 8 | __all__ = [ |
132 | 9 | 'DistroSeriesLanguageNavigation', | ||
133 | 10 | 'DistroSeriesLanguageView', | ||
134 | 11 | ] | ||
135 | 9 | 12 | ||
136 | 10 | from canonical.launchpad.webapp import LaunchpadView | 13 | from canonical.launchpad.webapp import LaunchpadView |
137 | 11 | from canonical.launchpad.webapp.batching import BatchNavigator | 14 | from canonical.launchpad.webapp.batching import BatchNavigator |
139 | 12 | 15 | from canonical.launchpad.webapp.publisher import Navigation | |
140 | 16 | from lp.translations.interfaces.distroserieslanguage import ( | ||
141 | 17 | IDistroSeriesLanguage) | ||
142 | 13 | 18 | ||
143 | 14 | class DistroSeriesLanguageView(LaunchpadView): | 19 | class DistroSeriesLanguageView(LaunchpadView): |
144 | 15 | """View class to render translation status for an `IDistroSeries`.""" | 20 | """View class to render translation status for an `IDistroSeries`.""" |
145 | 16 | 21 | ||
146 | 17 | pofiles = None | 22 | pofiles = None |
147 | 18 | 23 | ||
148 | 24 | @property | ||
149 | 25 | def page_title(self): | ||
150 | 26 | return self.context.title | ||
151 | 27 | |||
152 | 19 | def initialize(self): | 28 | def initialize(self): |
153 | 20 | self.form = self.request.form | 29 | self.form = self.request.form |
154 | 21 | 30 | ||
155 | @@ -25,3 +34,23 @@ | |||
156 | 25 | 34 | ||
157 | 26 | self.pofiles = self.context.getPOFilesFor( | 35 | self.pofiles = self.context.getPOFilesFor( |
158 | 27 | self.batchnav.currentBatch()) | 36 | self.batchnav.currentBatch()) |
159 | 37 | self.parent = self.context.distroseries.distribution | ||
160 | 38 | |||
161 | 39 | @property | ||
162 | 40 | def translation_group(self): | ||
163 | 41 | return self.context.distroseries.distribution.translationgroup | ||
164 | 42 | |||
165 | 43 | @property | ||
166 | 44 | def translation_team(self): | ||
167 | 45 | """Is there a translation team for this translation.""" | ||
168 | 46 | if self.translation_group is not None: | ||
169 | 47 | team = self.translation_group.query_translator( | ||
170 | 48 | self.context.language) | ||
171 | 49 | else: | ||
172 | 50 | team = None | ||
173 | 51 | return team | ||
174 | 52 | |||
175 | 53 | |||
176 | 54 | class DistroSeriesLanguageNavigation(Navigation): | ||
177 | 55 | """Navigation for `IDistroSeriesLanguage`.""" | ||
178 | 56 | usedfor = IDistroSeriesLanguage | ||
179 | 28 | 57 | ||
180 | === modified file 'lib/lp/translations/browser/tests/test_breadcrumbs.py' | |||
181 | --- lib/lp/translations/browser/tests/test_breadcrumbs.py 2009-09-10 09:58:30 +0000 | |||
182 | +++ lib/lp/translations/browser/tests/test_breadcrumbs.py 2009-09-10 10:27:20 +0000 | |||
183 | @@ -98,6 +98,46 @@ | |||
184 | 98 | ["Crumb Tester", "Translations"]) | 98 | ["Crumb Tester", "Translations"]) |
185 | 99 | 99 | ||
186 | 100 | 100 | ||
187 | 101 | class TestTranslationGroupsBreadcrumbs(BaseTranslationsBreadcrumbTestCase): | ||
188 | 102 | |||
189 | 103 | def test_translationgroupset(self): | ||
190 | 104 | group_set = getUtility(ITranslationGroupSet) | ||
191 | 105 | url = canonical_url(group_set, rootsite='translations') | ||
192 | 106 | # Translation group listing is top-level, so no breadcrumbs show up. | ||
193 | 107 | self._testContextBreadcrumbs( | ||
194 | 108 | [], [], [], | ||
195 | 109 | url=url) | ||
196 | 110 | |||
197 | 111 | def test_translationgroup(self): | ||
198 | 112 | group_set = getUtility(ITranslationGroupSet) | ||
199 | 113 | group = self.factory.makeTranslationGroup( | ||
200 | 114 | name='test-translators', title='Test translators') | ||
201 | 115 | self._testContextBreadcrumbs( | ||
202 | 116 | [group_set, group], | ||
203 | 117 | ["http://translations.launchpad.dev/+groups", | ||
204 | 118 | "http://translations.launchpad.dev/+groups/test-translators"], | ||
205 | 119 | ["Translation groups", "Test translators"]) | ||
206 | 120 | |||
207 | 121 | |||
208 | 122 | class TestSeriesLanguageBreadcrumbs(BaseTranslationsBreadcrumbTestCase): | ||
209 | 123 | def setUp(self): | ||
210 | 124 | super(TestSeriesLanguageBreadcrumbs, self).setUp() | ||
211 | 125 | self.language = getUtility(ILanguageSet)['sr'] | ||
212 | 126 | |||
213 | 127 | def test_distroserieslanguage(self): | ||
214 | 128 | distribution = self.factory.makeDistribution( | ||
215 | 129 | name='crumb-tester', displayname="Crumb Tester") | ||
216 | 130 | series = self.factory.makeDistroRelease( | ||
217 | 131 | name="test", version="1.0", distribution=distribution) | ||
218 | 132 | serieslanguage = getUtility(IDistroSeriesLanguageSet).getDummy( | ||
219 | 133 | series, self.language) | ||
220 | 134 | self._testContextBreadcrumbs( | ||
221 | 135 | [distribution, series, serieslanguage], | ||
222 | 136 | ["http://launchpad.dev/crumb-tester", | ||
223 | 137 | "http://launchpad.dev/crumb-tester/test", | ||
224 | 138 | "http://translations.launchpad.dev/crumb-tester/test", | ||
225 | 139 | "http://translations.launchpad.dev/crumb-tester/test/+lang/sr"], | ||
226 | 140 | ["Crumb Tester", "1.0", "Translations", "Serbian (sr)"]) | ||
227 | 101 | 141 | ||
228 | 102 | 142 | ||
229 | 103 | def test_suite(): | 143 | def test_suite(): |
230 | 104 | 144 | ||
231 | === modified file 'lib/lp/translations/browser/translations.py' | |||
232 | --- lib/lp/translations/browser/translations.py 2009-09-10 09:58:30 +0000 | |||
233 | +++ lib/lp/translations/browser/translations.py 2009-09-10 10:27:20 +0000 | |||
234 | @@ -9,6 +9,7 @@ | |||
235 | 9 | 'RosettaStatsView', | 9 | 'RosettaStatsView', |
236 | 10 | 'RosettaApplicationNavigation', | 10 | 'RosettaApplicationNavigation', |
237 | 11 | 'TranslateRedirectView', | 11 | 'TranslateRedirectView', |
238 | 12 | 'TranslationsLanguageBreadcrumb', | ||
239 | 12 | 'TranslationsMixin', | 13 | 'TranslationsMixin', |
240 | 13 | 'TranslationsRedirectView', | 14 | 'TranslationsRedirectView', |
241 | 14 | 'TranslationsVHostBreadcrumb', | 15 | 'TranslationsVHostBreadcrumb', |
242 | @@ -192,3 +193,10 @@ | |||
243 | 192 | @property | 193 | @property |
244 | 193 | def text(self): | 194 | def text(self): |
245 | 194 | return 'Translations' | 195 | return 'Translations' |
246 | 196 | |||
247 | 197 | |||
248 | 198 | class TranslationsLanguageBreadcrumb(Breadcrumb): | ||
249 | 199 | """Breadcrumb for objects with language.""" | ||
250 | 200 | @property | ||
251 | 201 | def text(self): | ||
252 | 202 | return self.context.language.displayname | ||
253 | 195 | 203 | ||
254 | === modified file 'lib/lp/translations/configure.zcml' | |||
255 | --- lib/lp/translations/configure.zcml 2009-09-10 09:58:30 +0000 | |||
256 | +++ lib/lp/translations/configure.zcml 2009-09-10 10:27:20 +0000 | |||
257 | @@ -250,6 +250,12 @@ | |||
258 | 250 | 250 | ||
259 | 251 | <!-- DistroSeriesLanguage and Dummy --> | 251 | <!-- DistroSeriesLanguage and Dummy --> |
260 | 252 | 252 | ||
261 | 253 | <adapter | ||
262 | 254 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" | ||
263 | 255 | for="lp.translations.interfaces.distroserieslanguage.IDistroSeriesLanguage" | ||
264 | 256 | factory="lp.translations.browser.translations.TranslationsLanguageBreadcrumb" | ||
265 | 257 | permission="zope.Public"/> | ||
266 | 258 | |||
267 | 253 | <class | 259 | <class |
268 | 254 | class="lp.translations.model.distroserieslanguage.DistroSeriesLanguage"> | 260 | class="lp.translations.model.distroserieslanguage.DistroSeriesLanguage"> |
269 | 255 | <allow | 261 | <allow |
270 | 256 | 262 | ||
271 | === modified file 'lib/lp/translations/doc/canonical_url_examples.txt' | |||
272 | --- lib/lp/translations/doc/canonical_url_examples.txt 2009-09-10 09:58:30 +0000 | |||
273 | +++ lib/lp/translations/doc/canonical_url_examples.txt 2009-09-10 10:27:20 +0000 | |||
274 | @@ -151,7 +151,7 @@ | |||
275 | 151 | >>> boo_bah_serbian = getUtility(IDistroSeriesLanguageSet).getDummy( | 151 | >>> boo_bah_serbian = getUtility(IDistroSeriesLanguageSet).getDummy( |
276 | 152 | ... distroseries, serbian) | 152 | ... distroseries, serbian) |
277 | 153 | >>> canonical_url(boo_bah_serbian) | 153 | >>> canonical_url(boo_bah_serbian) |
279 | 154 | u'http://launchpad.dev/boo/bah/+lang/sr' | 154 | u'http://translations.launchpad.dev/boo/bah/+lang/sr' |
280 | 155 | 155 | ||
281 | 156 | Product, ProductSeries and ProductSeriesLanguage | 156 | Product, ProductSeries and ProductSeriesLanguage |
282 | 157 | --------------------------------------------------- | 157 | --------------------------------------------------- |
283 | 158 | 158 | ||
284 | === modified file 'lib/lp/translations/model/distroserieslanguage.py' | |||
285 | --- lib/lp/translations/model/distroserieslanguage.py 2009-07-17 00:26:05 +0000 | |||
286 | +++ lib/lp/translations/model/distroserieslanguage.py 2009-09-09 11:57:25 +0000 | |||
287 | @@ -52,10 +52,14 @@ | |||
288 | 52 | 52 | ||
289 | 53 | @property | 53 | @property |
290 | 54 | def title(self): | 54 | def title(self): |
292 | 55 | return '%s translations of applications in %s, %s' % ( | 55 | return '%s translations of %s %s' % ( |
293 | 56 | self.language.englishname, | 56 | self.language.englishname, |
294 | 57 | self.distroseries.distribution.displayname, | 57 | self.distroseries.distribution.displayname, |
296 | 58 | self.distroseries.title) | 58 | self.distroseries.displayname) |
297 | 59 | |||
298 | 60 | @property | ||
299 | 61 | def text(self): | ||
300 | 62 | return self.language.englishname | ||
301 | 59 | 63 | ||
302 | 60 | @property | 64 | @property |
303 | 61 | def pofiles(self): | 65 | def pofiles(self): |
304 | @@ -158,10 +162,10 @@ | |||
305 | 158 | self.dateupdated = datetime.now(tz=pytz.timezone('UTC')) | 162 | self.dateupdated = datetime.now(tz=pytz.timezone('UTC')) |
306 | 159 | self.translator_count = 0 | 163 | self.translator_count = 0 |
307 | 160 | self.contributor_count = 0 | 164 | self.contributor_count = 0 |
309 | 161 | self.title = '%s translations of applications in %s, %s' % ( | 165 | self.title = '%s translations of %s %s' % ( |
310 | 162 | self.language.englishname, | 166 | self.language.englishname, |
311 | 163 | self.distroseries.distribution.displayname, | 167 | self.distroseries.distribution.displayname, |
313 | 164 | self.distroseries.title) | 168 | self.distroseries.displayname) |
314 | 165 | 169 | ||
315 | 166 | @property | 170 | @property |
316 | 167 | def pofiles(self): | 171 | def pofiles(self): |
317 | 168 | 172 | ||
318 | === modified file 'lib/lp/translations/stories/standalone/xx-test-potlists.txt' | |||
319 | --- lib/lp/translations/stories/standalone/xx-test-potlists.txt 2009-07-01 20:45:39 +0000 | |||
320 | +++ lib/lp/translations/stories/standalone/xx-test-potlists.txt 2009-09-09 12:41:48 +0000 | |||
321 | @@ -11,17 +11,3 @@ | |||
322 | 11 | ... | 11 | ... |
323 | 12 | ...Listing of FEW templates... | 12 | ...Listing of FEW templates... |
324 | 13 | ... | 13 | ... |
325 | 14 | |||
326 | 15 | Check that we can get a potlist for a distroseries: | ||
327 | 16 | |||
328 | 17 | >>> print http(r""" | ||
329 | 18 | ... GET /ubuntu/hoary/+potlist HTTP/1.1 | ||
330 | 19 | ... Host: translations.launchpad.dev | ||
331 | 20 | ... """) | ||
332 | 21 | HTTP/1.1 200 Ok | ||
333 | 22 | Content-Length: ... | ||
334 | 23 | Content-Type: text/html;charset=utf-8 | ||
335 | 24 | <BLANKLINE> | ||
336 | 25 | ... | ||
337 | 26 | ...Listing of FEW templates... | ||
338 | 27 | ... | ||
339 | 28 | 14 | ||
340 | === modified file 'lib/lp/translations/stories/translations/43-distrorelease-translations.txt' | |||
341 | --- lib/lp/translations/stories/translations/43-distrorelease-translations.txt 2008-09-09 08:13:14 +0000 | |||
342 | +++ lib/lp/translations/stories/translations/43-distrorelease-translations.txt 2009-09-09 12:41:48 +0000 | |||
343 | @@ -43,7 +43,7 @@ | |||
344 | 43 | ... 'http://translations.launchpad.dev/ubuntu/hoary/+lang/hr?batch=2') | 43 | ... 'http://translations.launchpad.dev/ubuntu/hoary/+lang/hr?batch=2') |
345 | 44 | >>> 'Croatian' in browser.contents | 44 | >>> 'Croatian' in browser.contents |
346 | 45 | True | 45 | True |
348 | 46 | >>> 'Programs you can translate' in browser.contents | 46 | >>> 'Translatable templates' in browser.contents |
349 | 47 | True | 47 | True |
350 | 48 | >>> print browser.getLink('evolution-2.2').url | 48 | >>> print browser.getLink('evolution-2.2').url |
351 | 49 | http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/hr/+translate | 49 | http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/hr/+translate |
352 | 50 | 50 | ||
353 | === removed file 'lib/lp/translations/templates/distroserieslanguage-portlet-stats.pt' | |||
354 | --- lib/lp/translations/templates/distroserieslanguage-portlet-stats.pt 2009-07-17 17:59:07 +0000 | |||
355 | +++ lib/lp/translations/templates/distroserieslanguage-portlet-stats.pt 1970-01-01 00:00:00 +0000 | |||
356 | @@ -1,25 +0,0 @@ | |||
357 | 1 | <div | ||
358 | 2 | xmlns:tal="http://xml.zope.org/namespaces/tal" | ||
359 | 3 | xmlns:metal="http://xml.zope.org/namespaces/metal" | ||
360 | 4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" | ||
361 | 5 | class="portlet" id="portlet-stats"> | ||
362 | 6 | |||
363 | 7 | <h2><span tal:replace="context/language/englishname">French</span> | ||
364 | 8 | statistics in <span | ||
365 | 9 | tal:replace="context/distroseries/displayname">Hoary</span></h2> | ||
366 | 10 | |||
367 | 11 | <div class="portletBody portletContent"> | ||
368 | 12 | |||
369 | 13 | <b>Translatable items:</b> | ||
370 | 14 | <span tal:replace="context/messageCount">N</span> | ||
371 | 15 | <br/> | ||
372 | 16 | <b>Untranslated:</b> | ||
373 | 17 | <span tal:replace="context/untranslatedCount">N</span> | ||
374 | 18 | <br /> | ||
375 | 19 | <span style="white-space: nowrap" | ||
376 | 20 | tal:content="structure context/@@+barchart">--</span> | ||
377 | 21 | <br /> | ||
378 | 22 | |||
379 | 23 | </div> | ||
380 | 24 | |||
381 | 25 | </div> | ||
382 | 26 | 0 | ||
383 | === renamed file 'lib/lp/translations/templates/distroserieslanguage-index.pt' => 'lib/lp/translations/templates/serieslanguage-index.pt' | |||
384 | --- lib/lp/translations/templates/distroserieslanguage-index.pt 2009-07-17 17:59:07 +0000 | |||
385 | +++ lib/lp/translations/templates/serieslanguage-index.pt 2009-09-09 18:52:48 +0000 | |||
386 | @@ -2,27 +2,11 @@ | |||
387 | 2 | xmlns="http://www.w3.org/1999/xhtml" | 2 | xmlns="http://www.w3.org/1999/xhtml" |
388 | 3 | xmlns:tal="http://xml.zope.org/namespaces/tal" | 3 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
389 | 4 | xmlns:metal="http://xml.zope.org/namespaces/metal" | 4 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
396 | 5 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" | 5 | metal:use-macro="view/macro:page/main_only" |
391 | 6 | xml:lang="en" | ||
392 | 7 | lang="en" | ||
393 | 8 | dir="ltr" | ||
394 | 9 | metal:use-macro="context/@@main_template/master" | ||
395 | 10 | i18n:domain="rosetta" | ||
397 | 11 | > | 6 | > |
398 | 12 | 7 | ||
399 | 13 | <body> | 8 | <body> |
400 | 14 | 9 | ||
401 | 15 | <metal:rightportlets fill-slot="portlets_one"> | ||
402 | 16 | <div tal:replace="structure context/@@+portlet-stats" /> | ||
403 | 17 | </metal:rightportlets> | ||
404 | 18 | |||
405 | 19 | <metal:heading fill-slot="pageheading"> | ||
406 | 20 | <h1> | ||
407 | 21 | Programs you can translate into | ||
408 | 22 | <tal:language replace="context/language/englishname">Catalan</tal:language> | ||
409 | 23 | </h1> | ||
410 | 24 | </metal:heading> | ||
411 | 25 | |||
412 | 26 | <div metal:fill-slot="main"> | 10 | <div metal:fill-slot="main"> |
413 | 27 | <tal:block condition="not:view/pofiles"> | 11 | <tal:block condition="not:view/pofiles"> |
414 | 28 | <div class="documentDescription"> | 12 | <div class="documentDescription"> |
415 | @@ -31,15 +15,43 @@ | |||
416 | 31 | </tal:block> | 15 | </tal:block> |
417 | 32 | 16 | ||
418 | 33 | <tal:block condition="view/pofiles"> | 17 | <tal:block condition="view/pofiles"> |
425 | 34 | 18 | <h1>Translatable templates</h1> | |
426 | 35 | <p> | 19 | <div class="top-portlet"> |
427 | 36 | Choose a template name to begin translating. Templates that are | 20 | <tal:with_group condition="view/translation_group"> |
428 | 37 | considered more important for translation are listed first. | 21 | <p tal:condition="view/translation_team"> |
429 | 38 | </p> | 22 | <tal:product replace="structure |
430 | 39 | 23 | view/parent/fmt:link">Evolution</tal:product> | |
431 | 24 | is translated by | ||
432 | 25 | <tal:team replace="structure | ||
433 | 26 | view/translation_team/translator/fmt:link"> | ||
434 | 27 | Serbian translators</tal:team> — if you need help, or your | ||
435 | 28 | translations are not being reviewed, please get in touch with them. | ||
436 | 29 | </p> | ||
437 | 30 | |||
438 | 31 | <p tal:condition="not:view/translation_team"> | ||
439 | 32 | There is no team to translate | ||
440 | 33 | <tal:product replace="structure | ||
441 | 34 | view/parent/fmt:link">Evolution</tal:product> | ||
442 | 35 | to | ||
443 | 36 | <a tal:attributes="href context/language/fmt:url" | ||
444 | 37 | tal:content="context/language/englishname">Serbian</a>. | ||
445 | 38 | To set one up, please get in touch with | ||
446 | 39 | <a tal:replace="structure view/translation_group/fmt:link" | ||
447 | 40 | >Launchpad Translators</a> | ||
448 | 41 | coordinator. | ||
449 | 42 | </p> | ||
450 | 43 | </tal:with_group> | ||
451 | 44 | |||
452 | 45 | <p> | ||
453 | 46 | Choose a template name to begin translating. | ||
454 | 47 | Templates which are more important to translate are listed first. | ||
455 | 48 | </p> | ||
456 | 49 | </div> | ||
457 | 50 | |||
458 | 51 | <div style="max-width:840px;"> | ||
459 | 40 | <tal:navigation replace="structure view/batchnav/@@+navigation-links-upper" /> | 52 | <tal:navigation replace="structure view/batchnav/@@+navigation-links-upper" /> |
460 | 41 | 53 | ||
462 | 42 | <table class="listing sortable" width="100%" id="translationstatuses"> | 54 | <table class="listing sortable" id="translationstatuses"> |
463 | 43 | <thead> | 55 | <thead> |
464 | 44 | <tr> | 56 | <tr> |
465 | 45 | <th>Template Name</th> | 57 | <th>Template Name</th> |
466 | @@ -52,10 +64,10 @@ | |||
467 | 52 | <th>By</th> | 64 | <th>By</th> |
468 | 53 | </tr> | 65 | </tr> |
469 | 54 | </thead> | 66 | </thead> |
471 | 55 | <tbody> | 67 | <tbody class="translation-stats"> |
472 | 56 | <tr tal:repeat="entry view/pofiles" | 68 | <tr tal:repeat="entry view/pofiles" |
473 | 57 | tal:attributes="id string:${entry/potemplate/name}"> | 69 | tal:attributes="id string:${entry/potemplate/name}"> |
475 | 58 | <td> | 70 | <td class="template-name"> |
476 | 59 | <a tal:attributes="href string:${entry/fmt:url}/+translate" | 71 | <a tal:attributes="href string:${entry/fmt:url}/+translate" |
477 | 60 | tal:content="entry/potemplate/name"> | 72 | tal:content="entry/potemplate/name"> |
478 | 61 | apache2-dev | 73 | apache2-dev |
479 | @@ -146,34 +158,31 @@ | |||
480 | 146 | </tal:block> | 158 | </tal:block> |
481 | 147 | </td> | 159 | </td> |
482 | 148 | </tr> | 160 | </tr> |
483 | 161 | <tfoot> | ||
484 | 162 | <tr class="overall-translation-stats"> | ||
485 | 163 | <th>Overall statistics:</th> | ||
486 | 164 | <td><span tal:replace="context/messageCount">N</span></td> | ||
487 | 165 | <td> | ||
488 | 166 | <span style="white-space: nowrap" | ||
489 | 167 | tal:content="structure context/@@+barchart">--</span> | ||
490 | 168 | </td> | ||
491 | 169 | <td><span tal:replace="context/untranslatedCount">N</span></td> | ||
492 | 170 | <td><span tal:replace="context/unreviewedCount">N</span></td> | ||
493 | 171 | <td><span tal:replace="context/updatesCount">N</span></td> | ||
494 | 172 | <td colspan="2"></td> | ||
495 | 173 | </tr> | ||
496 | 174 | </tfoot> | ||
497 | 149 | </tbody> | 175 | </tbody> |
498 | 150 | </table> | 176 | </table> |
499 | 151 | |||
500 | 152 | <tal:navigation replace="structure view/batchnav/@@+navigation-links-lower" /> | 177 | <tal:navigation replace="structure view/batchnav/@@+navigation-links-lower" /> |
501 | 153 | 178 | ||
504 | 154 | <div tal:replace="structure context/@@+rosetta-status-legend" /> | 179 | <div class="translations-legend"> |
505 | 155 | 180 | <div tal:replace="structure context/@@+rosetta-status-legend" /> | |
506 | 181 | </div> | ||
507 | 182 | </div><!-- max-width --> | ||
508 | 156 | </tal:block> | 183 | </tal:block> |
509 | 157 | 184 | ||
510 | 158 | </div> | 185 | </div> |
511 | 159 | 186 | ||
512 | 160 | <div metal:fill-slot="help"> | ||
513 | 161 | <p> | ||
514 | 162 | This page shows each of the translation templates in each of the source | ||
515 | 163 | packages in the | ||
516 | 164 | <span tal:replace="context/distroseries/displayname">hoary</span> | ||
517 | 165 | series of | ||
518 | 166 | <span tal:replace="context/distroseries/distribution/displayname">Ubuntu | ||
519 | 167 | </span>. Select a template to start translating. | ||
520 | 168 | </p> | ||
521 | 169 | <ul class="info"> | ||
522 | 170 | <li> | ||
523 | 171 | <a href="https://help.launchpad.net/RosettaFAQ" | ||
524 | 172 | >Frequently asked questions</a> | ||
525 | 173 | </li> | ||
526 | 174 | </ul> | ||
527 | 175 | </div> | ||
528 | 176 | |||
529 | 177 | |||
530 | 178 | </body> | 187 | </body> |
531 | 179 | </html> | 188 | </html> |
532 | 180 | 189 |
= Bug 423836: distroserieslan guage page =
(WARNING: Look at the attached diff in MP, not the full diff)
This branch migrates distroserieslan guage page to 3.0 layout. It's nguage migration (which reuses the same
split up from productseriesla
template), so lint still has one error which will be fixed by a followup
branch.
It also introduces some global bits like a TranslationsLan guage
breadcrumb, which will be reused in the followup branch (i.e. it's
"global" instead of specific to DSL for a reason).
I also add missing tests for translation group breadcrumbs, which I
introduced earlier.
= Tests =
bin/test -vvt 'translations. *breadcrumbs' -t stories. translations
(stories/ translations/ 43-distroreleas e-translations is the relevant page
test)
= Demo & QA =
https:/ /translations. launchpad. dev/ubuntu/ hoary/+ lang/es
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files: /launchpad/ pagetitles. py /launchpad/ icing/style- 3-0.css translations/ configure. zcml translations/ browser/ configure. zcml translations/ browser/ distroserieslan guage.py translations/ browser/ translations. py translations/ browser/ tests/test_ breadcrumbs. py translations/ doc/canonical_ url_examples. txt translations/ model/distroser ieslanguage. py translations/ stories/ standalone/ xx-test- potlists. txt
lib/canonical
lib/canonical
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/ translations/ stories/ translations/ 43-distroreleas e-translations. txt translations/ templates/ serieslanguage- index.pt
lib/lp/
== Pyflakes notices ==
lib/lp/ translations/ browser/ tests/test_ breadcrumbs. py LanguageSet' imported but unused
16: 'IProductSeries
== Pylint notices ==
lib/lp/ translations/ browser/ tests/test_ breadcrumbs. py anguageSet
16: [W0611] Unused import IProductSeriesL