From a6d8854d2af234d0613467f12b45f229e0431b35 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Fri, 8 Nov 2013 14:30:08 +0100 Subject: Make working en_US.UTF-8 locale a hard requirement --- lib/base.php | 8 +------- lib/private/util.php | 7 +++++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/base.php b/lib/base.php index 4f8d97ac95d..cf9230c367e 100644 --- a/lib/base.php +++ b/lib/base.php @@ -241,7 +241,7 @@ class OC { $minimizerCSS->clearCache(); $minimizerJS = new OC_Minimizer_JS(); $minimizerJS->clearCache(); - OC_Util::addscript('update'); + OC_Util::addScript('update'); $tmpl = new OC_Template('', 'update.admin', 'guest'); $tmpl->assign('version', OC_Util::getVersionString()); $tmpl->printPage(); @@ -564,12 +564,6 @@ class OC { } } - // write error into log if locale can't be set - if (OC_Util::isSetLocaleWorking() == false) { - OC_Log::write('core', - 'setting locale to en_US.UTF-8/en_US.UTF8 failed. Support is probably not installed on your system', - OC_Log::ERROR); - } if (OC_Config::getValue('installed', false) && !self::checkUpgrade(false)) { if (OC_Appconfig::getValue('core', 'backgroundjobs_mode', 'ajax') == 'ajax') { OC_Util::addScript('backgroundjobs'); diff --git a/lib/private/util.php b/lib/private/util.php index 176eb4bc369..f285f83cf5c 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -353,6 +353,13 @@ class OC_Util { $errors = array_merge($errors, self::checkDataDirectoryPermissions($CONFIG_DATADIRECTORY)); } + if(!OC_Util::isSetLocaleWorking()) { + $errors[] = array( + 'error' => 'Setting locale to en_US.UTF-8/en_US.UTF8 failed', + 'hint' => 'Please install the locale on your system and restart your webserver.' + ); + } + $moduleHint = "Please ask your server administrator to install the module."; // check if all required php modules are present if(!class_exists('ZipArchive')) { -- cgit v1.2.3 From bcf56b04078f4a8b9381f110c379b0d33d0db48c Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Fri, 15 Nov 2013 13:06:35 +0100 Subject: Use \Patchwork\Utf8\Bootup::initLocale --- lib/private/util.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/util.php b/lib/private/util.php index f285f83cf5c..d44ae09ecbc 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -854,8 +854,8 @@ class OC_Util { return true; } - $result = setlocale(LC_ALL, 'en_US.UTF-8', 'en_US.UTF8'); - if($result == false) { + \Patchwork\Utf8\Bootup::initLocale(); + if ('' === basename('§')) { return false; } return true; -- cgit v1.2.3 From 368342a085cd33d6f6ea9fa037b9695c82571992 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Fri, 15 Nov 2013 14:46:00 +0100 Subject: Update error messages --- lib/private/util.php | 2 +- settings/admin.php | 2 +- settings/templates/admin.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/private/util.php b/lib/private/util.php index d44ae09ecbc..115deaceb56 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -355,7 +355,7 @@ class OC_Util { if(!OC_Util::isSetLocaleWorking()) { $errors[] = array( - 'error' => 'Setting locale to en_US.UTF-8/en_US.UTF8 failed', + 'error' => 'Setting locale to en_US.UTF-8/fr_FR.UTF-8/es_ES.UTF-8/de_DE.UTF-8/ru_RU.UTF-8/pt_BR.UTF-8/it_IT.UTF-8/ja_JP.UTF-8/zh_CN.UTF-8 failed', 'hint' => 'Please install the locale on your system and restart your webserver.' ); } diff --git a/settings/admin.php b/settings/admin.php index 120f15bec19..0d3868afea8 100755 --- a/settings/admin.php +++ b/settings/admin.php @@ -25,7 +25,7 @@ $tmpl->assign('entries', $entries); $tmpl->assign('entriesremain', $entriesremain); $tmpl->assign('htaccessworking', $htaccessworking); $tmpl->assign('internetconnectionworking', OC_Util::isInternetConnectionEnabled() ? OC_Util::isInternetConnectionWorking() : false); -$tmpl->assign('islocaleworking', OC_Util::isSetLocaleWorking()); +$tmpl->assign('isLocaleWorking', OC_Util::isSetLocaleWorking()); $tmpl->assign('isWebDavWorking', OC_Util::isWebDAVWorking()); $tmpl->assign('has_fileinfo', OC_Util::fileInfoLoaded()); $tmpl->assign('backgroundjobs_mode', OC_Appconfig::getValue('core', 'backgroundjobs_mode', 'ajax')); diff --git a/settings/templates/admin.php b/settings/templates/admin.php index 5413b700936..66bcfa21c3f 100644 --- a/settings/templates/admin.php +++ b/settings/templates/admin.php @@ -59,14 +59,14 @@ if (!$_['has_fileinfo']) { } // is locale working ? -if (!$_['islocaleworking']) { +if (!$_['isLocaleWorking']) { ?>

t('Locale not working'));?>

t('System locale can\'t be set to %s. This means that there might be problems with certain characters in file names. We strongly suggest to install the required packages on your system to support %s.', array($locales, $locales))); ?> -- cgit v1.2.3 From cd1cf58875ffacf427420d6dbe94d8718e4075e0 Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Thu, 21 Nov 2013 14:44:25 +0100 Subject: Fixing the warning notifications --- lib/private/util.php | 2 +- settings/templates/admin.php | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/private/util.php b/lib/private/util.php index 115deaceb56..695d641b5b1 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -356,7 +356,7 @@ class OC_Util { if(!OC_Util::isSetLocaleWorking()) { $errors[] = array( 'error' => 'Setting locale to en_US.UTF-8/fr_FR.UTF-8/es_ES.UTF-8/de_DE.UTF-8/ru_RU.UTF-8/pt_BR.UTF-8/it_IT.UTF-8/ja_JP.UTF-8/zh_CN.UTF-8 failed', - 'hint' => 'Please install the locale on your system and restart your webserver.' + 'hint' => 'Please install one of theses locales on your system and restart your webserver.' ); } diff --git a/settings/templates/admin.php b/settings/templates/admin.php index 66bcfa21c3f..f655a14be87 100644 --- a/settings/templates/admin.php +++ b/settings/templates/admin.php @@ -67,7 +67,15 @@ if (!$_['isLocaleWorking']) { t('System locale can\'t be set to %s. This means that there might be problems with certain characters in file names. We strongly suggest to install the required packages on your system to support %s.', array($locales, $locales))); + p($l->t('System locale can not be set to a one which supports UTF-8.')); + ?> +
+ t('This means that there might be problems with certain characters in file names.')); + ?> +
+ t('We strongly suggest to install the required packages on your system to support one of the following locales: %s.', array($locales))); ?>
-- cgit v1.2.3