]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
pulled more language strings out of installer into language file
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 7 Oct 2010 11:35:26 +0000 (11:35 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 7 Oct 2010 11:35:26 +0000 (11:35 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7029 36083f99-b078-4883-b0ff-0f9b5a30f544

install/ElggInstaller.php
install/languages/en.php
views/installation/install/pages/complete.php

index a73dfc96c109b8dc9b35daea5c9576ad87222cf5..8b3a264d300117b72a86c964559895af67e22912 100644 (file)
@@ -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;
                        }
                }
index 93bd9e190b7186d806ab0171123ec1730d1252e2..f4d9e5ce64a9a9e728ef3f29c9257f4dee748bc4 100644 (file)
@@ -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);
index 60838a6308d065d08732af82b3b3cbe704cd9a84..ec50fe503ecdaecb2a73eb33fe856651423cec05 100644 (file)
@@ -9,6 +9,7 @@ echo autop(elgg_echo('install:complete:instructions'));
 
 <div class="install_nav">
 <?php
-       echo "<a href=\"{$vars['url']}index.php\">Go to site</a>";
+       $text = elgg_echo('install:complete:gotosite');
+       echo "<a href=\"{$vars['url']}index.php\">$text</a>";
 ?>
 </div>