Page 1 of 1

New programs using OS: how to get translations?

Posted: Thu Jan 10, 2008 2:51 pm
by dbaalborg
Hi,

I am currently preparing osTools for translation using gettext. As I have understood that SubDownloader's translations come directly from OpenSubtitles's translations (I am currently one of the French translators), I would like to know if it would be possible to add my strings to OS's general translation database?

If so, could you please explain how to add the strings (which format, manual insertion or po files?), and then in which format can the translations be retrieved?

Thanks!
dbaalborg

Posted: Thu Jan 10, 2008 4:13 pm
by oss
hello,

you can contact me via mail, we can change ICQ or something, no problem. I suggest you look at XMLRPC methods like:
http://trac.opensubtitles.org/projects/ ... anslations

I will register your program, and you will get right infos. You can try those methods with 'subdownloader' as program and you will get idea. For your program we can register 'ostools' and thats it.

For translations - you will just send me all english strings, and I will import that to database, so it will be available via translation interface on website - so translators can translate that.

For retrieve of strings look at:
http://trac.opensubtitles.org/projects/ ... ranslation
try that with subdownloader for example, you can get it in many formats, so...

Posted: Thu Jan 10, 2008 4:58 pm
by dbaalborg
Thanks for your fast reply, I will give it a look very soon... Registering ostools is OK for me :)

++
dbaalborg

Posted: Sat Jan 12, 2008 3:59 pm
by dbaalborg
OK, so I'm trying the XML-RPC out, it works fine concerning the GetAvailableTranslations function, but I just can't get the GetTranslation function to work, it just keeps on telling me

Code: Select all

{'status': '410 Other or unknown error', 'seconds': 0.34000000000000002}
So I tryed changing some parameters, but I can't get it to work... Is there any current problem with the website, or am I doing something wrong?

This is a piece of my python code, in case you can spot an error from my part:

Code: Select all

class gettranslations(): "Class that retrieves the translations fro the OpenSubtiltes.org website using XML-RPC" def __init__(self): print "Retrieving " + app_globals.app_name + "'s up to date translations..." self.__xmlrpcurl = "http://dev.opensubtitles.org/xml-rpc" #self.__xmlrpcurl = "http://www.opensubtitles.org/xml-rpc" print "Connecting to " + self.__xmlrpcurl + "..." self.server = xmlrpclib.Server(self.__xmlrpcurl); temp = self.server.GetAvailableTranslations("", "subdownloader") print temp for tt in temp["data"]: print tt + " " + temp["data"][tt]["StringsNo"] temp = self.server.GetTranslation("", "en", "po", "subdownloader") print temp
And this is what I get back from my little test program:

Code: Select all

Retrieving osTools's up to date translations... Connecting to http://dev.opensubtitles.org/xml-rpc... {'status': '200 OK', 'seconds': 0.0060000000000000001, 'data': {'en': {'LastCreated': '2007-03-13 12:22:14', 'StringsNo': '218'}, 'zh': {'LastCreated': '2007-09-15 08:58:20', 'StringsNo': '218'}, 'gr': {'LastCreated': '2007-09-23 14:01:11', 'StringsNo': '186'}, 'vi': {'LastCreated': '2007-09-26 10:35:58', 'StringsNo': '218'}, 'it': {'LastCreated': '2007-07-06 11:48:21', 'StringsNo': '216'}, 'ar': {'LastCreated': '2007-08-31 23:58:22', 'StringsNo': '218'}, 'cs': {'LastCreated': '2007-03-20 10:19:17', 'StringsNo': '218'}, 'et': {'LastCreated': '2007-05-07 20:43:40', 'StringsNo': '218'}, 'gl': {'LastCreated': '2007-10-11 16:23:40', 'StringsNo': '218'}, 'id': {'LastCreated': '2007-08-29 04:15:09', 'StringsNo': '217'}, 'es': {'LastCreated': '2007-03-16 11:20:36', 'StringsNo': '218'}, 'ru': {'LastCreated': '2007-08-29 04:51:19', 'StringsNo': '81'}, 'nl': {'LastCreated': '2007-03-16 17:45:27', 'StringsNo': '218'}, 'pt': {'LastCreated': '2007-03-24 09:27:41', 'StringsNo': '218'}, 'pb': {'LastCreated': '2007-03-26 14:52:17', 'StringsNo': '218'}, 'ro': {'LastCreated': '2007-07-26 17:54:42', 'StringsNo': '200'}, 'pl': {'LastCreated': '2007-04-18 12:37:40', 'StringsNo': '218'}, 'fr': {'LastCreated': '2007-03-17 08:47:02', 'StringsNo': '218'}, 'bg': {'LastCreated': '2007-09-14 17:50:41', 'StringsNo': '96'}, 'de': {'LastCreated': '2007-05-14 14:14:11', 'StringsNo': '216'}, 'da': {'LastCreated': '2007-03-17 11:46:58', 'StringsNo': '218'}, 'fi': {'LastCreated': '2007-03-13 20:31:22', 'StringsNo': '218'}, 'hu': {'LastCreated': '2007-05-16 18:35:41', 'StringsNo': '218'}, 'ja': {'LastCreated': '2007-10-18 06:05:27', 'StringsNo': '91'}, 'he': {'LastCreated': '2007-08-17 03:41:21', 'StringsNo': '218'}, 'sr': {'LastCreated': '2007-09-05 10:16:25', 'StringsNo': '155'}, 'sv': {'LastCreated': '2007-08-13 22:45:26', 'StringsNo': '218'}, 'sk': {'LastCreated': '2007-03-13 13:43:33', 'StringsNo': '218'}}} en 218 zh 218 gr 186 vi 218 it 216 ar 218 cs 218 et 218 gl 218 id 217 es 218 ru 81 nl 218 pt 218 pb 218 ro 200 pl 218 fr 218 bg 96 de 216 da 218 fi 218 hu 218 ja 91 he 218 sr 155 sv 218 sk 218 {'status': '410 Other or unknown error', 'seconds': 0.059999999999999998}
Please tell me if I'm doing something wrong...
Thanks,
dbaalborg...

Posted: Sat Jan 12, 2008 6:46 pm
by dbaalborg
OK, I tried with the normal server (http://www.opensubtitles.org/xml-rpc) instead of the development server (http://dev.opensubtitles.org/xml-rpc), and apparently it works, I get the base64 encoded data... I guess I am going to make my tests on the real server then ;)

++
dbaalborg