diff --git a/acinclude.m4 b/acinclude.m4 index 3d32749f8..e09cdd66d 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -143,6 +143,9 @@ TUXBOX_APPS_DIRECTORY_ONE(plugindir,PLUGINDIR,libdir,/lib,/tuxbox/plugins, TUXBOX_APPS_DIRECTORY_ONE(luaplugindir,LUAPLUGINDIR,libdir,/lib,/tuxbox/luaplugins, [--with-luaplugindir=PATH ],[where to find Lua plugins]) +TUXBOX_APPS_DIRECTORY_ONE(localedir,LOCALEDIR,datadir,/share, /tuxbox/neutrino/locale, + [--with-localedir=PATH ],[where to find the locale]) + TUXBOX_APPS_DIRECTORY_ONE(themesdir,THEMESDIR,datadir,/share, /tuxbox/neutrino/themes, [--with-themesdir=PATH ],[where to find the themes]) @@ -168,6 +171,7 @@ AC_SUBST(LIBDIR) AC_SUBST(MNTDIR) AC_SUBST(PLUGINDIR) AC_SUBST(LUAPLUGINDIR) +AC_SUBST(LOCALEDIR) AC_SUBST(THEMESDIR) AC_SUBST(ICONSDIR) AC_SUBST(PRIVATE_HTTPDDIR) diff --git a/data/locale/Makefile.am b/data/locale/Makefile.am index 3da75d75f..95e3a1165 100644 --- a/data/locale/Makefile.am +++ b/data/locale/Makefile.am @@ -1,4 +1,4 @@ -installdir = $(DATADIR)/neutrino/locale +installdir = $(LOCALEDIR) locale = \ nederlands.locale \ diff --git a/data/locale/_readme.txt b/data/locale/_readme.txt index 8c47c902f..0d417fdcb 100644 --- a/data/locale/_readme.txt +++ b/data/locale/_readme.txt @@ -8,7 +8,7 @@ any empty lines. Destination of .locale files: ----------------------------- -directory: /var/tuxbox/config/locale or /share/tuxbox/neutrino/locale +directory: /var/tuxbox/locale or /share/tuxbox/neutrino/locale Master file: ------------ diff --git a/src/global.h b/src/global.h index 602635bc8..59de7db4e 100644 --- a/src/global.h +++ b/src/global.h @@ -46,6 +46,7 @@ #define NEUTRINO_SCAN_SETTINGS_FILE CONFIGDIR "/scan.conf" #define NEUTRINO_PARENTALLOCKED_FILE DATADIR "/neutrino/.plocked" +#define LOCALEDIR_VAR "/var/tuxbox/locale" #define THEMESDIR_VAR "/var/tuxbox/themes" NEUTRINO_CPP SNeutrinoSettings g_settings; diff --git a/src/gui/osdlang_setup.cpp b/src/gui/osdlang_setup.cpp index 6757e40a7..3c61bd5a3 100644 --- a/src/gui/osdlang_setup.cpp +++ b/src/gui/osdlang_setup.cpp @@ -184,7 +184,7 @@ void COsdLangSetup::showLanguageSetup(CMenuWidget *osdl_setup) { struct dirent **namelist; int n; - const char *pfad[] = {DATADIR "/neutrino/locale", "/var/tuxbox/locale"}; + const char *pfad[] = { LOCALEDIR, LOCALEDIR_VAR }; osdl_setup->addIntroItems(); diff --git a/src/nhttpd/yhttpd_core/ylanguage.cpp b/src/nhttpd/yhttpd_core/ylanguage.cpp index 9604c72c1..47391ddc6 100644 --- a/src/nhttpd/yhttpd_core/ylanguage.cpp +++ b/src/nhttpd/yhttpd_core/ylanguage.cpp @@ -76,10 +76,11 @@ void CLanguage::setLanguage(std::string _language){ ConfigLanguage->loadConfig(language_dir + "/" + _language); DefaultLanguage->loadConfig(language_dir + "/" + HTTPD_DEFAULT_LANGUAGE); - const char * path[2] = { "/var/tuxbox/locale/", DATADIR "/neutrino/locale/"}; + const char * path[2] = { LOCALEDIR_VAR, LOCALEDIR }; for (int i = 0; i < 2; i++) { std::string filename = path[i]; + filename += "/"; filename += g_settings.language; filename += ".locale"; @@ -89,7 +90,7 @@ void CLanguage::setLanguage(std::string _language){ } else if (i == 1) { // load neutrino default language (should not happen) - NeutrinoLanguage->loadConfig(DATADIR "/neutrino/locale/english.locale", ' '); + NeutrinoLanguage->loadConfig(LOCALEDIR "/english.locale", ' '); } } } diff --git a/src/system/localize.cpp b/src/system/localize.cpp index c1be218fe..607f7b95f 100644 --- a/src/system/localize.cpp +++ b/src/system/localize.cpp @@ -34,6 +34,7 @@ #include #endif +#include #include #include @@ -108,8 +109,7 @@ CLocaleManager::~CLocaleManager() ::free(defaultDataMem); } -#define LOCALEDIR_VAR "/var/tuxbox/locale/" -const char * path[2] = { LOCALEDIR_VAR, DATADIR "/neutrino/locale/"}; +const char * path[2] = { LOCALEDIR_VAR, LOCALEDIR }; CLocaleManager::loadLocale_ret_t CLocaleManager::loadLocale(const char * const locale, bool asdefault) { @@ -131,6 +131,7 @@ CLocaleManager::loadLocale_ret_t CLocaleManager::loadLocale(const char * const l for (unsigned int i = 0; i < 2; i++) { std::string filename = path[i]; + filename += "/"; filename += locale; filename += ".locale"; ::stat(filename.c_str(), &st);