Merge lp:~evfool/software-center/fix751068 into lp:software-center

Proposed by Robert Roth
Status: Merged
Merged at revision: 1680
Proposed branch: lp:~evfool/software-center/fix751068
Merge into: lp:software-center
Diff against target: 16 lines (+2/-2)
1 file modified
softwarecenter/view/appdetailsview_gtk.py (+2/-2)
To merge this branch: bzr merge lp:~evfool/software-center/fix751068
Reviewer Review Type Date Requested Status
Gary Lasker (community) Approve
Kiwinote Pending
Review via email: mp+56411@code.launchpad.net

This proposal supersedes a proposal from 2011-04-05.

Description of the change

Date format localized in the Installed on .... string (LP: #751068). Fixed some typos.

To post a comment you must log in.
Revision history for this message
Gary Lasker (gary-lasker) wrote : Posted in a previous version of this proposal

Looks great, thanks Robert!

review: Approve
Revision history for this message
Kiwinote (kiwinote) wrote : Posted in a previous version of this proposal

Hi Robert,
Just two quick points on this diff:
- I see both strftime_( and strftime( -this is inconsistent, so presumably one of them is wrong.
- It would seem that the string itself is no longer marked for translation.
It would be great if you could look into these!

review: Needs Fixing
Revision history for this message
Robert Roth (evfool) wrote : Posted in a previous version of this proposal

Fixed based on Kiwinote's suggestions, it indeed had some typos. Resubmitting.

Revision history for this message
Kiwinote (kiwinote) wrote :

That would seem to look better now. Thanks!

Revision history for this message
Gary Lasker (gary-lasker) wrote :

Hey again Robert, thanks for getting back so quickly with the fixup! (and thanks kiwinote for noticing the typo that eluded my eye) :)

Note I made a couple of additional tweaks before merging your latest branch rev. You can see what I did by looking at trunk, rev 1680. First, as it turns out the unit test test/test_appdetails_view.py was failing. It's actually a good practice to run the suite of unit tests when making changes to make sure they still pass (I should have done that before my initial merge, for instance, as that would have uncovered the typo right off...definitely my bad!). More on unit tests in Software Center in a minute.

A second tweak that was needed was that, as it turns out, the value of app_details.purchase_date is actually a string, so it needed conversion before formatting. And one final tweak was that there was an additional instance of the unlocalized 'Purchased on %s' string a little further down in appdetails_gtk.py (in the 'state == PKG_STATE_PURCHASED_BUT_REPO_MUST_BE_ENABLED' section), so I fixed that up to match the one above. I updated the unit tests to cover these cases.

If you get a chance, please take a look at these changes and ping me if there's anything I may have missed, etc.

Ok, back to unit tests. For reference for the future, to run the full set of unit tests you need just do the following (starting in the top branch directory):

  cd test
  make

To run an individual test, it's just:

  cd test
  PYTHONPATH=. python test_appdetails_view.py

And thank you again for your help! It's very much appreciated!

Cheers,
Gary

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/view/appdetailsview_gtk.py'
2--- softwarecenter/view/appdetailsview_gtk.py 2011-04-05 08:40:04 +0000
3+++ softwarecenter/view/appdetailsview_gtk.py 2011-04-05 17:14:27 +0000
4@@ -267,10 +267,10 @@
5 else:
6 if app_details.purchase_date:
7 # TRANSLATORS : %x is the locale-specific date representation, %Y-%m-%d formats the date like 2011-03-31
8- self.set_label(app_details.purchase_date.strftime_('Purchased on %Y-%m-%d') )
9+ self.set_label(app_details.purchase_date.strftime(_('Purchased on %Y-%m-%d')) )
10 elif app_details.installation_date:
11 # TRANSLATORS : %x is the locale-specific date representation, %Y-%m-%d formats the date like 2011-03-31
12- self.set_label(app_details.installation_date.strftime('Installed on %Y-%m-%d') )
13+ self.set_label(app_details.installation_date.strftime(_('Installed on %Y-%m-%d')) )
14 else:
15 self.set_label(_('Installed'))
16 if state == PKG_STATE_REINSTALLABLE: # only deb files atm