0

I have situation when i have two types of locales. First needed for website and second need for creating reports. Second type of locales added dynamically so it cant be set in settings.

Im interesting is there possibility to add new locales at runtime?

Andrey Nikishaev
  • 3,759
  • 5
  • 40
  • 55

1 Answers1

0

According to this answer and django document,

You can do this in your view:

from django.utils import translation

and

language = second_type_locales
translation.activate(language)

here comes some examples in django document,

Community
  • 1
  • 1
bluebird_lboro
  • 601
  • 5
  • 17