summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2012-12-19 08:53:43 -0800
committerFrank Karlitschek <frank@owncloud.org>2012-12-19 08:53:43 -0800
commitb162e72f94b253a2e68547c8321ebb2d81dae3bc (patch)
treee7425be61d20a8701e591afd1baf16d58d033c3c /lib
parentd7fbe47583c279d6d4162c6155ce4adbebe85be2 (diff)
parent196f1c3786ca009b3180e8ca11d0bf0258f5be92 (diff)
downloadnextcloud-server-b162e72f94b253a2e68547c8321ebb2d81dae3bc.tar.gz
nextcloud-server-b162e72f94b253a2e68547c8321ebb2d81dae3bc.zip
Merge pull request #961 from owncloud/check_locale
add a check and a warning if setlocale is working
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php5
-rwxr-xr-xlib/util.php12
2 files changed, 17 insertions, 0 deletions
diff --git a/lib/base.php b/lib/base.php
index 0b75f6f085e..9cdadbb7991 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -474,6 +474,11 @@ class OC{
exit;
}
}
+
+ // write error into log if locale can't be set
+ if(OC_Util::issetlocaleworking()==false) {
+ OC_Log::write('core', 'setting locate to en_US.UTF-8 failed. Support is probably not installed on your system', OC_Log::ERROR);
+ }
}
/**
diff --git a/lib/util.php b/lib/util.php
index 3e59847f538..4d69f3d86db 100755
--- a/lib/util.php
+++ b/lib/util.php
@@ -554,6 +554,18 @@ class OC_Util {
/**
+ * Check if the setlocal call doesn't work. This can happen if the right local packages are not available on the server.
+ */
+ public static function issetlocaleworking() {
+ $result=setlocale(LC_ALL, 'en_US.UTF-8');
+ if($result==false) {
+ return(false);
+ }else{
+ return(true);
+ }
+ }
+
+ /**
* Check if the ownCloud server can connect to the internet
*/
public static function isinternetconnectionworking() {