Skip to content
Snippets Groups Projects
Commit 4a2f9636 authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #5773 from owncloud/fix-2152-master

Make working en_US.UTF-8 locale a hard requirement
parents 5d9731ce cd1cf588
Branches
No related tags found
No related merge requests found
...@@ -241,7 +241,7 @@ class OC { ...@@ -241,7 +241,7 @@ class OC {
$minimizerCSS->clearCache(); $minimizerCSS->clearCache();
$minimizerJS = new OC_Minimizer_JS(); $minimizerJS = new OC_Minimizer_JS();
$minimizerJS->clearCache(); $minimizerJS->clearCache();
OC_Util::addscript('update'); OC_Util::addScript('update');
$tmpl = new OC_Template('', 'update.admin', 'guest'); $tmpl = new OC_Template('', 'update.admin', 'guest');
$tmpl->assign('version', OC_Util::getVersionString()); $tmpl->assign('version', OC_Util::getVersionString());
$tmpl->printPage(); $tmpl->printPage();
...@@ -559,12 +559,6 @@ class OC { ...@@ -559,12 +559,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_Config::getValue('installed', false) && !self::checkUpgrade(false)) {
if (OC_Appconfig::getValue('core', 'backgroundjobs_mode', 'ajax') == 'ajax') { if (OC_Appconfig::getValue('core', 'backgroundjobs_mode', 'ajax') == 'ajax') {
OC_Util::addScript('backgroundjobs'); OC_Util::addScript('backgroundjobs');
......
...@@ -358,6 +358,13 @@ class OC_Util { ...@@ -358,6 +358,13 @@ class OC_Util {
$errors = array_merge($errors, self::checkDataDirectoryPermissions($CONFIG_DATADIRECTORY)); $errors = array_merge($errors, self::checkDataDirectoryPermissions($CONFIG_DATADIRECTORY));
} }
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 one of theses locales on your system and restart your webserver.'
);
}
$moduleHint = "Please ask your server administrator to install the module."; $moduleHint = "Please ask your server administrator to install the module.";
// check if all required php modules are present // check if all required php modules are present
if(!class_exists('ZipArchive')) { if(!class_exists('ZipArchive')) {
...@@ -852,8 +859,8 @@ class OC_Util { ...@@ -852,8 +859,8 @@ class OC_Util {
return true; return true;
} }
$result = setlocale(LC_ALL, 'en_US.UTF-8', 'en_US.UTF8'); \Patchwork\Utf8\Bootup::initLocale();
if($result == false) { if ('' === basename('§')) {
return false; return false;
} }
return true; return true;
......
...@@ -25,7 +25,7 @@ $tmpl->assign('entries', $entries); ...@@ -25,7 +25,7 @@ $tmpl->assign('entries', $entries);
$tmpl->assign('entriesremain', $entriesremain); $tmpl->assign('entriesremain', $entriesremain);
$tmpl->assign('htaccessworking', $htaccessworking); $tmpl->assign('htaccessworking', $htaccessworking);
$tmpl->assign('internetconnectionworking', OC_Util::isInternetConnectionEnabled() ? OC_Util::isInternetConnectionWorking() : false); $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('isWebDavWorking', OC_Util::isWebDAVWorking());
$tmpl->assign('has_fileinfo', OC_Util::fileInfoLoaded()); $tmpl->assign('has_fileinfo', OC_Util::fileInfoLoaded());
$tmpl->assign('backgroundjobs_mode', OC_Appconfig::getValue('core', 'backgroundjobs_mode', 'ajax')); $tmpl->assign('backgroundjobs_mode', OC_Appconfig::getValue('core', 'backgroundjobs_mode', 'ajax'));
......
...@@ -59,15 +59,23 @@ if (!$_['has_fileinfo']) { ...@@ -59,15 +59,23 @@ if (!$_['has_fileinfo']) {
} }
// is locale working ? // is locale working ?
if (!$_['islocaleworking']) { if (!$_['isLocaleWorking']) {
?> ?>
<fieldset class="personalblock"> <fieldset class="personalblock">
<h2><?php p($l->t('Locale not working'));?></h2> <h2><?php p($l->t('Locale not working'));?></h2>
<span class="connectionwarning"> <span class="connectionwarning">
<?php <?php
$locales = 'en_US.UTF-8/en_US.UTF8'; $locales = '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';
p($l->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.'));
?>
<br>
<?php
p($l->t('This means that there might be problems with certain characters in file names.'));
?>
<br>
<?php
p($l->t('We strongly suggest to install the required packages on your system to support one of the following locales: %s.', array($locales)));
?> ?>
</span> </span>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment