aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-06 10:55:27 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-06 10:55:27 +0000
commita907805911bc678c6d3f5e0fb71c7189866b5e06 (patch)
treeceb0feb2cf00fb2289bad0e884f941ab429c64d9
parentd52ced80bcd6281b3bd22b5ee83edb818c2d72e2 (diff)
downloadelgg-a907805911bc678c6d3f5e0fb71c7189866b5e06.tar.gz
elgg-a907805911bc678c6d3f5e0fb71c7189866b5e06.tar.bz2
Pulled installation language strings out of core language file into installer
git-svn-id: http://code.elgg.org/elgg/trunk@7019 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--install/ElggInstaller.php26
-rw-r--r--install/languages/en.php122
-rw-r--r--languages/en.php154
-rw-r--r--views/installation/install/forms/template.php4
-rw-r--r--views/installation/page_shells/default.php5
5 files changed, 145 insertions, 166 deletions
diff --git a/install/ElggInstaller.php b/install/ElggInstaller.php
index cf1a75258..a73dfc96c 100644
--- a/install/ElggInstaller.php
+++ b/install/ElggInstaller.php
@@ -42,6 +42,8 @@ class ElggInstaller {
set_error_handler('__elgg_php_error_handler');
set_exception_handler('__elgg_php_exception_handler');
+
+ register_translations(dirname(__FILE__) . '/languages/', TRUE);
}
/**
@@ -55,7 +57,8 @@ class ElggInstaller {
$this->runModRewriteTest();
if (!in_array($step, $this->getSteps())) {
- throw new InstallationException("$step is an unknown installation step.");
+ $msg = sprintf(elgg_echo('InstallationException:UnknownStep'), $step);
+ throw new InstallationException($msg);
}
$this->setInstallStatus();
@@ -452,7 +455,8 @@ class ElggInstaller {
}
if (!include_once("{$CONFIG->path}engine/lib/database.php")) {
- throw new InstallationException("Could not load database.php");
+ $msg = sprintf(elgg_echo('InstallationException:MissingLibrary'), 'database.php');
+ throw new InstallationException($msg);
}
// check that the config table has been created
@@ -604,7 +608,8 @@ class ElggInstaller {
foreach ($lib_files as $file) {
$path = $lib_dir . $file;
if (!include_once($path)) {
- throw new InstallationException("Could not load {$file}");
+ $msg = sprintf(elgg_echo('InstallationException:MissingLibrary'), $file);
+ throw new InstallationException($msg);
}
}
@@ -655,7 +660,8 @@ class ElggInstaller {
global $CONFIG;
if (!include_once("{$CONFIG->path}engine/settings.php")) {
- throw new InstallationException("Elgg could not load the settings file. It does not exist or there is a permissions issue.");
+ $msg = elgg_echo('InstallationException:CannotLoadSettings');
+ throw new InstallationException($msg);
}
}
@@ -972,7 +978,7 @@ class ElggInstaller {
foreach ($formVars as $field => $info) {
if ($info['required'] == TRUE && !$submissionVars[$field]) {
- $name = elgg_echo("installation:database:label:$field");
+ $name = elgg_echo("install:database:label:$field");
register_error("$name is required");
return FALSE;
}
@@ -1112,7 +1118,7 @@ class ElggInstaller {
foreach ($formVars as $field => $info) {
if ($info['required'] == TRUE && !$submissionVars[$field]) {
- $name = elgg_echo("installation:settings:label:$field");
+ $name = elgg_echo("install:settings:label:$field");
register_error("$name is required");
return FALSE;
}
@@ -1225,19 +1231,19 @@ class ElggInstaller {
foreach ($formVars as $field => $info) {
if ($info['required'] == TRUE && !$submissionVars[$field]) {
- $name = elgg_echo("installation:admin:label:$field");
+ $name = elgg_echo("install:admin:label:$field");
register_error("$name is required");
return FALSE;
}
}
if ($submissionVars['password1'] !== $submissionVars['password2']) {
- register_error(elgg_echo('installation:admin:password:mismatch'));
+ register_error(elgg_echo('install:admin:password:mismatch'));
return FALSE;
}
if (trim($submissionVars['password1']) == "") {
- register_error(elgg_echo('installation:admin:password:empty'));
+ register_error(elgg_echo('install:admin:password:empty'));
return FALSE;
}
@@ -1261,7 +1267,7 @@ class ElggInstaller {
);
if (!$guid) {
- register_error(elgg_echo('installation:admin:cannot_create'));
+ register_error(elgg_echo('install:admin:cannot_create'));
return FALSE;
}
diff --git a/install/languages/en.php b/install/languages/en.php
new file mode 100644
index 000000000..aadb89f0d
--- /dev/null
+++ b/install/languages/en.php
@@ -0,0 +1,122 @@
+<?php
+/**
+ * Installer English Language
+ *
+ * @package ElggLanguage
+ * @subpackage Installer
+ */
+
+$english = array(
+ 'install:title' => 'Elgg Install',
+ 'install:welcome' => 'Welcome',
+ 'install:requirements' => 'Requirements check',
+ 'install:database' => 'Database installation',
+ 'install:settings' => 'Configure site',
+ 'install:admin' => 'Create admin account',
+ 'install:complete' => 'Finished',
+
+ 'install:welcome:instructions' => "Installing Elgg has 6 simple steps and reading this welcome is the first one!
+
+If you haven't already, read through the installation instructions included with Elgg (or click the instructions link at the bottom of the page).
+
+If you are ready to proceed, click the Next button.",
+ 'install:requirements:instructions:success' => "Your server passed the requirement checks.",
+ 'install:requirements:instructions:failure' => "Your server failed the requirements check. After you have fixed the below issues, refresh this page.",
+ 'install:requirements:instructions:warning' => "Your server passed the requirements check, but there is at least one warning. We recommend that you check the install troubleshooting page for more details.",
+
+ 'install:require:php' => 'PHP',
+ 'install:require:htaccess' => 'Web server',
+ 'install:require:engine' => 'Settings file',
+ 'install:require:database' => 'Database',
+
+ 'install:check:root' => 'Your web server does not have permission to create an .htaccess file in the root directory of Elgg. You have two choices:
+
+ 1. Change the permissions on the root directory
+
+ 2. Copy the file htaccess_dist to .htaccess',
+
+ 'install:check:php:version' => 'Elgg requires PHP %s or above. This server is using version %s.',
+ 'install:check:php:extension' => 'Elgg requires the PHP extension %s.',
+ 'install:check:php:extension:recommend' => 'It is recommended that the PHP extension %s is installed.',
+ 'install:check:php:open_basedir' => 'The open_basedir PHP directive may prevent Elgg from saving files to its data directory.',
+ 'install:check:php:safe_mode' => 'Running PHP in safe mode is not recommened and may cause problems with Elgg.',
+
+ 'install:check:htaccess_exists' => 'There is an .htaccess file in the root directory of Elgg. Please remove it.',
+ 'install:check:htaccess_fail' => 'Unable to create an .htaccess file in the root directory of Elgg. You will need to copy htaccess_dist to .htaccess',
+ 'install:check:rewrite:success' => 'The test of the rewrite rules was successful.',
+ 'install:check:rewrite:fail' => 'The URL rewrite test failed.',
+ 'install:check:rewrite:unknown' => 'The result rewrite test could not be determined. Continue at your own risk.',
+
+ 'install:check:enginedir' => 'Your web server does not have permission to create the settings.php file in the engine directory. You have two choices:
+
+ 1. Change the permissions on the engine directory
+
+ 2. Copy the file settings.example.php to settings.php and follow the instructions in it for setting your database parameters.',
+
+ 'install:check:php:success' => "Your server's PHP satisfies all of Elgg's requirements.",
+ 'install:check:database' => 'The database requirements are checked when Elgg loads its database.',
+
+ 'install:database:instructions' => "If you haven't already created a database for Elgg, do that now. Then fill in the values below to initialize the Elgg database.",
+ 'install:database:error' => 'There was an error creating the Elgg database and installation cannot continue. Review the message above and correct any problems. If you need more help, visit the Install Troubleshooting link below, or post to the Elgg community forums.',
+
+ 'install:database:label:dbuser' => 'Database Username',
+ 'install:database:label:dbpassword' => 'Database Password',
+ 'install:database:label:dbname' => 'Database Name',
+ 'install:database:label:dbhost' => 'Database Host',
+ 'install:database:label:dbprefix' => 'Database Table Prefix',
+
+ 'install:database:help:dbuser' => 'User that has full priviledges to the MySQL database that you created for Elgg',
+ 'install:database:help:dbpassword' => 'Password for the above database user account',
+ 'install:database:help:dbname' => 'Name of the Elgg database',
+ 'install:database:help:dbhost' => 'Hostname of the MySQL server (usually localhost)',
+ 'install:database:help:dbprefix' => "The prefix given to all of Elgg's tables (usually elgg_)",
+
+ 'install:dbuser' => '',
+
+ 'install:settings:instructions' => "We need some information about the site as we configure Elgg. If you haven't created a data directory for Elgg, please do so before completing this step.",
+
+ 'install:settings:label:sitename' => 'Site Name',
+ 'install:settings:label:siteemail' => 'Site Email Address',
+ 'install:settings:label:wwwroot' => 'Site URL',
+ 'install:settings:label:path' => 'Elgg Install Directory',
+ 'install:settings:label:dataroot' => 'Data Directory',
+ 'install:settings:label:language' => 'Site Language',
+ 'install:settings:label:siteaccess' => 'Default Site Access',
+
+ 'install:settings:help:sitename' => 'The name of your new Elgg site',
+ 'install:settings:help:siteemail' => 'Email address used by Elgg for communication with users',
+ 'install:settings:help:wwwroot' => 'The address of the site (Elgg usually guesses this correctly)',
+ 'install:settings:help:path' => 'The directory where you put the Elgg code (Elgg usually guesses this correctly)',
+ 'install:settings:help:dataroot' => 'The directory that you created for Elgg to save files (the permissions on this directory are checked when you click Next)',
+ 'install:settings:help:language' => 'The default language for the site',
+ 'install:settings:help:siteaccess' => 'The default access level for new user created content',
+
+ 'install:admin:instructions' => "It is now time to create an administrator's account.",
+
+ 'install:admin:label:displayname' => 'Display Name',
+ 'install:admin:label:email' => 'Email Address',
+ 'install:admin:label:username' => 'Username',
+ 'install:admin:label:password1' => 'Password',
+ 'install:admin:label:password2' => 'Password Again',
+
+ 'install:admin:help:displayname' => 'The name that is displayed on the site for this account',
+ 'install:admin:help:email' => '',
+ 'install:admin:help:username' => 'Account username used for logging in',
+ 'install:admin:help:password1' => 'Account password must be at least x characters long',
+ 'install:admin:help:password2' => 'Retype password to confirm',
+
+ 'install:admin:password:mismatch' => 'Password must match.',
+ 'install:admin:password:empty' => 'Password cannot be empty.',
+ '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.',
+ 'InstallationException:MissingLibrary' => 'Could not load %s',
+ 'InstallationException:CannotLoadSettings' => 'Elgg could not load the settings file. It does not exist or there is a file permissions issue.',
+
+
+);
+
+add_translation("en", $english);
diff --git a/languages/en.php b/languages/en.php
index e4f53876f..77ff00a7d 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -38,8 +38,6 @@ $english = array(
*/
'exception:title' => "Welcome to Elgg.",
- 'InstallationException:CantCreateSite' => "Unable to create a default ElggSite with credentials Name:%s, Url: %s",
-
'actionundefined' => "The requested action (%s) was not defined in the system.",
'actionloggedout' => "Sorry, you cannot perform this action while logged out.",
'actionunauthorized' => 'You are unauthorized to perform this action',
@@ -164,15 +162,6 @@ $english = array(
'PluginException:NoPluginName' => "The plugin name could not be found",
- 'ConfigurationException:BadDatabaseVersion' => "The database backend you have installed doesn't meet the basic requirements to run Elgg. Please consult your documentation.",
- 'ConfigurationException:BadPHPVersion' => "You need at least PHP version 5.2 to run Elgg.",
- 'configurationwarning:phpversion' => "Elgg requires at least PHP version 5.2, you can install it on 5.1.6 but some features may not work. Use at your own risk.",
-
-
- 'InstallationException:DatarootNotWritable' => "Your data directory %s is not writable.",
- 'InstallationException:DatarootUnderPath' => "Your data directory %s must be outside of your install path.",
- 'InstallationException:DatarootBlank' => "You have not specified a data directory.",
-
'SecurityException:authenticationfailed' => "User could not be authenticated",
'CronException:unknownperiod' => '%s is not a recognised period.',
@@ -726,42 +715,9 @@ Once you have logged in, we highly recommend that you change your password.
/**
- * Installation and system settings
+ * System settings
*/
- 'installation:error:htaccess' => "Elgg requires a file called .htaccess to be set in the root directory of its installation. We tried to create it for you, but Elgg doesn't have permission to write to that directory.
-
-Creating this is easy. Copy the contents of the textbox below into a text editor and save it as .htaccess
-
-",
- 'installation:error:settings' => "Elgg couldn't find its settings file. Most of Elgg's settings will be handled for you, but we need you to supply your database details. To do this:
-
-1. Rename engine/settings.example.php to settings.php in your Elgg installation.
-
-2. Open it with a text editor and enter your MySQL database details. If you don't know these, ask your system administrator or technical support for help.
-
-Alternatively, you can enter your database settings below and we will try and do this for you...",
-
- 'installation:error:db:title' => "Database settings error",
- 'installation:error:db:text' => "Check your database settings again as Elgg could not connect and access the database.",
- 'installation:error:configuration' => "Once you've corrected any configuration issues, press reload to try again.",
-
- 'installation' => "Installation",
- 'installation:success' => "Elgg's database was installed successfully.",
- 'installation:configuration:success' => "Your initial configuration settings have been saved. Now register your initial user; this will be your first system administrator.",
-
- 'installation:settings' => "System settings",
- 'installation:settings:description' => "Now that the Elgg database has been successfully installed, you need to enter a couple of pieces of information to get your site fully up and running. We've tried to guess where we could, but <b>you should check these details.</b>",
-
- 'installation:settings:dbwizard:prompt' => "Enter your database settings below and hit save:",
- 'installation:settings:dbwizard:label:user' => "Database user",
- 'installation:settings:dbwizard:label:pass' => "Database password",
- 'installation:settings:dbwizard:label:dbname' => "Elgg database",
- 'installation:settings:dbwizard:label:host' => "Database hostname (usually 'localhost')",
- 'installation:settings:dbwizard:label:prefix' => "Database table prefix (usually 'elgg_')",
-
- 'installation:settings:dbwizard:savefail' => "We were unable to save the new settings.php. Please save the following file as engine/settings.php using a text editor.",
-
'installation:sitename' => "The name of your site:",
'installation:sitedescription' => "Short description of your site (optional):",
'installation:wwwroot' => "The site URL:",
@@ -810,7 +766,6 @@ Alternatively, you can enter your database settings below and we will try and do
'welcome' => "Welcome",
'welcome:user' => 'Welcome %s',
- 'welcome_message' => "Welcome to this Elgg installation.",
/**
* Emails
@@ -934,113 +889,6 @@ You cannot reply to this email.",
'actiongatekeeper:timeerror' => 'The page you were using has expired. Please refresh and try again.',
'actiongatekeeper:pluginprevents' => 'A extension has prevented this form from being submitted.',
-/**
- * Installation
- * @todo - move to separate language file for install
- */
- 'install:welcome' => 'Welcome',
- 'install:requirements' => 'Requirements check',
- 'install:database' => 'Database installation',
- 'install:settings' => 'Configure site',
- 'install:admin' => 'Create admin account',
- 'install:complete' => 'Finished',
-
- 'install:welcome:instructions' => "Installing Elgg has 6 simple steps and reading this welcome is the first one!
-
-If you haven't already, read through the installation instructions included with Elgg (or click the instructions link at the bottom of the page).
-
-If you are ready to proceed, click the Next button.",
- 'install:requirements:instructions:success' => "Your server passed the requirement checks.",
- 'install:requirements:instructions:failure' => "Your server failed the requirements check. After you have fixed the below issues, refresh this page.",
- 'install:requirements:instructions:warning' => "Your server passed the requirements check, but there is at least one warning. We recommend that you check the install troubleshooting page for more details.",
-
- 'install:require:php' => 'PHP',
- 'install:require:htaccess' => 'Web server',
- 'install:require:engine' => 'Settings file',
- 'install:require:database' => 'Database',
-
- 'install:check:root' => 'Your web server does not have permission to create an .htaccess file in the root directory of Elgg. You have two choices:
-
- 1. Change the permissions on the root directory
-
- 2. Copy the file htaccess_dist to .htaccess',
-
- 'install:check:php:version' => 'Elgg requires PHP %s or above. This server is using version %s.',
- 'install:check:php:extension' => 'Elgg requires the PHP extension %s.',
- 'install:check:php:extension:recommend' => 'It is recommended that the PHP extension %s is installed.',
- 'install:check:php:open_basedir' => 'The open_basedir PHP directive may prevent Elgg from saving files to its data directory.',
- 'install:check:php:safe_mode' => 'Running PHP in safe mode is not recommened and may cause problems with Elgg.',
-
- 'install:check:htaccess_exists' => 'There is an .htaccess file in the root directory of Elgg. Please remove it.',
- 'install:check:htaccess_fail' => 'Unable to create an .htaccess file in the root directory of Elgg. You will need to copy htaccess_dist to .htaccess',
- 'install:check:rewrite:success' => 'The test of the rewrite rules was successful.',
- 'install:check:rewrite:fail' => 'The URL rewrite test failed.',
- 'install:check:rewrite:unknown' => 'The result rewrite test could not be determined. Continue at your own risk.',
-
- 'install:check:enginedir' => 'Your web server does not have permission to create the settings.php file in the engine directory. You have two choices:
-
- 1. Change the permissions on the engine directory
-
- 2. Copy the file settings.example.php to settings.php and follow the instructions in it for setting your database parameters.',
-
- 'install:check:php:success' => "Your server's PHP satisfies all of Elgg's requirements.",
- 'install:check:database' => 'The database requirements are checked when Elgg loads its database.',
-
- 'install:database:instructions' => "If you haven't already created a database for Elgg, do that now. Then fill in the values below to initialize the Elgg database.",
- 'install:database:error' => 'There was an error creating the Elgg database and installation cannot continue. Review the message above and correct any problems. If you need more help, visit the Install Troubleshooting link below, or post to the Elgg community forums.',
-
- 'installation:database:label:dbuser' => 'Database Username',
- 'installation:database:label:dbpassword' => 'Database Password',
- 'installation:database:label:dbname' => 'Database Name',
- 'installation:database:label:dbhost' => 'Database Host',
- 'installation:database:label:dbprefix' => 'Database Table Prefix',
-
- 'installation:database:help:dbuser' => 'User that has full priviledges to the MySQL database that you created for Elgg',
- 'installation:database:help:dbpassword' => 'Password for the above database user account',
- 'installation:database:help:dbname' => 'Name of the Elgg database',
- 'installation:database:help:dbhost' => 'Hostname of the MySQL server (usually localhost)',
- 'installation:database:help:dbprefix' => "The prefix given to all of Elgg's tables (usually elgg_)",
-
- 'install:dbuser' => '',
-
- 'install:settings:instructions' => "We need some information about the site as we configure Elgg. If you haven't created a data directory for Elgg, please do so before completing this step.",
-
- 'installation:settings:label:sitename' => 'Site Name',
- 'installation:settings:label:siteemail' => 'Site Email Address',
- 'installation:settings:label:wwwroot' => 'Site URL',
- 'installation:settings:label:path' => 'Elgg Install Directory',
- 'installation:settings:label:dataroot' => 'Data Directory',
- 'installation:settings:label:language' => 'Site Language',
- 'installation:settings:label:siteaccess' => 'Default Site Access',
-
- 'installation:settings:help:sitename' => 'The name of your new Elgg site',
- 'installation:settings:help:siteemail' => 'Email address used by Elgg for communication with users',
- 'installation:settings:help:wwwroot' => 'The address of the site (Elgg usually guesses this correctly)',
- 'installation:settings:help:path' => 'The directory where you put the Elgg code (Elgg usually guesses this correctly)',
- 'installation:settings:help:dataroot' => 'The directory that you created for Elgg to save files (the permissions on this directory are checked when you click Next)',
- 'installation:settings:help:language' => 'The default language for the site',
- 'installation:settings:help:siteaccess' => 'The default access level for new user created content',
-
- 'install:admin:instructions' => "It is now time to create an administrator's account.",
-
- 'installation:admin:label:displayname' => 'Display Name',
- 'installation:admin:label:email' => 'Email Address',
- 'installation:admin:label:username' => 'Username',
- 'installation:admin:label:password1' => 'Password',
- 'installation:admin:label:password2' => 'Password Again',
-
- 'installation:admin:help:displayname' => 'The name that is displayed on the site for this account',
- 'installation:admin:help:email' => '',
- 'installation:admin:help:username' => 'Account username used for logging in',
- 'installation:admin:help:password1' => 'Account password must be at least x characters long',
- 'installation:admin:help:password2' => 'Retype password to confirm',
-
- 'installation:admin:password:mismatch' => 'Password must match.',
- 'installation:admin:password:empty' => 'Password cannot be empty.',
- 'installation: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.',
-
/**
* Word blacklists
diff --git a/views/installation/install/forms/template.php b/views/installation/install/forms/template.php
index a2d93f42e..98cdcadab 100644
--- a/views/installation/install/forms/template.php
+++ b/views/installation/install/forms/template.php
@@ -11,8 +11,8 @@ $type = $vars['type'];
$form_body = '';
foreach ($variables as $field => $params) {
- $label = elgg_echo("installation:$type:label:$field");
- $help = elgg_echo("installation:$type:help:$field");
+ $label = elgg_echo("install:$type:label:$field");
+ $help = elgg_echo("install:$type:help:$field");
$params['internalname'] = $field;
$form_body .= '<p>';
diff --git a/views/installation/page_shells/default.php b/views/installation/page_shells/default.php
index b023197fa..e19f90390 100644
--- a/views/installation/page_shells/default.php
+++ b/views/installation/page_shells/default.php
@@ -12,6 +12,9 @@
* @uses $vars['sysmessages'] Array of system status messages
*/
+$title = elgg_echo('install:title');
+$title .= " : {$vars['title']}";
+
// we won't trust server configuration but specify utf-8
header('Content-type: text/html; charset=utf-8');
@@ -24,7 +27,7 @@ header('Expires: Fri, 05 Feb 1982 00:00:00 -0500', TRUE);
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
- <title>Elgg Install : <?php echo $vars['title']; ?></title>
+ <title><?php echo $title; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="SHORTCUT ICON" href="<?php echo $vars['url']; ?>_graphics/favicon.ico" />
<link rel="stylesheet" href="<?php echo $vars['url']; ?>install/install.css" type="text/css" />