Lua: Rename global variable “L” to “LOCALE”
authorWuzzy <Wuzzy2@mail.ru>
Wed, 07 Mar 2018 13:48:51 +0100
changeset 13093 2b5314cc356c
parent 13092 b6df6283e2ba
child 13094 c9cdbf630447
Lua: Rename global variable “L” to “LOCALE” Srsly, WTF? If we have to use global variables, at least give them descriptive names.
hedgewars/uScript.pas
share/hedgewars/Data/Scripts/Locale.lua
--- a/hedgewars/uScript.pas	Wed Mar 07 12:33:56 2018 +0100
+++ b/hedgewars/uScript.pas	Wed Mar 07 13:48:51 2018 +0100
@@ -3601,7 +3601,7 @@
 luaopen_table(luaState);
 
 // import some variables
-ScriptSetString(_S'L', cLocale);
+ScriptSetString(_S'LOCALE', cLocale);
 
 // import game flags
 ScriptSetInteger('gfForts', gfForts);
--- a/share/hedgewars/Data/Scripts/Locale.lua	Wed Mar 07 12:33:56 2018 +0100
+++ b/share/hedgewars/Data/Scripts/Locale.lua	Wed Mar 07 13:48:51 2018 +0100
@@ -1,6 +1,6 @@
 -- Library for localizing strings in lua scripts
 
-local lang = HedgewarsScriptLoad("Locale/" .. tostring(L) .. ".lua")
+local lang = HedgewarsScriptLoad("Locale/" .. tostring(LOCALE) .. ".lua")
 
 function loc(text)
     if locale ~= nil and locale[text] ~= nil then return locale[text]