webmcp
diff framework/env/locale/set.lua @ 262:c3d539e33710
Replaced request.add_initializer(...) and request.add_variable(...) with request.for_each(...) and request.configure(...) which both execute the passed function once in any case when being called
author | jbe |
---|---|
date | Tue Mar 17 11:42:34 2015 +0100 (2015-03-17) |
parents | 9fdfb27f8e67 |
children |
line diff
1.1 --- a/framework/env/locale/set.lua Mon Mar 16 23:21:18 2015 +0100 1.2 +++ b/framework/env/locale/set.lua Tue Mar 17 11:42:34 2015 +0100 1.3 @@ -8,12 +8,14 @@ 1.4 --]]-- 1.5 1.6 function locale.set(locale_options) 1.7 - if locale_options.reset then 1.8 - locale._current_data = {} 1.9 - end 1.10 - for key, value in pairs(locale_options) do 1.11 - if key ~= "reset" then 1.12 - locale._current_data[key] = value 1.13 + request.configure(function() 1.14 + if locale_options.reset then 1.15 + locale._current_data = {} 1.16 end 1.17 - end 1.18 + for key, value in pairs(locale_options) do 1.19 + if key ~= "reset" then 1.20 + locale._current_data[key] = value 1.21 + end 1.22 + end 1.23 + end) 1.24 end