diff options
Diffstat (limited to 'install')
-rw-r--r-- | install/ElggInstaller.php | 36 | ||||
-rw-r--r-- | install/languages/en.php | 21 |
2 files changed, 37 insertions, 20 deletions
diff --git a/install/ElggInstaller.php b/install/ElggInstaller.php index a73dfc96c..8b3a264d3 100644 --- a/install/ElggInstaller.php +++ b/install/ElggInstaller.php @@ -227,7 +227,7 @@ class ElggInstaller { break; } - system_message('Database has been installed.'); + system_message(elgg_echo('install:success:database')); $this->continueToNextStep('database'); } while (FALSE); // PHP doesn't support breaking out of if statements @@ -305,7 +305,7 @@ class ElggInstaller { break; } - system_message('Site settings have been saved.'); + system_message(elgg_echo('install:success:settings')); $this->continueToNextStep('settings'); @@ -363,7 +363,7 @@ class ElggInstaller { break; } - system_message('Admin account has been created.'); + system_message(elgg_echo('install:success:admin')); $this->continueToNextStep('admin'); @@ -1004,24 +1004,25 @@ class ElggInstaller { function checkDatabaseSettings($user, $password, $dbname, $host) { $mysql_dblink = mysql_connect($host, $user, $password, true); if ($mysql_dblink == FALSE) { - register_error('Unable to connect to the database with these settings.'); + register_error(elgg_echo('install:error:databasesettings')); return $FALSE; } $result = mysql_select_db($dbname, $mysql_dblink); // check MySQL version - must be 5.0 or > + $required_version = 5.0; $version = mysql_get_server_info(); $points = explode('.', $version); - if ($points[0] < 5) { - register_error("MySQL must be 5.0 or above. Your server is using $version."); + if ($points[0] < $required_version) { + register_error(sprintf(elgg_echo('install:error:oldmysql'), $version)); return FALSE; } mysql_close($mysql_dblink); if (!$result) { - register_error("Unable to use database $dbname"); + register_error(sprintf(elgg_echo('install:error:nodatabase'), $dbname)); } return $result; @@ -1039,7 +1040,7 @@ class ElggInstaller { $templateFile = "{$CONFIG->path}engine/settings.example.php"; $template = file_get_contents($templateFile); if (!$template) { - register_error('Unable to read engine/settings.example.php'); + register_error(elgg_echo('install:error:readsettingsphp')); return FALSE; } @@ -1050,7 +1051,7 @@ class ElggInstaller { $settingsFilename = "{$CONFIG->path}engine/settings.php"; $result = file_put_contents($settingsFilename, $template); if (!$result) { - register_error('Unable to write engine/settings.php'); + register_error(elgg_echo('install:error:writesettingphp')); return FALSE; } @@ -1066,12 +1067,13 @@ class ElggInstaller { global $CONFIG; if (!include_once("{$CONFIG->path}engine/settings.php")) { - register_error("Elgg could not load the settings file."); + register_error(elgg_echo('InstallationException:CannotLoadSettings')); return FALSE; } if (!include_once("{$CONFIG->path}engine/lib/database.php")) { - register_error("Elgg could not load the database library."); + $msg = sprintf(elgg_echo('InstallationException:MissingLibrary'), 'database.php'); + register_error($msg); return FALSE; } @@ -1119,20 +1121,22 @@ class ElggInstaller { foreach ($formVars as $field => $info) { if ($info['required'] == TRUE && !$submissionVars[$field]) { $name = elgg_echo("install:settings:label:$field"); - register_error("$name is required"); + register_error(sprintf(elgg_echo('install:error:requiredfield')), $name); return FALSE; } } // check that data root is writable if (!is_writable($submissionVars['dataroot'])) { - register_error("Your data directory {$submissionVars['dataroot']} is not writable by the web server."); + $msg = sprintf(elgg_echo('install:error:writedatadirectory'), $submissionVars['dataroot']); + register_error($msg); return FALSE; } // check that data root is not subdirectory of Elgg root if (stripos($submissionVars['dataroot'], $submissionVars['path']) !== FALSE) { - register_error("Your data directory {$submissionVars['dataroot']} must be outside of your install path for security."); + $msg = sprintf(elgg_echo('install:error:locationdatadirectory'), $submissionVars['dataroot']); + register_error($msg); return FALSE; } @@ -1171,7 +1175,7 @@ class ElggInstaller { $guid = $site->save(); if (!$guid) { - register_error("Unable to create the site."); + register_error(elgg_echo('install:error:createsite')); return FALSE; } @@ -1232,7 +1236,7 @@ class ElggInstaller { foreach ($formVars as $field => $info) { if ($info['required'] == TRUE && !$submissionVars[$field]) { $name = elgg_echo("install:admin:label:$field"); - register_error("$name is required"); + register_error(sprintf(elgg_echo('install:error:requiredfield'), $name)); return FALSE; } } diff --git a/install/languages/en.php b/install/languages/en.php index 93bd9e190..f4d9e5ce6 100644 --- a/install/languages/en.php +++ b/install/languages/en.php @@ -110,10 +110,23 @@ If you are ready to proceed, click the Next button.", 'install:admin:cannot_create' => 'Unable to create an admin account.', 'install:complete:instructions' => 'Your Elgg site is now ready to be used. Click the button below to be taken to your site.', - - - 'InstallationException:UnknownStep' => '%s is an unknown installation step.', - + 'install:complete:gotosite' => 'Go to site', + + 'InstallationException:UnknownStep' => '%s is an unknown installation step.', + + 'install:success:database' => 'Database has been installed.', + 'install:success:settings' => 'Site settings have been saved.', + 'install:success:admin' => 'Admin account has been created.', + + 'install:error:databasesettings' => 'Unable to connect to the database with these settings.', + 'install:error:oldmysql' => 'MySQL must be version 5.0 or above. Your server is using %s.', + 'install:error:nodatabase' => 'Unable to use database %s. It may not exist.', + 'install:error:readsettingsphp' => 'Unable to read engine/settings.example.php', + 'install:error:writesettingphp' => 'Unable to write engine/settings.php', + 'install:error:requiredfield' => '%s is required', + 'install:error:writedatadirectory' => 'Your data directory %s is not writable by the web server.', + 'install:error:locationdatadirectory' => 'Your data directory %s must be outside of your install path for security.', + 'install:error:createsite' => 'Unable to create the site.', ); add_translation("en", $english); |