summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/language.php6
-rw-r--r--lib/util.php10
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/language.php b/lib/language.php
index 1805707ad..6840148d2 100644
--- a/lib/language.php
+++ b/lib/language.php
@@ -213,16 +213,16 @@ function _mdomain($backtrace)
$plug = strpos($path, '/plugins/');
if ($plug === false) {
// We're not in a plugin; return default domain.
- return 'statusnet';
+ $final = 'statusnet';
} else {
$cut = $plug + 9;
$cut2 = strpos($path, '/', $cut);
if ($cut2) {
- $cached[$path] = substr($path, $cut, $cut2 - $cut);
+ $final = substr($path, $cut, $cut2 - $cut);
} else {
// We might be running directly from the plugins dir?
// If so, there's no place to store locale info.
- return 'statusnet';
+ $final = 'statusnet';
}
}
$cached[$path] = $final;
diff --git a/lib/util.php b/lib/util.php
index 2a90b56a9..9f62097d5 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);
}