NVidia Driver names show untranslated, albeit they are translated

Bug #353081 reported by Ricardo Pérez López
2
Affects Status Importance Assigned to Milestone
jockey (Ubuntu)
Fix Released
Low
Martin Pitt
Declined for Jaunty by 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://translations.launchpad.net/ubuntu/jaunty/+source/jockey/+pots/jockey/es/+translate

For example, the "NVIDIA accelerated graphics driver" is translated since 2008-02-28:

  https://translations.launchpad.net/ubuntu/jaunty/+source/jockey/+pots/jockey/es/82/+translate

and the translation is inside the jockey.mo file:

  $ strings -eS /usr/share/locale-langpack/es/LC_MESSAGES/jockey.mo | grep NVIDIA
  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/locale-langpack/es/LC_MESSAGES/jockey.mo | grep "^versi"
  version %s
  versión %s

I attach an screenshot to illustrate the problem.

Revision history for this message
Ricardo Pérez López (ricardo) wrote :
Revision history for this message
Ricardo Pérez López (ricardo) wrote :

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.
        '''
        result = handler_info['name']
        result = self._(result)
        if bool(handler_info['recommended']):
            result += ' [%s]' % self.string_recommended
        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.
        '''
        result = handler_info['name']
        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_info['recommended']):
            result += ' [%s]' % self.string_recommended
        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.

Changed in jockey (Ubuntu):
assignee: nobody → albertomilone
importance: Undecided → Low
milestone: none → ubuntu-9.04
status: New → In Progress
Revision history for this message
Alberto Milone (albertomilone) wrote :

Ricardo: first of all, thanks for reporting the problem and for suggesting a workaround. I have worked on a solution which will not break the drivers whose handlers do not report the version in the name of the driver (i.e. any other handler but the nvidia one).

Martin: can you have a look at my solution and, if you find it acceptable, merge it with lp:jockey , please?
here's my branch:
https://code.launchpad.net/~albertomilone/jockey/tseliot-fixes

here's the diff:
http://bazaar.launchpad.net/~albertomilone/jockey/tseliot-fixes/revision/536

The attached screenshot proves that my solution works.

Revision history for this message
Martin Pitt (pitti) wrote :

Hm, that is a hackish workaround. I'll ponder this problem a bit, and if I don't find a better solution, I'll apply this as a bandaid patch.

summary: - Driver names shows untranslated, albeit they're translated
+ NVidia Driver names show untranslated, albeit they are translated
Revision history for this message
Ricardo Pérez López (ricardo) wrote :

Thank you Alberto and Martin for taking care of this bug!

Revision history for this message
Martin Pitt (pitti) wrote :

I'm going to use Handler.version, which is the proper attribute to use, and stop mangling nvidia's name().

Changed in jockey (Ubuntu):
assignee: albertomilone → pitti
Martin Pitt (pitti)
Changed in jockey (Ubuntu):
milestone: ubuntu-9.04 → none
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package jockey - 0.5-0ubuntu8

---------------
jockey (0.5-0ubuntu8) jaunty; urgency=low

  * Merge fixes from trunk:
    - ui.py, get_ui_driver_name(): If driver has a version, show it.
    - nvidia.py: Set self.version instead of mangling name(), to avoid
      breaking translations. (LP: #353081)
    - Update German translations.

 -- Martin Pitt <email address hidden> Mon, 06 Apr 2009 10:55:13 -0700

Changed in jockey (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Ricardo Pérez López (ricardo) wrote :

Martin, your fix does not translate the "(version %d)" part. I've fixed that replacing this line:

  result += ' (%s %s)' % (self._('version'), handler_info['version'])

with this one:

  result += ' (' + self._('version %s') % handler_info['version'] + ')'

The problem is that the right string is 'version %s', not 'version'.

Please, include this fix to solve the problem completely.

Changed in jockey (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Martin Pitt (pitti) wrote :

My fix does translate it, it just avoids translating the %s. However, *shrug*, I don't care much either way. I guess with translating "version %s" it breaks fewer translations.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package jockey - 0.5-0ubuntu9

---------------
jockey (0.5-0ubuntu9) jaunty; urgency=low

  * jockey/ui.py: Fix previous change to not break existing translations.
    (LP: #353081)

 -- Martin Pitt <email address hidden> Mon, 06 Apr 2009 14:47:05 -0700

Changed in jockey (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Ricardo Pérez López (ricardo) wrote :

Thank you very much, Martin. You are right: your fix works fine, although we (the translators) thank you for not having to re-translate the string.

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.