After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 729974 - opensutitles: Does not work if user interface in Basque language
opensutitles: Does not work if user interface in Basque language
Status: RESOLVED FIXED
Product: totem
Classification: Core
Component: Subtitle Downloader plugin
3.10.x
Other Linux
: Normal normal
: ---
Assigned To: General Totem maintainer(s)
General Totem maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-05-11 21:08 UTC by Aitzol
Modified: 2014-05-12 12:54 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Aitzol 2014-05-11 21:08:01 UTC
Totem subtitle downloader does not work if user's interface is in basque language. This is the error message returned by totem --debug:

Traceback (most recent call last):
  • File "/usr/lib/totem/plugins/opensubtitles/opensubtitles.py", line 426 in do_activate
    self._model = OpenSubtitlesModel (server)
  • File "/usr/lib/totem/plugins/opensubtitles/opensubtitles.py", line 255 in __init__
    self.lang = LANGUAGES[language_code.split ('_')[0]]
KeyError: 'eu'
Stream with high frequencies VQ coding

I have been able to solve the issue by modifying /usr/lib/totem/plugins/opensubtitles/opensubtitles.py, adding basque to the languages list:

aitzol@egia01:/tmp$ diff /usr/lib/totem/plugins/opensubtitles/opensubtitles.py /home/aitzol/Mahaigaina/totem-V_3_10_1/src/plugins/opensubtitles/opensubtitles.py
4c4
< from gi.repository import GLib, Gio, Pango, Totem # pylint: disable-msg=E0611
---
> from gi.repository import Gio, Pango, Totem # pylint: disable-msg=E0611
41d40
< 	 (D_('iso_639_3', 'Basque'), 'eu'),
108d106
< 	 'eu':'eus',
443c441
<                                                None)
---
>                                                self)
aitzol@egia01:/tmp$
Comment 1 Aitzol 2014-05-11 21:12:14 UTC
Steps to reproduce:

1) Open totem subtitle downloader
2) Click search.

Expected results

A list of available subtitles for the video is shown

Actual results

The subtitle downloader returns no errors. There field for selecting another language for subtitle download is disabled.
Comment 2 Bastien Nocera 2014-05-11 21:22:46 UTC
Your diff is useless, you need to run it in unified mode:
"diff -up ..."

Also, what's the output of locale?
Comment 3 Aitzol 2014-05-12 12:30:26 UTC
diff -up output
--- /usr/lib/totem/plugins/opensubtitles/opensubtitles.py	2014-05-11 23:00:43.864856255 +0200
+++ /home/aitzol/Mahaigaina/totem-V_3_10_1/src/plugins/opensubtitles/opensubtitles.py	2013-09-30 09:55:25.000000000 +0200
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 
 from gi.repository import GObject, Peas, Gtk, Gdk # pylint: disable-msg=E0611
-from gi.repository import GLib, Gio, Pango, Totem # pylint: disable-msg=E0611
+from gi.repository import Gio, Pango, Totem # pylint: disable-msg=E0611
 
 import xmlrpclib
 import threading
