コード例 #1
0
def register_account_preferred_language_preferences(request):
    if len(get_available_admin_languages()) > 1:
        return {
            'url': reverse('wagtailadmin_account_language_preferences'),
            'label': _('Language preferences'),
            'help_text': _('Choose the language you want to use here.'),
        }
コード例 #2
0
 def test_available_admin_languages_with_permitted_languages(self):
     self.assertListEqual(get_available_admin_languages(), [('en', 'English'), ('es', 'Spanish')])
コード例 #3
0
 def test_available_admin_languages_by_default(self):
     self.assertListEqual(get_available_admin_languages(), WAGTAILADMIN_PROVIDED_LANGUAGES)
コード例 #4
0
def _get_language_choices():
    return sorted(BLANK_CHOICE_DASH + get_available_admin_languages(),
                  key=lambda l: l[1].lower())