﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
34069	get_language_from_request should not fallback to settings.LANGUAGE_CODE	sergioisidoro	nobody	"I'm writing a middleware to fallback to a different language depending on the TLD of the domain of the HTTP_HOST

However, I noticed that `get_language_from_request` falls back to the settings default language, which will almost always take precedence in this case.

This is quite confusing, since `settings.LANGUAGE_CODE` is not ""from the request"", but from the application configuration, and it feels that the responsibility of falling back to the default language should lie in the Middleware, not in this function.

Solution / Summary: `get_language_from_request` should return None, to communicate to the middleware that there was no language from request, and that the middleware should fallback to the default. Otherwise if the `get_language_from_request` returns ""EN"" we don't know if ""EN"" is actually a request preference, or because it came from the default `settings.LANGUAGE_CODE`

"	Cleanup/optimization	new	Internationalization	4.1	Normal		i18n get_language_from_request middleware		Unreviewed	0	0	0	0	1	0
