Example #1
0
 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()]
Example #2
0
 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'])
Example #3
0
 def test_get_language_name(self):
     self.assertEqual("English", get_language_name("en"))
Example #4
0
 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()]
Example #5
0
 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()]
Example #6
0
 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()]
Example #7
0
 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'])
Example #8
0
 def test_get_language_name(self):
     self.assertEqual("English", get_language_name("en"))
Example #9
0
 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"]
     )