Reload language file after switch to utf-8 translation (bug #1442605).

This commit is contained in:
Michal Čihař
2006-04-27 12:13:52 +00:00
parent bfec931486
commit 9f8afc5d4e
5 changed files with 26 additions and 2 deletions

View File

@@ -27,6 +27,9 @@ $Source$
* Documentation.html, import.php, querywindow.php, js/functions.js, * Documentation.html, import.php, querywindow.php, js/functions.js,
libraries/header.inc.php, libraries/import.lib.php: Improve libraries/header.inc.php, libraries/import.lib.php: Improve
functionality of limiting DROP DATABASE (bug #1456082). 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ř <michal@cihar.com> 2006-04-26 Michal Čihař <michal@cihar.com>
* libraries/plugin_interface.lib.php: * libraries/plugin_interface.lib.php:

View File

@@ -2913,7 +2913,7 @@ if (file_exists('./lang/added_messages.php')) {
/** /**
* Includes the language file if it hasn't been included yet * 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); @ini_set('track_errors', $bkp_track_err);
unset($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 * SQL Parser code
*/ */

View File

@@ -835,6 +835,7 @@ function PMA_DBI_postConnect($link, $is_controluser = false)
if (!empty($GLOBALS['available_languages'][$lang_utf_8_version])) { if (!empty($GLOBALS['available_languages'][$lang_utf_8_version])) {
$GLOBALS['lang'] = $lang_utf_8_version; $GLOBALS['lang'] = $lang_utf_8_version;
$GLOBALS['charset'] = 'utf-8'; $GLOBALS['charset'] = 'utf-8';
define('PMA_LANG_RELOAD', 1);
} }
} }

View File

@@ -0,0 +1,15 @@
<?php
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
* phpMyAdmin Language Loading File
*/
// Detection is done here
require_once('./libraries/select_lang.lib.php');
// Load the translation
require_once $lang_path . $available_languages[$GLOBALS['lang']][1] . '.inc.php';
?>

View File

@@ -418,6 +418,6 @@ if ($lang_failed_request) {
$GLOBALS['PMA_errors'][] = sprintf($strLanguageUnknown, $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); $lang_failed_cfg, $lang_failed_cookie, $lang_failed_request, $strLanguageUnknown);
?> ?>