|
|
@ -109,18 +109,18 @@ def alpha3_from_language(lang):
|
|
|
|
return result
|
|
|
|
return result
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_language_set(kind="code3"):
|
|
|
|
def get_language_set():
|
|
|
|
db = sqlite3.connect(os.path.join(args.config_dir, 'db', 'bazarr.db'), timeout=30)
|
|
|
|
db = sqlite3.connect(os.path.join(args.config_dir, 'db', 'bazarr.db'), timeout=30)
|
|
|
|
c = db.cursor()
|
|
|
|
c = db.cursor()
|
|
|
|
c.execute('''SELECT ?, name FROM table_settings_languages WHERE enabled = 1''', (kind,))
|
|
|
|
languages = c.execute('''SELECT code3 FROM table_settings_languages WHERE enabled = 1''').fetchall()
|
|
|
|
|
|
|
|
db.close()
|
|
|
|
language_set = set()
|
|
|
|
language_set = set()
|
|
|
|
|
|
|
|
|
|
|
|
for lang in c.fetchall():
|
|
|
|
for lang in languages:
|
|
|
|
# fixme: currently only works with kind=code3
|
|
|
|
if lang[0] == 'pob':
|
|
|
|
if lang == 'pob':
|
|
|
|
|
|
|
|
language_set.add(Language('por', 'BR'))
|
|
|
|
language_set.add(Language('por', 'BR'))
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
language_set.add(Language(lang))
|
|
|
|
language_set.add(Language(lang[0]))
|
|
|
|
|
|
|
|
|
|
|
|
return language_set
|
|
|
|
return language_set
|
|
|
|
|
|
|
|
|
|
|
|