Prevent dummylocales compilation in windows
This commit is contained in:
parent
b4168aaced
commit
2b6f8637f2
3 changed files with 12 additions and 4 deletions
|
@ -348,7 +348,7 @@ env.Clean(all, 'TAGS')
|
|||
# Dummy locales
|
||||
#
|
||||
|
||||
if env["nls"]:
|
||||
if env["nls"] and env['PLATFORM'] != 'win32':
|
||||
env.Command(Dir("locales/C"), [], "-mkdir -p locales;echo | localedef --force \"$TARGET\" 2> /dev/null")
|
||||
language_cfg_re = re.compile(r"data/languages/(.*)\.cfg")
|
||||
language_cfgs = glob("data/languages/*.cfg")
|
||||
|
@ -379,7 +379,7 @@ docdir = env['docdir']
|
|||
installable_subs = Split('data fonts icons images sounds')
|
||||
if env['nls']:
|
||||
installable_subs.append("translations")
|
||||
if env['nls']:
|
||||
if env['nls'] and env['PLATFORM'] != 'win32':
|
||||
installable_subs.append("locales")
|
||||
fifodir = env['fifodir']
|
||||
mandir = env["mandir"]
|
||||
|
|
|
@ -104,11 +104,14 @@ bool language_def::operator== (const language_def& a) const
|
|||
|
||||
bool language_def::available() const
|
||||
{
|
||||
#ifndef _WIN32
|
||||
if (game_config::use_dummylocales)
|
||||
{
|
||||
// Dummy has every language available.
|
||||
return true;
|
||||
}else{
|
||||
}else
|
||||
#endif
|
||||
{
|
||||
if(has_language(localename)) {
|
||||
return true;
|
||||
} else {
|
||||
|
@ -118,6 +121,7 @@ bool language_def::available() const
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -219,6 +223,8 @@ static void wesnoth_setlocale(int category, std::string const &slocale,
|
|||
category = LC_ALL;
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
// dummy locales aren't working in windows
|
||||
if (game_config::use_dummylocales)
|
||||
{
|
||||
static enum { UNINIT, NONE, PRESENT } status = UNINIT;
|
||||
|
@ -242,6 +248,7 @@ static void wesnoth_setlocale(int category, std::string const &slocale,
|
|||
locale = xlocale.c_str();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
char *res = NULL;
|
||||
#ifdef _WIN32
|
||||
|
|
|
@ -50,12 +50,13 @@ struct wesnoth_global_fixture {
|
|||
wesnoth_global_fixture()
|
||||
{
|
||||
game_config::use_dummylocales = true;
|
||||
game_config::path = "./";
|
||||
|
||||
// Initialize unit tests
|
||||
SDL_Init(SDL_INIT_TIMER);
|
||||
test_utils::get_fake_display();
|
||||
|
||||
lg::set_log_domain_severity("all",3);
|
||||
// lg::set_log_domain_severity("all",3);
|
||||
|
||||
// Set more report as default
|
||||
if (boost::unit_test::runtime_config::log_level() == boost::unit_test::invalid_log_level)
|
||||
|
|
Loading…
Add table
Reference in a new issue