Comment 0 for bug 581207

Revision history for this message
M. Vefa Bicakci (mvb) wrote :

Binary package hint: software-center

Hello,

After trying out Ubuntu 10.04 with a Turkish locale (tr_TR.UTF-8), I was
sad to notice that when update-software-center is run by a dpkg trigger or
a manual command line interaction, it produces errors similar to the following:
(I was able to reproduce this with software-center 2.0.3.)

=== 8< ===
WARNING:root:error processing: /usr/share/app-install/desktop/cecilia.desktop 'WEIGHT_DESKTOP_GENERiCNAME'
WARNING:root:error processing: /usr/share/app-install/desktop/anjal.desktop 'WEIGHT_DESKTOP_GENERiCNAME'
WARNING:root:error processing: /usr/share/app-install/desktop/projectl.desktop 'WEIGHT_DESKTOP_GENERiCNAME'
WARNING:root:error processing: /usr/share/app-install/desktop/kde4_kate.desktop 'WEIGHT_DESKTOP_GENERiCNAME'
WARNING:root:error processing: /usr/share/app-install/desktop/kde4_kteatime.desktop 'WEIGHT_DESKTOP_GENERiCNAME'
WARNING:root:error processing: /usr/share/app-install/desktop/kadu.desktop 'WEIGHT_DESKTOP_GENERiCNAME'
WARNING:root:error processing: /usr/share/app-install/desktop/avidemux-qt.desktop 'WEIGHT_DESKTOP_GENERiCNAME'
WARNING:root:error processing: /usr/share/app-install/desktop/pydance.desktop 'WEIGHT_DESKTOP_GENERiCNAME'
WARNING:root:error processing: /usr/share/app-install/desktop/etw.desktop 'WEIGHT_DESKTOP_GENERiCNAME'
WARNING:root:error processing: /usr/share/app-install/desktop/qtpfsgui.desktop 'WEIGHT_DESKTOP_GENERiCNAME'
WARNING:root:error processing: /usr/share/app-install/desktop/kde_kalcul.desktop 'WEIGHT_DESKTOP_GENERiCNAME'
=== >8 ===

The end result of this is that a lot of the installed software cannot be
seen in the Ubuntu Software Center, which is a very big usability problem
for people using a Turkish locale. (After running update-software-center
in the English locale [en_US.UTF-8], one can see 67 programs in the
"Installed Software" menu. With the Turkish locale [tr_TR.UTF-8], this
number drops to 40.)

Notice in the output above that the "i" is not capitalized in the keyword
"WEIGHT_DESKTOP_GENERiCNAME". This is a very common problem
with programs which run in the Turkish locale, but that expect the
capitalization of "i" to work as in the English alphabet (i.e. in ASCII).
Unfortunately, in the Turkish alphabet the capitalization rules of the "i"s
are different:

=== 8< ===
English:
 lowercase: i
 uppercase: I

Turkish:
 Dotless "i":
  lowercase: ı (idotless)
  uppercase: I

 "i" with dot:
  lowercase: i
  uppercase: İ (Idotabove)
=== >8 ===

The source of this problem can be seen in the following file:

=== /usr/share/software-center/softwarecenter/db/update.py ===
191 # now add search data from the desktop file
192 for key in ["GenericName","Comment"]:
193 if not parser.has_option_desktop(key):
194 continue
195 s = parser.get_desktop(key)
196 w = globals()["WEIGHT_DESKTOP_"+key.replace(" ","").upper()]
197 term_generator.index_text_without_positions(s, w)
=== /usr/share/software-center/softwarecenter/db/update.py ===

As you can see, on line 196, the string "key", which contains ASCII data such
as "GenericName", is capitalized using the "upper" function.

Because the data to be operated on is ASCII, but the locale is a Turkish locale,
this causes problems when one tries to capitalize an "i".

The attached patch fixes this issue by creating a function called ascii_upper
which uses the the "string.maketrans" and "string.translate" functions and the
"string.ascii_lowercase" and "string.ascii_uppercase" constants to convert mixed
case ASCII strings to uppercase ASCII strings using English capitalization rules.

Dear Ubuntu Software Center maintainer: Because this is a high profile bug that
affects everyone running in a Turkish locale, and because its fix is relatively
simple, is there any way we can get this bug fixed in Ubuntu 10.04 LTS ? Because
this is a LTS release, I really don't want Turkish users to have a suboptimal
experience during the 3 years this release is supported.

I realize that I should have tested an alpha or beta version of Ubuntu 10.04 LTS
and reported this bug earlier. I apologize for not doing this.

Regards,

M. Vefa Bicakci