software ratings (stars) override package name in right to left encoding
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://
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
ProcVersionSign
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)
PackageArchitec
ProcEnviron:
LANGUAGE=
LANG=he_IL.UTF-8
SHELL=/bin/bash
SourcePackage: software-center
UpgradeStatus: Upgraded to natty on 2011-03-03 (7 days ago)
tags: | added: rtl |
tags: | added: arabic hebrew i18n l10n persian |
Changed in software-center (Ubuntu): | |
status: | New → Confirmed |
importance: | Undecided → High |
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):
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.