0

Django's documentation states that i18n_patterns uses the forward slash as prefix separator for language codes. So, the URL /en/id-123 activates English as language, while /id/id-123 activates Indonesian.

However, it seems that the dash is also used as a separator, because the URL /id-123 also activates Indonesian as language. But that's undesired in my use case, because this URL should only fetch an object with ID = 123 instead of switching the language.

Is there some setting for determining this behavior?

Simon Steinberger
  • 6,605
  • 5
  • 55
  • 97

1 Answers1

0

I think you may have misdiagnosed the issue. It is very unlikely that Django parses the dash in the URL. I suspect that /id-123 uses Indonesian because that’s the default language in the settings, or the request language determined from your browser settings.

merwok
  • 6,779
  • 1
  • 28
  • 42