Skip to content
Snippets Groups Projects
Select Git revision
  • 2dd8a700ca9cc288dc4ea8abb261b8e210c446f6
  • v2018.2.x default protected
  • 0x4A6F-rpi4
  • 0x4A6F-master
  • master
  • v2018.2.2-ffs
  • v2016.2.4-batmanbug
  • radv-filterd
  • v2016.2.x
  • hoodselector
  • v2016.1.x
  • babel
  • v2015.1.x
  • 2014.4.x
  • 2014.3.x
  • v2018.2.2-ffs0.1
  • v2018.2.1-ffs0.1
  • v2018.2.1
  • v2018.2-ffs0.1
  • v2018.2
  • v2018.1.4
  • v2018.1.3
  • v2018.1.2
  • v2018.1.1
  • v2018.1
  • v2017.1.8
  • v2017.1.7
  • v2017.1.6
  • v2017.1.5
  • v2017.1.4
  • v2017.1.3
  • v2017.1.2
  • v2016.2.7
  • v2017.1.1
  • v2017.1
35 results

0002-modules-base-dispatcher-set-default-language-if-none-provided-by-the-browser-matches.patch

Blame
  • Forked from firmware / FFS Gluon
    3452 commits behind the upstream repository.
    user avatar
    Matthias Schiffer authored
    7dce74c0
    History
    0002-modules-base-dispatcher-set-default-language-if-none-provided-by-the-browser-matches.patch 1002 B
    From: Matthias Schiffer <mschiffer@universe-factory.net>
    Date: Thu, 19 Mar 2015 18:44:52 +0100
    Subject: modules/base: dispatcher: set default language if none provided by the browser matches
    
    diff --git a/modules/luci-base/luasrc/dispatcher.lua b/modules/luci-base/luasrc/dispatcher.lua
    index 25269501068dd26efe5b85706b555996d63b0f6d..be2fc3453f528853519649e4b64ecb3fd14d80be 100644
    --- a/modules/luci-base/luasrc/dispatcher.lua
    +++ b/modules/luci-base/luasrc/dispatcher.lua
    @@ -182,6 +182,7 @@ function dispatch(request)
     	assert(conf.main,
     		"/etc/config/luci seems to be corrupt, unable to find section 'main'")
     
    +	local i18n = require "luci.i18n"
     	local lang = conf.main.lang or "auto"
     	if lang == "auto" then
     		local aclang = http.getenv("HTTP_ACCEPT_LANGUAGE") or ""
    @@ -193,7 +194,10 @@ function dispatch(request)
     			end
     		end
     	end
    -	require "luci.i18n".setlanguage(lang)
    +	if lang == "auto" then
    +		lang = i18n.default
    +	end
    +	i18n.setlanguage(lang)
     
     	local c = ctx.tree
     	local stat