You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Django app which django-countries. I would like to alter the order of the countries shown based on the user's language. For example if the user is using French, I will bring France, Belgium, Luxumburg, Switzerland etc to the top, whereas if they select German I will bring up Germany, Austria, Switzerland etc.
I can set COUNTRIES_FIRST = ['FR','BE','LU','CH'] within settings, but that ordering is then used for all user languages.
Is there a way to base the order on the user's language?
I have tried modifying the COUNTRIES_FIRST within a view, for example
if self.administration_instance.study.instrument.language == 'French':
settings.COUNTRIES_FIRST = ['FR','CH','BE','LU']
translation.activate(self.user_language)
But this clearly doesn't work
The text was updated successfully, but these errors were encountered:
There's not a way at the moment to have the countries_first ordered by user language. It'd be an easy addition with a new setting if someone wanted to tackle it!
I have a Django app which
django-countries
. I would like to alter the order of the countries shown based on the user's language. For example if the user is using French, I will bring France, Belgium, Luxumburg, Switzerland etc to the top, whereas if they select German I will bring up Germany, Austria, Switzerland etc.I can set
COUNTRIES_FIRST = ['FR','BE','LU','CH']
within settings, but that ordering is then used for all user languages.Is there a way to base the order on the user's language?
I have tried modifying the
COUNTRIES_FIRST
within a view, for exampleBut this clearly doesn't work
The text was updated successfully, but these errors were encountered: