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 571132 - Add more opensubtitles languages
Add more opensubtitles languages
Status: RESOLVED FIXED
Product: totem
Classification: Core
Component: Plugins
unspecified
Other Linux
: Normal trivial
: ---
Assigned To: General Totem maintainer(s)
General Totem maintainer(s)
: 571309 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-02-10 05:47 UTC by Luis Medinas
Modified: 2009-02-11 16:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add Portuguese language to OpenSubtitles plugin (1009 bytes, patch)
2009-02-10 23:20 UTC, Philip Withnall
committed Details | Review

Description Luis Medinas 2009-02-10 05:47:39 UTC
Hi

Please add Portuguese Language to the subtitles plugin.
Comment 1 Philip Withnall 2009-02-10 23:20:21 UTC
Created attachment 128421 [details] [review]
Add Portuguese language to OpenSubtitles plugin

Untested patch to add Portuguese support. It also adds a couple of comments to improve the code clarity.

Looking at opensubtitles.org, we support only a small subset of the languages listed. Why's this?
Comment 2 Bastien Nocera 2009-02-10 23:55:41 UTC
(In reply to comment #1)
> Created an attachment (id=128421) [edit]
> Add Portuguese language to OpenSubtitles plugin
> 
> Untested patch to add Portuguese support. It also adds a couple of comments to
> improve the code clarity.

Looks good to commit.

> Looking at opensubtitles.org, we support only a small subset of the languages
> listed. Why's this?

Not sure. http://www.opensubtitles.org/en/statistics has a list of languages with the number of subtitles for each (look for "Subtitrari dupa limba").

Might be worth adding at least the top 10 ones.
Comment 3 Philip Withnall 2009-02-11 00:14:35 UTC
What harm would just adding the lot do?

2009-02-11  Philip Withnall  <philip@tecnocode.co.uk>

	* src/plugins/opensubtitles/opensubtitles.py: Added Portuguese to the
	list of queryable OpenSubtitles languages. (Helps: #571132)
Comment 4 Bastien Nocera 2009-02-11 00:21:20 UTC
Probably none :)
Comment 5 Bastien Nocera 2009-02-11 00:29:24 UTC
Oh, a quick note.

It would be better if you could either;
- Use the ISO-639-3 code from iso-codes (/usr/share/xml/iso-codes/iso_639_3.xml) to translate the languages names (dgettext ("iso_639_3", "French") instead of _("French"))
- Drop a mail to the i18n list, as we're breaking the string announcement period.

The former would be better, and opensubtitles seems to be using those codes to do the translation as well.
Comment 6 Bastien Nocera 2009-02-11 14:05:18 UTC
*** Bug 571309 has been marked as a duplicate of this bug. ***
Comment 7 Bastien Nocera 2009-02-11 16:09:40 UTC
Program to list all the opensubtitles supported languages:

--8<--
#!/usr/bin/python

import xmlrpclib
USER_AGENT = 'Totem'

server = xmlrpclib.Server('http://www.opensubtitles.org/xml-rpc')
server.LogIn('', '', 'eng', USER_AGENT)
result = server.GetSubLanguages()
langs = result.get('data')
for lang in langs:
	# (D_('iso_639_3', 'Catalan'), 'cat'),
	print("(D_('iso_639_3', '%s'), '%s'),") % (lang['LanguageName'], lang['ISO639'])
for lang in langs:
	# 'ca':'cat',
	print ("'%s':'%s',") % (lang['ISO639'], lang['SubLanguageID'])
--8<--

A number of them have wrong language names:
Neo-Aramaic, Assyrian
Portuguese-BR (not in iso-codes)
Greek, Modern (1453-)
Malay (macrolanguage)
Occitan (post 1500)

And a bunch of others.

Added the 50-odd supported languages:
2009-02-11  Bastien Nocera  <hadess@hadess.net>

        * src/plugins/opensubtitles/opensubtitles.py: Add 50-odd
        languages supported by Opensubtitles (Closes: #571132)
Comment 8 Luis Medinas 2009-02-11 16:13:01 UTC
Thanks guys!