NVidia Driver names show untranslated, albeit they are translated
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
jockey (Ubuntu) |
Fix Released
|
Low
|
Martin Pitt | ||
Bug Description
Binary package hint: jockey-gtk
The driver names shows untranslated in my Spanish desktop. However, they're fully translated into Spanish in Launchpad templates, as you can see here:
https:/
For example, the "NVIDIA accelerated graphics driver" is translated since 2008-02-28:
https:/
and the translation is inside the jockey.mo file:
$ strings -eS /usr/share/
3D-accelerated proprietary graphics driver for NVIDIA cards.
NVIDIA accelerated graphics driver
This driver is required to fully utilise the 3D potential of NVIDIA graphics cards, as well as provide 2D acceleration of newer cards.
Controlador privativo de aceleración 3D para tarjetas gráficas NVIDIA.
Controlador para tarjetas gráficas NVIDIA
Este controlador es necesario para usar totalmente el potencial 3D de las tarjetas gráficas NVIDIA, así como para proporcionar aceleración 2D en tarjetas más nuevas.
but it shows untranslated.
The "(version %d)" string is showed untranslated, too, albeit its translated:
$ strings -eS /usr/share/
version %s
versión %s
I attach an screenshot to illustrate the problem.
Changed in jockey (Ubuntu): | |
assignee: | nobody → albertomilone |
importance: | Undecided → Low |
milestone: | none → ubuntu-9.04 |
status: | New → In Progress |
Changed in jockey (Ubuntu): | |
milestone: | ubuntu-9.04 → none |
WORKAROUND:
-----------
I can get the driver names translated into Spanish changing the Jockey source code.
In /usr/lib/ python2. 5/site- packages/ jockey/ ui.py file, change the get_ui_driver_name method from:
def get_ui_ driver_ name(self, handler_info):
'''Return handler name, as it should be presented in the UI.
This cares about translation, as well as tagging recommended drivers. info['name' ] info['recommend ed']): recommended
'''
result = handler_
result = self._(result)
if bool(handler_
result += ' [%s]' % self.string_
return result
to:
def get_ui_ driver_ name(self, handler_info):
'''Return handler name, as it should be presented in the UI.
This cares about translation, as well as tagging recommended drivers. info['name' ] info['recommend ed']): recommended
'''
result = handler_
ary = result.rsplit('(')
real_name = ary[0][:-1]
version = (ary[1].rsplit(' '))[1][:-1]
result = self._(real_name) + ' (' + self._('version %s') % version + ')'
if bool(handler_
result += ' [%s]' % self.string_
return result
My code is obviously very inelegant. The problem is that handler_ info['name' ] returns both the driver name and the version number concatenated together. For example:
handler_ info['name' ] = 'NVIDIA accelerated graphics driver (version 180)'
so I need to split it into two components: the real driver name and the version. The two components are then localizated apart with self._(real_name) + ' (' + self._('version %s') % version + ')'.
I attach an screenshot of the Jockey UI with the fix applied.