drupal_set_message(t('The language %language has been created and can now be used. More information is available on the <a href="@locale-help">help screen</a>.',array('%language'=>t($form_values['name']),'@locale-help'=>url('admin/help/locale'))));
drupal_set_message(t('The language %language has been created and can now be used. More information is available on the <a href="@locale-help">help screen</a>.',array('%language'=>t($predefined[$langcode][0]),'@locale-help'=>url('admin/help/locale'))));
db_query("INSERT INTO {locales_target} (lid, language, translation) VALUES (%d,'%s', '')",$string->lid,$langcode);
}
// Set message depending on the verbosity required.
if($verbose){
drupal_set_message(t('The language %language has been created and can now be used. More information is available on the <a href="@locale-help">help screen</a>.',array('%language'=>t($name),'@locale-help'=>url('admin/help/locale'))));
}
else{
drupal_set_message(t('The language %language has been created.',array('%language'=>t($name))));
@@ -492,8 +492,26 @@ function install_select_locale($profilename) {
// Find all available locales.
$locales=install_find_locales($profilename);
// Don't need to choose locale if only one (English) is available.
if(sizeof($locales)==1){
// If only the built-in (English) language is available,
// and we are using the default profile, inform the user
// that the installer can be localized. Otherwise we assume
// the user know what he is doing.
if(count($locales)==1){
if($profilename=='default'){
drupal_maintenance_theme();
install_task_list('profile-select');
drupal_set_title(st('Localization of the Drupal installer'));
$output='<p>'.st('Drupal is capable of being installed in any language from the start, not only English. A language pack might be available in your language already. To be able to install Drupal and use it in your language from the start, follow these steps:').'</p>';
$output.='<ul><li>'.st('Check whether <a href="@translations" target="_blank">a translation of this Drupal version</a> is available in your language.',array('@translations'=>'http://drupal.org/project/Translations')).'</li>';
$output.='<li>'.st('If available, download the translation pack and extract it to your Drupal root directory. Translation files will get placed into different directories.').'</li>';
$output.='<li>'.st('Continue the installation by reloading this page and select from the listed languages.').'</li>';
$output.='</ul><p>'.st('How should the installation continue?').'</p>';
$output.='<ul><li><a href="install.php?profile='.$profilename.'&locale=en">'.st('Continue installation in English').'</a></li><li><a href="install.php?profile='.$profilename.'">'.st('Reload this page to select a language').'</a></li></ul>';
printtheme('install_page',$output);
exit;
}
// One language, but not the default profile, assume
// the user knows what he is doing.
returnFALSE;
}
else{
...
...
@@ -504,7 +522,7 @@ function install_select_locale($profilename) {
}
drupal_maintenance_theme();
install_task_list('locale');
install_task_list('locale-select');
drupal_set_title(st('Choose your preferred language'));
@@ -531,7 +549,7 @@ function install_select_locale_form($locales) {
}
$form['submit']=array(
'#type'=>'submit',
'#value'=>st('Save configuration'),
'#value'=>st('Select language'),
);
return$form;
}
...
...
@@ -541,7 +559,7 @@ function install_select_locale_form($locales) {
*/
functioninstall_no_profile_error(){
drupal_maintenance_theme();
install_task_list('profile');
install_task_list('profile-select');
drupal_set_title(st('No profiles available'));
printtheme('install_page','<p>'.st('We were unable to find any installer profiles. Installer profiles tell us what modules to enable and what schema to install in the database. A profile is necessary to continue with the installation process.').'</p>');
exit;
...
...
@@ -577,7 +595,7 @@ function install_missing_modules_error($profile) {
* Tasks performed after the database is initialized. Called from install.php.
*/
functioninstall_tasks($profile,$task){
global$base_url;
global$base_url,$install_locale;
$output='';
// Bootstrap newly installed Drupal, while preserving existing messages.
...
...
@@ -592,6 +610,9 @@ function install_tasks($profile, $task) {
$task='configure';
}
// We are using a list of if constructs here to allow for
// passing from one task to the other in the same request.
if($task=='configure'){
drupal_set_title(st('Configure site'));
// Build menu to allow clean URL check.
...
...
@@ -621,55 +642,95 @@ function install_tasks($profile, $task) {
$page='<p>'.st('Congratulations, @drupal has been successfully installed.',array('@drupal'=>drupal_install_profile_name())).'</p>';
$page.=$output;
$messages=drupal_set_message();
$page.='<p>'.(isset($messages['error'])?st('Please review the messages above before continuing on to <a href="@url">your new site</a>.',array('@url'=>url(''))):st('You may now visit <a href="@url">your new site</a>.',array('@url'=>url('')))).'</p>';
$output=$page;
$task='done';
// Import interface translations for the enabled modules, after
// any changes made by the profile through the profile forms.
$output='<p>'.st('Congratulations, @drupal has been successfully installed.',array('@drupal'=>drupal_install_profile_name())).'</p>';
$messages=drupal_set_message();
$output.='<p>'.(isset($messages['error'])?st('Please review the messages above before continuing on to <a href="@url">your new site</a>.',array('@url'=>url(''))):st('You may now visit <a href="@url">your new site</a>.',array('@url'=>url('')))).'</p>';
$task='done';
}
// The end of the install process. Remember profile used.
if($task=='done'){
// Rebuild menu to get content type links registered by the profile,
// and possibly any other menu items created through the tasks.
menu_rebuild();
variable_set('install_profile',$profile);
}
// Set task for user, and remember the task in the database.
install_task_list($task);
variable_set('install_task',$task);
// Output page.
printtheme('maintenance_page',$output);
}
/**
* The list of reserved tasks to run in the installer.