diff --git a/ChangeLog b/ChangeLog index a158ff0f3..ed2f87d62 100755 --- a/ChangeLog +++ b/ChangeLog @@ -27,6 +27,9 @@ $Source$ * Documentation.html, import.php, querywindow.php, js/functions.js, libraries/header.inc.php, libraries/import.lib.php: Improve functionality of limiting DROP DATABASE (bug #1456082). + * libraries/language.lib.php, libraries/common.lib.php, + libraries/database_interface.lib.php, libraries/select_lang.lib.php: + Reload language file after switch to utf-8 translation (bug #1442605). 2006-04-26 Michal Čihař * libraries/plugin_interface.lib.php: diff --git a/libraries/common.lib.php b/libraries/common.lib.php index f00f66395..b65a04d96 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -2913,7 +2913,7 @@ if (file_exists('./lang/added_messages.php')) { /** * Includes the language file if it hasn't been included yet */ -require_once './libraries/select_lang.lib.php'; +require './libraries/language.lib.php'; /** @@ -3169,6 +3169,11 @@ if (!defined('PMA_MINIMUM_COMMON')) { @ini_set('track_errors', $bkp_track_err); unset($bkp_track_err); + /* If we auto switched to utf-8 we need to reread messages here */ + if (defined('PMA_LANG_RELOAD')) { + require './libraries/language.lib.php'; + } + /** * SQL Parser code */ diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index ddc648caf..a7a8d47f7 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -835,6 +835,7 @@ function PMA_DBI_postConnect($link, $is_controluser = false) if (!empty($GLOBALS['available_languages'][$lang_utf_8_version])) { $GLOBALS['lang'] = $lang_utf_8_version; $GLOBALS['charset'] = 'utf-8'; + define('PMA_LANG_RELOAD', 1); } } diff --git a/libraries/language.lib.php b/libraries/language.lib.php new file mode 100644 index 000000000..278eff22f --- /dev/null +++ b/libraries/language.lib.php @@ -0,0 +1,15 @@ + diff --git a/libraries/select_lang.lib.php b/libraries/select_lang.lib.php index 0fd9b3bf7..cde0cffa6 100644 --- a/libraries/select_lang.lib.php +++ b/libraries/select_lang.lib.php @@ -418,6 +418,6 @@ if ($lang_failed_request) { $GLOBALS['PMA_errors'][] = sprintf($strLanguageUnknown, $lang_failed_request); } -unset($lang_file, $lang_path, $strLanguageFileNotFound, $line, $fall_back_lang, +unset($strLanguageFileNotFound, $line, $fall_back_lang, $lang_failed_cfg, $lang_failed_cookie, $lang_failed_request, $strLanguageUnknown); ?>