Does not work after locale change

Bug #311293 reported by Michael Kuhn
2
Affects Status Importance Assigned to Milestone
Decibel Audio Player
Fix Released
Low
Anonym25712

Bug Description

I just noticed that Decibel does not work after the locale is changed.
This is due to the fact that internally translated strings are used as dictionary keys in (at least) src/modules/Tracklist.py:

PREFS_DEFAULT_COLUMNS_VISIBILITY = {
            ...
            _('Title') : True,
            ...
        }

In German _('Title') == 'Titel', which gets saved as part of the 'columns-visibility' preference.
If I then change the locale to English (for example, by executing Decibel in my local Git repository with no generated .mo files), the following piece of code fails:

        visible = tools.prefs.get(__name__, 'columns-visibility', PREFS_DEFAULT_COLUMNS_VISIBILITY)

        columns = (('#', [(pixbufRdr, gtk.gdk.Pixbuf), (txtRRdr, TYPE_INT)], (ROW_NUM, ROW_TIT), False, visible['#']),
                   (_('Title'), [(txtLRdr, TYPE_STRING)], (ROW_TIT,), True, visible[_('Title')]),
        ...

visible[_('Title')_] then raises a KeyError, because visible['Titel'] is set, but visible['Title'] is not.
This leaves Decibel in a broken state.

Revision history for this message
Anonym25712 (anonym25712) wrote :

Fixed on trunk.

Changed in decibel-audio-player:
assignee: nobody → François Ingelrest (athropos)
importance: Undecided → Low
status: New → Fix Committed
Revision history for this message
Anonym25712 (anonym25712) wrote :

See v1.01

Changed in decibel-audio-player:
status: Fix Committed → Fix Released
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.