def is_supported_locale(self, language, country): xSpellChecker = get_spellchecker(self.ui_test._xContext) locales = xSpellChecker.getLocales() for locale in locales: if language != None: if locale.Language != language: continue if country != None: if locale.Country != country: continue # we found the correct combination return True