lang: add a constant for the translation path
This commit is contained in:
parent
113af71896
commit
f40d2c9912
1 changed files with 4 additions and 2 deletions
|
@ -24,6 +24,8 @@
|
||||||
|
|
||||||
local LanguageManager = Object:extend()
|
local LanguageManager = Object:extend()
|
||||||
|
|
||||||
|
local TRANSLATION_PATH = "datas/languages/"
|
||||||
|
|
||||||
-- INIT FUNCTIONS
|
-- INIT FUNCTIONS
|
||||||
-- Initialize and configure the translation system
|
-- Initialize and configure the translation system
|
||||||
|
|
||||||
|
@ -42,11 +44,11 @@ end
|
||||||
-- Get informations from the translation manager
|
-- Get informations from the translation manager
|
||||||
|
|
||||||
function LanguageManager:getTranslationData()
|
function LanguageManager:getTranslationData()
|
||||||
local _path = "datas/languages/init.lua"
|
local _path = TRANSLATION_PATH .. "init.lua"
|
||||||
local fileinfo = love.filesystem.getInfo(_path)
|
local fileinfo = love.filesystem.getInfo(_path)
|
||||||
|
|
||||||
if fileinfo ~= nil then
|
if fileinfo ~= nil then
|
||||||
self.datas = require "datas.languages"
|
self.datas = require(TRANSLATION_PATH)
|
||||||
else
|
else
|
||||||
self.datas = nil
|
self.datas = nil
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue