def localeInit(): lang = language.getLanguage() environ["LANGUAGE"] = lang[:2] gettext.bindtextdomain("enigma2", resolveFilename(SCOPE_LANGUAGE)) gettext.textdomain("enigma2") gettext.bindtextdomain("AdvancedMovieSelection", "%s%s" % (resolveFilename(SCOPE_PLUGINS), "Extensions/AdvancedMovieSelection/locale/")) ln = language.lang[language.activeLanguage][1] from AboutParser import AboutParser AboutParser.setLocale(ln) from MovieDB import tmdb, tvdb tmdb.setLocale(ln) tvdb.setLocale(ln)
def localeInit(): lang = language.getLanguage() environ["LANGUAGE"] = lang[:2] gettext.bindtextdomain("enigma2", resolveFilename(SCOPE_LANGUAGE)) gettext.textdomain("enigma2") gettext.bindtextdomain("AdvancedMovieSelection", "%s%s" % (resolveFilename(SCOPE_PLUGINS), "Extensions/AdvancedMovieSelection/locale/")) ln = language.lang[language.activeLanguage][1] from AboutParser import AboutParser AboutParser.setLocale(ln) from MovieDB import tmdb, tvdb tmdb.setLocale(ln) tvdb.setLocale(ln)
def testMultiEit(): TEST_RUS1 = '\xd0\x90\xd0\xb0\xd0\x91\xd0\xb1\xd0\x92\xd0\xb2\xd0\x93\xd0\xb3\xd0\x94\xd0\xb4\xd0\x95\xd0\xb5\xd0\x81\xd1\x91\xd0\x96\xd0\xb6\xd0\x97\xd0\xb7\xd0\x98\xd0\xb8\xd0\x99\xd0\xb9\xd0\x9a\xd0\xba\xd0\x9b\xd0\xbb\xd0\x9c\xd0\xbc\xd0\x9d\xd0\xbd\xd0\x9e\xd0\xbe\xd0\x9f\xd0\xbf\xd0\xa0\xd1\x80\xd0\xa1\xd1\x81\xd0\xa2\xd1\x82\xd0\xa3\xd1\x83\xd0\xa4\xd1\x84\xd0\xa5\xd1\x85\xd0\xa6\xd1\x86\xd0\xa7\xd1\x87\xd0\xa8\xd1\x88\xd0\xa9\xd1\x89\xd0\xaa\xd1\x8a\xd0\xab\xd1\x8b\xd0\xac\xd1\x8c\xd0\xad\xd1\x8d\xd0\xae\xd1\x8e\xd0\xaf\xd1\x8f' TEST_RUS2 = '0123456789 abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ @ -^!"\xc2\xa7$%&/()=?+-/*~#\'_.:,;<>|`{[]}' TEST_DEU = '0123456789 abcdefghijklmnopqrstuvwxyz \xc3\xa4\xc3\xb6\xc3\xbc\xc3\x9f ABCDEFGHIJKLMNOPQRSTUVWXYZ \xc3\x84\xc3\x96\xc3\x9c@\xe2\x82\xac -^\xc2\xb0!"\xc2\xa7$%&/()=?+-/*~#\'_.:,;<>|\xc2\xb4`{[]}' testEIT('DEU', TEST_DEU) testEIT('rus', TEST_RUS1) testEIT('rus', TEST_RUS2) if __name__ == '__main__': path = './tmp/' if not os.path.exists(path): os.makedirs(path) testMultiEit() tmdb.setLocale('de') createEIT('./tmp/Fight Club.ts', 'Fight Club', 'cover', overwrite_eit=True) tmdb.setLocale('ru') createEIT( './tmp/Blitz_ru.ts', '\xd0\xa7\xd0\xb5\xd1\x80\xd0\xbd\xd0\xb0\xd1\x8f \xd0\x9c\xd0\xbe\xd0\xbb\xd0\xbd\xd0\xb8\xd1\x8f', 'cover', overwrite_eit=True) tmdb.setLocale('de') printEIT('./tmp/Blitz_ru.eit') printEIT('./tmp/russia.eit') printEIT('./tmp/Shutter Island ru Original.eit') printEIT('./tmp/Shutter Island ru tmdb.eit') printEIT('./tmp/22 Bullets.eit') results = tvdb.search('Law & Order') for searchResult in results: