From 974c4df0293afe43d763b7d888c7d92b22b67c56 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 12 Jul 2010 09:56:32 -0700 Subject: [PATCH] Ticket 2433: Skip locale fallback list check on Windows ('locale -a' shell-out doesn't work there) --- lib/util.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/util.php b/lib/util.php index 2a90b56a99..9f62097d54 100644 --- a/lib/util.php +++ b/lib/util.php @@ -88,8 +88,8 @@ function common_init_language() // don't do the job. en_US.UTF-8 should be there most of the // time, but not guaranteed. $ok = common_init_locale("en_US"); - if (!$ok) { - // Try to find a complete, working locale... + if (!$ok && strtolower(substr(PHP_OS, 0, 3)) != 'win') { + // Try to find a complete, working locale on Unix/Linux... // @fixme shelling out feels awfully inefficient // but I don't think there's a more standard way. $all = `locale -a`; @@ -101,9 +101,9 @@ function common_init_language() } } } - if (!$ok) { - common_log(LOG_ERR, "Unable to find a UTF-8 locale on this system; UI translations may not work."); - } + } + if (!$ok) { + common_log(LOG_ERR, "Unable to find a UTF-8 locale on this system; UI translations may not work."); } $locale_set = common_init_locale($language); } -- 2.39.2