From f97f75f9616259addb0d3b38b807b7d65a883147 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 15 Oct 2012 16:32:11 -0700 Subject: [PATCH] Set locale under Windows This is mostly a quick hack to be able to test localization under Windows. It seems to work fine under Windows 7 Signed-off-by: Dirk Hohndel --- main.c | 2 +- windows.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 3f43f4561..379b35280 100644 --- a/main.c +++ b/main.c @@ -230,8 +230,8 @@ int main(int argc, char **argv) /* set up l18n - the search directory needs to change * so that it uses the correct system directory when * subsurface isn't run from the local directory */ - setlocale( LC_ALL, "" ); path = subsurface_gettext_domainpath(); + setlocale( LC_ALL, "" ); bindtextdomain("subsurface", path); bind_textdomain_codeset("subsurface", "utf-8"); textdomain("subsurface"); diff --git a/windows.c b/windows.c index b099193f8..6ee763245 100644 --- a/windows.c +++ b/windows.c @@ -153,6 +153,9 @@ const char *subsurface_default_filename() const char *subsurface_gettext_domainpath() { + char buffer[80]; + snprintf(buffer, sizeof(buffer), "LANGUAGE=%s.UTF-8", g_win32_getlocale()); + putenv(buffer); return "./locale"; }