lang: add a constant for the translation path

This commit is contained in:
Kazhnuz 2019-04-13 18:32:54 +02:00
parent 113af71896
commit f40d2c9912

View file

@ -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