'Set optional language selection items in the SelectLang widget.'

def set_languages(self):

    self.ui.SelectLang.clear()
    langs = LangUtil.language
    langs_not_found = []
    for locale in langs:
        if (not os.path.isfile(((LANG_DIR + locale) + '.qm'))):
            langs_not_found.append(locale)
    for locale in langs_not_found:
        langs.pop(locale)
    LangUtil.language = langs
    if (len(langs) <= 1):
        self.ui.SelectLang.setEnabled(False)
    self.ui.SelectLang.blockSignals(True)
    sys_locale = LangUtil.get_locale()
    if (sys_locale not in langs.keys()):
        sys_locale = 'en_US'
    for (i, locale) in enumerate(sorted(langs.keys())):
        if (sys_locale == locale):
            select = i
        lang = langs[locale]
        self.ui.SelectLang.addItem(_fromUtf8(''))
        self.ui.SelectLang.setItemText(i, lang)
    self.ui.SelectLang.blockSignals(False)
    self.ui.SelectLang.setCurrentIndex(select)
