software ratings (stars) override package name in right to left encoding

Bug #733087 reported by דוביקס
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
software-center (Ubuntu)
Fix Released
High
Unassigned
Natty
Fix Released
High
Unassigned

Bug Description

Binary package hint: software-center

Please check the following screenshot (also provided as attachment):

http://img6.imagebanana.com/img/o9uafqsb/_010.png

As you can see, the application icon + application name + application description are correctly aligned to the right, as you would expect when a right-to-left locale is being used (in this case Hebrew). The entries for 'AptURL' and 'Character Map' are good example.

The problem is - when there are ratings (stars) for an application - they are also right aligned, thus overriding the application information. One possible solution is to left-align the star ratings, so the application information will still show correctly when stars are presented.

Ubuntu Natty (development branch) with Unity 2D
software-center: Installed: 3.1.23.1

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: software-center 3.1.23.1
ProcVersionSignature: Ubuntu 2.6.38-1.28-generic 2.6.38-rc2
Uname: Linux 2.6.38-1-generic i686
Architecture: i386
Date: Fri Mar 11 07:45:41 2011
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Alpha i386 (20110202)
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=he_IL:he:en_GB:en
 LANG=he_IL.UTF-8
 SHELL=/bin/bash
SourcePackage: software-center
UpgradeStatus: Upgraded to natty on 2011-03-03 (7 days ago)

Revision history for this message
דוביקס (dovix2003-gmail) wrote :
Shlomil (shlomister)
tags: added: rtl
Shlomil (shlomister)
tags: added: arabic hebrew i18n l10n persian
Revision history for this message
דוביקס (dovix2003-gmail) wrote :

A developer from the local linux community provided a patch to solve the issues. Below is his post in the local forum (http://whatsup.org.il/forum/56115) translated into English.

********************************************************

=== modified file 'softwarecenter/view/appview.py'

--- softwarecenter/view/appview.py 2011-02-24 10:07:19 +0000

+++ softwarecenter/view/appview.py 2011-03-12 16:29:50 +0000

@@ -399,16 +399,23 @@

         return

     def _render_rating(self, window, widget, state, cell_area, xpad, ypad, direction, spacing=3):

- # draw stars on the top right

+ # draw stars on the top right or left

         cr = window.cairo_create()

         # for the sake of aesthetics,

         # star width should be approx 1/5 the width of the action button

         sw = sh = self.get_button_by_name('action0').get_size()[0] / 5

+ rtl = (direction == gtk.TEXT_DIR_RTL)

         for i in range(0, self.MAX_STARS):

- x = cell_area.x + cell_area.width - xpad - (self.MAX_STARS-i)*sw

+ if rtl:

+ x_offset = xpad + i*sw

+ else: # TEXT_DIR_LTR or TEXT_DIR_NONE

+ x_offset = cell_area.width - xpad - (self.MAX_STARS-i)*sw

+

+ x = cell_area.x + x_offset

             y = cell_area.y + ypad

+

             if i < int(self.rating):

                 self._star_painter.set_fill(StarPainter.FILL_FULL)

             elif (i == int(self.rating) and

********************************************************

I left the order of stars as is, I just moved them to the opposite direction of the text.

Do 'bzr clone', then save the above lines in a file, then 'bzr patch'.

You may also try changing the line:

x_offset = xpad + i*sw

x_offset = xpad + (self.MAX_STARS-i)*sw

for a different look of the solution.

Changed in software-center (Ubuntu):
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Kiwinote (kiwinote) wrote :

Hi! Thanks for your bug report. The bug you describe has been fixed in the latest development version of software-center. Please continue to report any bugs you may find in software-center. Thanks again for your help!

software-center (3.1.24) natty; urgency=low
  ...
  [ Michael Vogt ]
  * merged lp:~mmcg069/software-center/rtl-work, many thanks
    to Matthew McGowan
  ...

Changed in software-center (Ubuntu Natty):
status: Confirmed → Fix Released
Revision history for this message
Shlomil (shlomister) wrote :

Bug still exists on Oneiric Beta 1, Software Center version 4.1.22 .
Regression?

Revision history for this message
דוביקס (dovix2003-gmail) wrote :

It does look like a variant of the original issue - I will open a new bug for 11.10.

http://www.imagebanana.com/view/p9e8ehcm/usc.png

Revision history for this message
דוביקס (dovix2003-gmail) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.