code: def language_selector(context):
      
      output = ""
      i18 = getattr(settings, 'USE_I18N', False)
      if i18:
          template = "admin/language_selector.html"
          context['i18n_is_set'] = True
          try:
              output = render_to_string(template, context)
          except:
              pass
      return output
docs: displays a language selector dropdown in the admin, based on Django "LANGUAGES" context.
          requires:
              * USE_I18N = True / settings.py
              * LANGUAGES specified / settings.py (otherwise all Django locales will be displayed)
              * "set_language" url configured (see https://docs.djangoproject.com/en/dev/topics/i18n/translation/#the-set-language-redirect-view)