NVidia Driver names show untranslated, albeit they are translated

Bug #353081 reported by Ricardo Pérez López on 2009-04-01
2
Affects Status Importance Assigned to Milestone
jockey (Ubuntu)
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.

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
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.

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
Ricardo Pérez López (ricardo) wrote :

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

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) on 2009-04-06
Changed in jockey (Ubuntu):
milestone: ubuntu-9.04 → none
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
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
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.

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

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  Edit
Everyone can see this information.

Other bug subscribers