Ensure the phrases_dir is not nil.
This commit is contained in:
@@ -34,6 +34,14 @@
|
|||||||
--action = params:getHeader("action");
|
--action = params:getHeader("action");
|
||||||
language = params:getHeader("lang");
|
language = params:getHeader("lang");
|
||||||
|
|
||||||
|
--make sure phrase_dir variable is not nil
|
||||||
|
if (phrases_dir == nil) then
|
||||||
|
--define the variable
|
||||||
|
phrases_dir = '';
|
||||||
|
--include the config.lua and local.lua
|
||||||
|
require "resources.functions.config";
|
||||||
|
end
|
||||||
|
|
||||||
--additional information
|
--additional information
|
||||||
--event_calling_function = params:getHeader("Event-Calling-Function");
|
--event_calling_function = params:getHeader("Event-Calling-Function");
|
||||||
|
|
||||||
@@ -143,7 +151,6 @@
|
|||||||
end
|
end
|
||||||
|
|
||||||
--read root xml language file, parse included xml files
|
--read root xml language file, parse included xml files
|
||||||
if (phrases_dir ~= nil) then
|
|
||||||
local xml_file_paths = {}
|
local xml_file_paths = {}
|
||||||
local file_handle = io.open(phrases_dir.."/"..language.."/"..language..".xml", "r");
|
local file_handle = io.open(phrases_dir.."/"..language.."/"..language..".xml", "r");
|
||||||
if (file_handle ~= nil) then
|
if (file_handle ~= nil) then
|
||||||
@@ -158,7 +165,6 @@
|
|||||||
end
|
end
|
||||||
file_handle:close();
|
file_handle:close();
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
--iterate array of file paths, get contents of other xml macro files
|
--iterate array of file paths, get contents of other xml macro files
|
||||||
for key, xml_file_path in pairs(xml_file_paths) do
|
for key, xml_file_path in pairs(xml_file_paths) do
|
||||||
|
|||||||
Reference in New Issue
Block a user