Skip to content

Instantly share code, notes, and snippets.

@andreibosco
Created July 31, 2021 22:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreibosco/bdbfb415d9bb71ab01f8455d18c32111 to your computer and use it in GitHub Desktop.
Save andreibosco/bdbfb415d9bb71ab01f8455d18c32111 to your computer and use it in GitHub Desktop.
Django - test i18n language using shell
  • Use the following commands, replacing your string here with the string that you want to test.
  • Obs.: shell_plus is provided by django-extensions
python manage.py shell_plus
from django.utils.translation import activate, get_language_info, ugettext as _
get_language_info('fr')
activate('fr')
print(_("your string here"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment