def get_available_translations():
 locale_path = get_module_data_path('spyder', relpath='locale', attr_name='LOCALEPATH')
 listdir = os.listdir(locale_path)
 langs = [d for d in listdir if osp.isdir(osp.join(locale_path, d))]
 langs = ([DEFAULT_LANGUAGE] + langs)
 langs = list((set(langs) - set(DISABLED_LANGUAGES)))
 for lang in langs:
  if (lang not in LANGUAGE_CODES):
   error = _('Update LANGUAGE_CODES (inside config/base.py) if a new translation has been added to Spyder')
   raise Exception(error)
 return langs

def get_available_translations ( ) : locale_path = get_module_data_path ( 'spyder' , relpath = 'locale' , attr_name = 'LOCALEPATH' ) listdir = os . listdir ( locale_path ) langs = [ d for d in listdir if osp . isdir ( osp . join ( locale_path , d ) ) ] langs = ( [ DEFAULT_LANGUAGE ] + langs ) langs = list ( ( set ( langs ) - set ( DISABLED_LANGUAGES ) ) ) for lang in langs : if ( lang not in LANGUAGE_CODES ) : error = _ ( 'Update LANGUAGE_CODES (inside config/base.py) if a new translation has been added to Spyder' ) raise Exception ( error ) return langs
list available translations for spyder based on the folders found in the locale folder .