GNOME Bugzilla – Bug 571132
Add more opensubtitles languages
Last modified: 2009-02-11 16:13:01 UTC
Hi Please add Portuguese Language to the subtitles plugin.
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?
(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.
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)
Probably none :)
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.
*** Bug 571309 has been marked as a duplicate of this bug. ***
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)
Thanks guys!