Fix dummy locales not working on Debian for Japanese and Korean.

This commit is contained in:
Guillaume Melquiond 2005-06-03 20:19:29 +00:00
parent 9832c32998
commit 3b7038bcfd
2 changed files with 9 additions and 2 deletions

View file

@ -57,8 +57,9 @@ if DUMMYLOCALES
if test -d "$(DESTDIR)$(pkgdatadir)/locales/C" ; then rm -r "$(DESTDIR)$(pkgdatadir)/locales/C" ; fi
echo | localedef --force "$(DESTDIR)$(pkgdatadir)/locales/C" 2> /dev/null; \
for loc in `sed -n 's/^.*language_def..\(.._..\).*$$/\1/p' "$(srcdir)/src/language.cpp"`; do \
if test -L "$(DESTDIR)$(pkgdatadir)/locales/$$loc" ; then rm "$(DESTDIR)$(pkgdatadir)/locales/$$loc" ; fi; \
ln -s C "$(DESTDIR)$(pkgdatadir)/locales/$$loc"; done; \
loclnk="$(DESTDIR)$(pkgdatadir)/locales/$$loc"@wesnoth; \
if test -L "$$loclnk" ; then rm "$$loclnk" ; fi; \
ln -s C "$$loclnk"; done; \
true
endif
if TINYGUI

View file

@ -156,6 +156,12 @@ static void wesnoth_setlocale(int category, std::string const &slocale)
else
setenv("LOCPATH", locpath.c_str(), 1);
else setenv("LOCPATH", (game_config::path + "/locales").c_str(), 1);
std::string xlocale;
if (!slocale.empty()) {
// dummy suffix to prevent locale aliasing from kicking in
xlocale = slocale + "@wesnoth";
locale = xlocale.c_str();
}
#endif
char* res = setlocale (category, locale);
if (res == NULL)