Fix how languages detect the lang file path
This commit is contained in:
parent
71b616c76c
commit
bc946aa3b3
|
@ -2,6 +2,8 @@
|
||||||
#include "djui_unicode.h"
|
#include "djui_unicode.h"
|
||||||
#include "pc/ini.h"
|
#include "pc/ini.h"
|
||||||
#include "pc/platform.h"
|
#include "pc/platform.h"
|
||||||
|
#include "pc/mods/mods.h"
|
||||||
|
#include "pc/mods/mods_utils.h"
|
||||||
|
|
||||||
ini_t* sLang = NULL;
|
ini_t* sLang = NULL;
|
||||||
|
|
||||||
|
@ -13,9 +15,12 @@ bool djui_language_init(char* lang) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// construct path
|
// construct path
|
||||||
|
char exePath[SYS_MAX_PATH] = "";
|
||||||
|
path_get_folder((char*)path_to_executable(), exePath);
|
||||||
|
|
||||||
char path[SYS_MAX_PATH] = "";
|
char path[SYS_MAX_PATH] = "";
|
||||||
if (!lang || lang[0] == '\0') { lang = "English"; }
|
if (!lang || lang[0] == '\0') { lang = "English"; }
|
||||||
snprintf(path, SYS_MAX_PATH, "%s/lang/%s.ini", sys_exe_path(), lang);
|
snprintf(path, SYS_MAX_PATH, "%s/lang/%s.ini", exePath, lang);
|
||||||
|
|
||||||
// load
|
// load
|
||||||
sLang = ini_load(path);
|
sLang = ini_load(path);
|
||||||
|
|
Loading…
Reference in New Issue