added patch to make gettext work with OSX
This commit is contained in:
parent
680646b25e
commit
8ea9ae7214
2 changed files with 12 additions and 2 deletions
|
@ -185,6 +185,11 @@ std::string get_cache_dir()
|
|||
|
||||
std::string get_intl_dir()
|
||||
{
|
||||
|
||||
#ifdef __APPLE__
|
||||
return get_cwd() + "/messages";
|
||||
#endif
|
||||
|
||||
std::string res;
|
||||
#if HAS_RELATIVE_LOCALEDIR
|
||||
res = game_config::path + "/" LOCALEDIR;
|
||||
|
|
|
@ -109,11 +109,16 @@ std::vector<language_def> get_languages()
|
|||
// problems, like the MacOS-X ones.
|
||||
char* wesnoth_setlocale(int category, const char *locale)
|
||||
{
|
||||
if (setenv ("LANG", locale, 1) == -1)
|
||||
if(setenv ("LANG", locale, 1) == -1)
|
||||
std::cerr << "setenv LANG failed: " << strerror(errno);
|
||||
if (setenv ("LC_ALL", locale, 1) == -1)
|
||||
if(setenv ("LC_ALL", locale, 1) == -1)
|
||||
std::cerr << "setenv LC_ALL failed: " << strerror(errno);
|
||||
|
||||
#ifdef __APPLE__
|
||||
if(setenv ("LANGUAGE", locale, 1) == -1)
|
||||
std::cerr << "setenv LANGUAGE failed: " << strerror(errno);
|
||||
#endif
|
||||
|
||||
char* res = setlocale (category, locale);
|
||||
if (res == NULL)
|
||||
std::cerr << "WARNING: setlocale() failed for "
|
||||
|
|
Loading…
Add table
Reference in a new issue