@@ -38,7 +38,6 @@ LANGUAGES_STR = [ (D_('iso_639_3', 'Alba
          (D_('iso_639_3', 'Arabic'), 'ar'),
          (D_('iso_639_3', 'Armenian'), 'hy'),
          (D_('iso_639_3', 'Neo-Aramaic, Assyrian'), 'ay'),
-	 (D_('iso_639_3', 'Basque'), 'eu'),
          (D_('iso_639_3', 'Bosnian'), 'bs'),
          (_('Brazilian Portuguese'), 'pb'),
          (D_('iso_639_3', 'Bulgarian'), 'bg'),
@@ -105,7 +104,6 @@ LANGUAGES = {'sq':'alb',
          'en':'eng',
          'eo':'epo',
          'et':'est',
-	 'eu':'eus',
          'fi':'fin',
          'fr':'fre',
          'gl':'glg',
@@ -440,7 +438,7 @@ class OpenSubtitles (GObject.Object, # p
         builder = Totem.plugin_load_interface ("opensubtitles",
                                                "opensubtitles.ui", True,
                                                self._totem.get_main_window (),
-                                               None)
+                                               self)
 
         # Obtain all the widgets we need to initialize
         combobox = builder.get_object ('language_combobox')

locale output:
LANG=eu_ES.UTF-8
LANGUAGE=eu_ES:en_GB:en
LC_CTYPE="eu_ES.UTF-8"
LC_NUMERIC=eu_ES.UTF-8
LC_TIME=eu_ES.UTF-8
LC_COLLATE="eu_ES.UTF-8"
LC_MONETARY=eu_ES.UTF-8
LC_MESSAGES="eu_ES.UTF-8"
LC_PAPER=eu_ES.UTF-8
LC_NAME=eu_ES.UTF-8
LC_ADDRESS=eu_ES.UTF-8
LC_TELEPHONE=eu_ES.UTF-8
LC_MEASUREMENT=eu_ES.UTF-8
LC_IDENTIFICATION=eu_ES.UTF-8
LC_ALL=
Comment 4 Bastien Nocera 2014-05-12 12:54:09 UTC
(In reply to comment #3)
> diff -up output
> --- /usr/lib/totem/plugins/opensubtitles/opensubtitles.py    2014-05-11
> 23:00:43.864856255 +0200
> +++
> /home/aitzol/Mahaigaina/totem-V_3_10_1/src/plugins/opensubtitles/opensubtitles.py
>    2013-09-30 09:55:25.000000000 +0200
> @@ -1,7 +1,7 @@
>  # -*- coding: utf-8 -*-
> 
>  from gi.repository import GObject, Peas, Gtk, Gdk # pylint: disable-msg=E0611
> -from gi.repository import GLib, Gio, Pango, Totem # pylint: disable-msg=E0611
> +from gi.repository import Gio, Pango, Totem # pylint: disable-msg=E0611

Unrelated.

>  import xmlrpclib
>  import threading
> @@ -38,7 +38,6 @@ LANGUAGES_STR = [ (D_('iso_639_3', 'Alba
>           (D_('iso_639_3', 'Arabic'), 'ar'),
>           (D_('iso_639_3', 'Armenian'), 'hy'),
>           (D_('iso_639_3', 'Neo-Aramaic, Assyrian'), 'ay'),
> -     (D_('iso_639_3', 'Basque'), 'eu'),
>           (D_('iso_639_3', 'Bosnian'), 'bs'),
>           (_('Brazilian Portuguese'), 'pb'),
>           (D_('iso_639_3', 'Bulgarian'), 'bg'),
> @@ -105,7 +104,6 @@ LANGUAGES = {'sq':'alb',
>           'en':'eng',
>           'eo':'epo',
>           'et':'est',
> -     'eu':'eus',
>           'fi':'fin',
>           'fr':'fre',
>           'gl':'glg',

Your patch is reversed, compared to what I should apply to the totem code.

> @@ -440,7 +438,7 @@ class OpenSubtitles (GObject.Object, # p
>          builder = Totem.plugin_load_interface ("opensubtitles",
>                                                 "opensubtitles.ui", True,
>                                                 self._totem.get_main_window (),
> -                                               None)
> +                                               self)

Also unrelated.

>          # Obtain all the widgets we need to initialize
>          combobox = builder.get_object ('language_combobox')
> 
> locale output:
> LANG=eu_ES.UTF-8
> LANGUAGE=eu_ES:en_GB:en
> LC_CTYPE="eu_ES.UTF-8"
> LC_NUMERIC=eu_ES.UTF-8
> LC_TIME=eu_ES.UTF-8
> LC_COLLATE="eu_ES.UTF-8"
> LC_MONETARY=eu_ES.UTF-8
> LC_MESSAGES="eu_ES.UTF-8"
> LC_PAPER=eu_ES.UTF-8
> LC_NAME=eu_ES.UTF-8
> LC_ADDRESS=eu_ES.UTF-8
> LC_TELEPHONE=eu_ES.UTF-8
> LC_MEASUREMENT=eu_ES.UTF-8
> LC_IDENTIFICATION=eu_ES.UTF-8
> LC_ALL=

commit 7afcf1e8d876cb15f2ef87c786e47313a0c696f3
Author: Aitzol <aitzolkilla@gmail.com>
Date:   Mon May 12 14:42:18 2014 +0200

    opensubtitles: Add support for Basque
    
    https://bugzilla.gnome.org/show_bug.cgi?id=729974

This will be fixed in Totem 3.14 and in the next version of Totem for the 3.12 stable releases.

commit bbffc6f4679b1121240bead764d8a15bc3816140
Author: Bastien Nocera <hadess@hadess.net>
Date:   Mon May 12 14:39:50 2014 +0200

    opensubtitles: Don't error if the language is unknown
    
    If the current locale is not listed in our list of
    OpenSubtitles-supported languages, don't throw an error, but fallback to
    selecting English as the language.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=729974