From f6a894f07700627b675c2b16aab4714df5819a23 Mon Sep 17 00:00:00 2001 From: Nathaniel Guse Date: Sat, 23 Feb 2013 16:12:24 -0600 Subject: [PATCH] [feature/migrations] Use the user class for language handling Also localise error messages from the migrator PHBB3-9737 --- phpBB/install/database_update.php | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 459839f393..4938ef0f87 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -133,9 +133,7 @@ set_config(null, null, null, $config); set_config_count(null, null, null, $config); $orig_version = $config['version']; -include($phpbb_root_path . 'language/' . $config['default_lang'] . '/common.' . $phpEx); -include($phpbb_root_path . 'language/' . $config['default_lang'] . '/acp/common.' . $phpEx); -include($phpbb_root_path . 'language/' . $config['default_lang'] . '/install.' . $phpEx); +$user->add_lang(array('common', 'acp/common', 'install', 'migrator')); // Add own hook handler, if present. :o if (file_exists($phpbb_root_path . 'includes/hooks/index.' . $phpEx)) @@ -157,11 +155,11 @@ else header('Content-type: text/html; charset=UTF-8'); ?> - + -<?php echo $lang['UPDATING_TO_LATEST_STABLE']; ?> +<?php echo $user->lang['UPDATING_TO_LATEST_STABLE']; ?> @@ -178,12 +176,12 @@ header('Content-type: text/html; charset=UTF-8');
-

+

lang['UPDATING_TO_LATEST_STABLE']; ?>


-

:: sql_layer; ?>
- ::
+

lang['DATABASE_TYPE']; ?> :: sql_layer; ?>
+ lang['PREVIOUS_VERSION']; ?> ::
finished()) } catch (phpbb_db_migration_exception $e) { - echo $e; + echo $e->getLocalisedMessage($user); phpbb_end_update($cache); } @@ -236,8 +234,8 @@ while (!$migrator->finished()) if ((time() - $update_start_time) >= $safe_time_limit) { //echo ''; - echo $lang['DATABASE_UPDATE_NOT_COMPLETED'] . '
'; - echo '' . $lang['DATABASE_UPDATE_CONTINUE'] . ''; + echo $user->lang['DATABASE_UPDATE_NOT_COMPLETED'] . '
'; + echo '' . $user->lang['DATABASE_UPDATE_CONTINUE'] . ''; phpbb_end_update($cache); } @@ -248,6 +246,6 @@ if ($orig_version != $config['version']) add_log('admin', 'LOG_UPDATE_DATABASE', $orig_version, $config['version']); } -echo $lang['DATABASE_UPDATE_COMPLETE']; +echo $user->lang['DATABASE_UPDATE_COMPLETE']; phpbb_end_update($cache);