def get_language_urls(self): """Return a list of language codes, full names and URLs""" return [{ 'id': code, 'name': get_language_name(code), 'url': "/%s%s" % (code, self.get_absolute_url()) } for code in self.get_languages()]
def _get_facet_choices_language_ids(self, items): return sorted([{ 'id': item, 'name': get_language_name(item) } for item in items], key=lambda language: language['name'])
def test_get_language_name(self): self.assertEqual("English", get_language_name("en"))
def get_language_names(self): """Return a list of language_codes and full names""" return [{ 'id': code, 'name': get_language_name(code) } for code in self.get_languages()]
def _get_facet_choices_language_ids(self, items): return sorted([{ 'id': item, 'name': get_language_name(item)} for item in items], key=lambda language: language['name'])
def _get_facet_choices_language_ids(self, items): return sorted( [{"id": item, "name": get_language_name(item)} for item in items], key=lambda language: language["name"] )