#include "lang.h"
#include "common.h"
#include "base_config.h"
+#include "fs.h"
/*---------------------------------------------------------------------------*/
void lang_init(const char *domain)
{
#if ENABLE_NLS
- char *dir = getenv("NEVERBALL_LOCALE");
+ char *dir = strdup(getenv("NEVERBALL_LOCALE"));
if (!dir)
- dir = path_resolve(config_exec_path, CONFIG_LOCALE);
+ {
+ if (path_is_abs(CONFIG_LOCALE))
+ dir = strdup(CONFIG_LOCALE);
+ else
+ dir = concat_string(fs_base_dir(), "/", CONFIG_LOCALE, NULL);
+ }
errno = 0;
bindtextdomain(domain, dir);
bind_textdomain_codeset(domain, DEFAULT_CODESET);
textdomain(domain);
+
+ free(dir);
#else
return;
#endif