add and use LOCALEDIR variable; move LOCALEDIR_VAR to global.h

Origin commit data
------------------
Branch: ni/coolstream
Commit: 910497f762
Author: vanhofen <vanhofen@gmx.de>
Date: 2015-05-06 (Wed, 06 May 2015)

Origin message was:
------------------
- add and use LOCALEDIR variable; move LOCALEDIR_VAR to global.h

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2015-05-06 10:33:50 +02:00
parent 5632cf2d2a
commit c2486e880b
7 changed files with 14 additions and 7 deletions

View File

@@ -143,6 +143,9 @@ TUXBOX_APPS_DIRECTORY_ONE(plugindir,PLUGINDIR,libdir,/lib,/tuxbox/plugins,
TUXBOX_APPS_DIRECTORY_ONE(luaplugindir,LUAPLUGINDIR,libdir,/lib,/tuxbox/luaplugins, TUXBOX_APPS_DIRECTORY_ONE(luaplugindir,LUAPLUGINDIR,libdir,/lib,/tuxbox/luaplugins,
[--with-luaplugindir=PATH ],[where to find Lua plugins]) [--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, TUXBOX_APPS_DIRECTORY_ONE(themesdir,THEMESDIR,datadir,/share, /tuxbox/neutrino/themes,
[--with-themesdir=PATH ],[where to find the themes]) [--with-themesdir=PATH ],[where to find the themes])
@@ -168,6 +171,7 @@ AC_SUBST(LIBDIR)
AC_SUBST(MNTDIR) AC_SUBST(MNTDIR)
AC_SUBST(PLUGINDIR) AC_SUBST(PLUGINDIR)
AC_SUBST(LUAPLUGINDIR) AC_SUBST(LUAPLUGINDIR)
AC_SUBST(LOCALEDIR)
AC_SUBST(THEMESDIR) AC_SUBST(THEMESDIR)
AC_SUBST(ICONSDIR) AC_SUBST(ICONSDIR)
AC_SUBST(PRIVATE_HTTPDDIR) AC_SUBST(PRIVATE_HTTPDDIR)

View File

@@ -1,4 +1,4 @@
installdir = $(DATADIR)/neutrino/locale installdir = $(LOCALEDIR)
locale = \ locale = \
nederlands.locale \ nederlands.locale \

View File

@@ -8,7 +8,7 @@ any empty lines.
Destination of .locale files: 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: Master file:
------------ ------------

View File

@@ -46,6 +46,7 @@
#define NEUTRINO_SCAN_SETTINGS_FILE CONFIGDIR "/scan.conf" #define NEUTRINO_SCAN_SETTINGS_FILE CONFIGDIR "/scan.conf"
#define NEUTRINO_PARENTALLOCKED_FILE DATADIR "/neutrino/.plocked" #define NEUTRINO_PARENTALLOCKED_FILE DATADIR "/neutrino/.plocked"
#define LOCALEDIR_VAR "/var/tuxbox/locale"
#define THEMESDIR_VAR "/var/tuxbox/themes" #define THEMESDIR_VAR "/var/tuxbox/themes"
NEUTRINO_CPP SNeutrinoSettings g_settings; NEUTRINO_CPP SNeutrinoSettings g_settings;

View File

@@ -184,7 +184,7 @@ void COsdLangSetup::showLanguageSetup(CMenuWidget *osdl_setup)
{ {
struct dirent **namelist; struct dirent **namelist;
int n; int n;
const char *pfad[] = {DATADIR "/neutrino/locale", "/var/tuxbox/locale"}; const char *pfad[] = { LOCALEDIR, LOCALEDIR_VAR };
osdl_setup->addIntroItems(); osdl_setup->addIntroItems();

View File

@@ -76,10 +76,11 @@ void CLanguage::setLanguage(std::string _language){
ConfigLanguage->loadConfig(language_dir + "/" + _language); ConfigLanguage->loadConfig(language_dir + "/" + _language);
DefaultLanguage->loadConfig(language_dir + "/" + HTTPD_DEFAULT_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++) for (int i = 0; i < 2; i++)
{ {
std::string filename = path[i]; std::string filename = path[i];
filename += "/";
filename += g_settings.language; filename += g_settings.language;
filename += ".locale"; filename += ".locale";
@@ -89,7 +90,7 @@ void CLanguage::setLanguage(std::string _language){
} }
else if (i == 1) { else if (i == 1) {
// load neutrino default language (should not happen) // load neutrino default language (should not happen)
NeutrinoLanguage->loadConfig(DATADIR "/neutrino/locale/english.locale", ' '); NeutrinoLanguage->loadConfig(LOCALEDIR "/english.locale", ' ');
} }
} }
} }

View File

@@ -34,6 +34,7 @@
#include <config.h> #include <config.h>
#endif #endif
#include <global.h>
#include <system/localize.h> #include <system/localize.h>
#include <system/locals_intern.h> #include <system/locals_intern.h>
@@ -108,8 +109,7 @@ CLocaleManager::~CLocaleManager()
::free(defaultDataMem); ::free(defaultDataMem);
} }
#define LOCALEDIR_VAR "/var/tuxbox/locale/" const char * path[2] = { LOCALEDIR_VAR, LOCALEDIR };
const char * path[2] = { LOCALEDIR_VAR, DATADIR "/neutrino/locale/"};
CLocaleManager::loadLocale_ret_t CLocaleManager::loadLocale(const char * const locale, bool asdefault) 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++) for (unsigned int i = 0; i < 2; i++)
{ {
std::string filename = path[i]; std::string filename = path[i];
filename += "/";
filename += locale; filename += locale;
filename += ".locale"; filename += ".locale";
::stat(filename.c_str(), &st); ::stat(filename.c_str(), &st);