Merge branch 'master' of github.com:phpmyadmin/phpmyadmin
This commit is contained in:
commit
126d7b125e
@ -32,6 +32,7 @@ phpMyAdmin - ChangeLog
|
||||
- issue Handle empty TABLE_COMMENT
|
||||
+ issue #11833 Drop support for old Internet Explorer versions
|
||||
+ issue #11796 Use modals for displaying forms in db structure page
|
||||
+ issue #11789 Show MySQL error messages in user language
|
||||
|
||||
4.5.4.0 (not yet released)
|
||||
- issue #11724 live data edit of big sets is not working
|
||||
@ -56,6 +57,7 @@ phpMyAdmin - ChangeLog
|
||||
- issue #11804 Misleading message for configuration storage
|
||||
- issue #11772 Table pagination does nothing when session expired
|
||||
- issue #11840 Index comments not working properly
|
||||
- issue #11791 Better handle local storage errors
|
||||
|
||||
4.5.3.1 (2015-12-25)
|
||||
- issue #11774 Undefined offset 2
|
||||
|
||||
@ -231,7 +231,7 @@ echo '<h2>' , __('Appearance settings') , '</h2>';
|
||||
echo ' <ul>';
|
||||
|
||||
// Displays language selection combo
|
||||
if (empty($cfg['Lang']) && count($GLOBALS['available_languages']) > 1) {
|
||||
if (empty($cfg['Lang'])) {
|
||||
echo '<li id="li_select_lang" class="no_bullets">';
|
||||
include_once 'libraries/display_select_lang.lib.php';
|
||||
echo PMA\libraries\Util::getImage('s_lang.png') , " "
|
||||
|
||||
@ -711,7 +711,7 @@ AJAX.registerOnload('config.js', function () {
|
||||
});
|
||||
|
||||
// detect localStorage state
|
||||
var ls_supported = window.localStorage || false;
|
||||
var ls_supported = isStorageSupported('localStorage');
|
||||
var ls_exists = ls_supported ? (window.localStorage.config || false) : false;
|
||||
$('div.localStorage-' + (ls_supported ? 'un' : '') + 'supported').hide();
|
||||
$('div.localStorage-' + (ls_exists ? 'empty' : 'exists')).hide();
|
||||
@ -811,7 +811,7 @@ function updatePrefsDate()
|
||||
*/
|
||||
function offerPrefsAutoimport()
|
||||
{
|
||||
var has_config = (window.localStorage || false) && (window.localStorage.config || false);
|
||||
var has_config = (isStorageSupported('localStorage')) && (window.localStorage.config || false);
|
||||
var $cnt = $('#prefs_autoload');
|
||||
if (!$cnt.length || !has_config) {
|
||||
return;
|
||||
|
||||
@ -706,16 +706,13 @@ $js_messages['strConsoleDebugArgsSummary'] = __('%s argument(s) passed');
|
||||
$js_messages['strConsoleDebugShowArgs'] = __('Show arguments');
|
||||
$js_messages['strConsoleDebugHideArgs'] = __('Hide arguments');
|
||||
$js_messages['strConsoleDebugTimeTaken'] = __('Time taken:');
|
||||
$js_messages['strNoLocalStorage'] = __(
|
||||
'Your web browser does not support local storage of settings or the quota '
|
||||
. 'limit has been reached, some features may not work properly for you. In '
|
||||
. 'Safari, such problem is commonly caused by "Private Mode Browsing".'
|
||||
);
|
||||
$js_messages['strNoLocalStorage'] = __('There was a problem accessing your browser storage, some features may not work properly for you. It is likely that the browser doesn\'t support storage or the quota limit has been reached. In Firefox, corrupted storage can also cause such a problem, clearing your "Offline Website Data" might help. In Safari, such problem is commonly caused by "Private Mode Browsing".');
|
||||
// For modals in db_structure.php
|
||||
$js_messages['strCopyTablesTo'] = __('Copy tables to');
|
||||
$js_messages['strAddPrefix'] = __('Add table prefix');
|
||||
$js_messages['strReplacePrefix'] = __('Replace table with prefix');
|
||||
$js_messages['strCopyPrefix'] = __('Copy table with prefix');
|
||||
|
||||
echo "var PMA_messages = new Array();\n";
|
||||
foreach ($js_messages as $name => $js_message) {
|
||||
PMA_printJsValue("PMA_messages['" . $name . "']", $js_message);
|
||||
|
||||
@ -632,8 +632,10 @@ AJAX.registerOnload('server_status_monitor.js', function () {
|
||||
} catch (err) {
|
||||
alert(PMA_messages.strFailedBuildingGrid);
|
||||
// If an exception is thrown, load default again
|
||||
window.localStorage.removeItem('monitorCharts');
|
||||
window.localStorage.removeItem('monitorSettings');
|
||||
if (isStorageSupported('localStorage')) {
|
||||
window.localStorage.removeItem('monitorCharts');
|
||||
window.localStorage.removeItem('monitorSettings');
|
||||
}
|
||||
rebuildGrid();
|
||||
}
|
||||
|
||||
@ -659,9 +661,11 @@ AJAX.registerOnload('server_status_monitor.js', function () {
|
||||
|
||||
$('a[href="#clearMonitorConfig"]').click(function (event) {
|
||||
event.preventDefault();
|
||||
window.localStorage.removeItem('monitorCharts');
|
||||
window.localStorage.removeItem('monitorSettings');
|
||||
window.localStorage.removeItem('monitorVersion');
|
||||
if (isStorageSupported('localStorage')) {
|
||||
window.localStorage.removeItem('monitorCharts');
|
||||
window.localStorage.removeItem('monitorSettings');
|
||||
window.localStorage.removeItem('monitorVersion');
|
||||
}
|
||||
$(this).hide();
|
||||
rebuildGrid();
|
||||
});
|
||||
@ -938,17 +942,20 @@ AJAX.registerOnload('server_status_monitor.js', function () {
|
||||
var i;
|
||||
|
||||
/* Apply default values & config */
|
||||
if (window.localStorage) {
|
||||
if (window.localStorage.monitorCharts) {
|
||||
if (isStorageSupported('localStorage')) {
|
||||
if (typeof window.localStorage.monitorCharts !== 'undefined') {
|
||||
runtime.charts = $.parseJSON(window.localStorage.monitorCharts);
|
||||
}
|
||||
if (window.localStorage.monitorSettings) {
|
||||
if (typeof window.localStorage.monitorSettings !== 'undefined') {
|
||||
monitorSettings = $.parseJSON(window.localStorage.monitorSettings);
|
||||
}
|
||||
|
||||
$('a[href="#clearMonitorConfig"]').toggle(runtime.charts !== null);
|
||||
|
||||
if (runtime.charts !== null && monitorProtocolVersion != window.localStorage.monitorVersion) {
|
||||
if (runtime.charts !== null
|
||||
&& typeof window.localStorage.monitorVersion !== 'undefined'
|
||||
&& monitorProtocolVersion != window.localStorage.monitorVersion
|
||||
) {
|
||||
$('#emptyDialog').dialog({title: PMA_messages.strIncompatibleMonitorConfig});
|
||||
$('#emptyDialog').html(PMA_messages.strIncompatibleMonitorConfigDescription);
|
||||
|
||||
@ -2122,7 +2129,7 @@ AJAX.registerOnload('server_status_monitor.js', function () {
|
||||
gridCopy[key].maxYLabel = elem.maxYLabel;
|
||||
});
|
||||
|
||||
if (window.localStorage) {
|
||||
if (isStorageSupported('localStorage')) {
|
||||
window.localStorage.monitorCharts = JSON.stringify(gridCopy);
|
||||
window.localStorage.monitorSettings = JSON.stringify(monitorSettings);
|
||||
window.localStorage.monitorVersion = monitorProtocolVersion;
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
namespace PMA\libraries;
|
||||
|
||||
use PMA\libraries\dbi\DBIExtension;
|
||||
use PMA\libraries\LanguageManager;
|
||||
|
||||
require_once './libraries/logging.lib.php';
|
||||
require_once './libraries/util.lib.php';
|
||||
@ -1529,6 +1530,16 @@ class DatabaseInterface
|
||||
self::QUERY_STORE
|
||||
);
|
||||
}
|
||||
|
||||
/* Locale for messages */
|
||||
$locale = LanguageManager::getInstance()->getCurrentLanguage()->getMySQLLocale();
|
||||
if (! empty($locale)) {
|
||||
$this->query(
|
||||
"SET lc_messages = '" . $locale . "';",
|
||||
$link,
|
||||
self::QUERY_STORE
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -620,7 +620,7 @@ class Header
|
||||
*/
|
||||
private function _getHtmlStart()
|
||||
{
|
||||
$lang = $GLOBALS['available_languages'][$GLOBALS['lang']][1];
|
||||
$lang = $GLOBALS['lang'];
|
||||
$dir = $GLOBALS['text_dir'];
|
||||
|
||||
$retval = "<!DOCTYPE HTML>";
|
||||
|
||||
200
libraries/Language.php
Normal file
200
libraries/Language.php
Normal file
@ -0,0 +1,200 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Hold the PMA\libraries\LanguageManager class
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
namespace PMA\libraries;
|
||||
|
||||
use PMA\libraries\LanguageManager;
|
||||
|
||||
|
||||
/**
|
||||
* Language object
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
class Language
|
||||
{
|
||||
protected $code;
|
||||
protected $name;
|
||||
protected $native;
|
||||
protected $regex;
|
||||
protected $mysql;
|
||||
|
||||
/**
|
||||
* Constructs the Language object
|
||||
*
|
||||
* @param string $code Language code
|
||||
* @param string $name English name
|
||||
* @param string $native Native name
|
||||
* @param string $regex Match regullar expression
|
||||
* @param string $mysql MySQL locale code
|
||||
*
|
||||
*/
|
||||
public function __construct($code, $name, $native, $regex, $mysql)
|
||||
{
|
||||
$this->code = $code;
|
||||
$this->name = $name;
|
||||
$this->native = $native;
|
||||
if (strpos($regex, '[-_]') === false) {
|
||||
$regex = str_replace('|', '([-_][[:alpha:]]{2,3})?|', $regex);
|
||||
}
|
||||
$this->regex = $regex;
|
||||
$this->mysql = $mysql;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns native name for language
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNativeName()
|
||||
{
|
||||
return $this->native;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns English name for language
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEnglishName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns verbose name for language
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
if (! empty($this->native)) {
|
||||
return $this->native . ' - ' . $this->name;
|
||||
} else {
|
||||
return $this->name;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns language code
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCode()
|
||||
{
|
||||
return $this->code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns MySQL locale code, can be empty
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMySQLLocale()
|
||||
{
|
||||
return $this->mysql;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare function used for sorting
|
||||
*
|
||||
* @param Language $other Other object to compare
|
||||
*
|
||||
* @return int same as strcmp
|
||||
*/
|
||||
public function cmp($other)
|
||||
{
|
||||
return strcmp($this->name, $other->name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether language is currently active.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isActive()
|
||||
{
|
||||
return $GLOBALS['lang'] == $this->code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether language matches HTTP header Accept-Language.
|
||||
*
|
||||
* @param string $header Header content
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function matchesAcceptLanguage($header)
|
||||
{
|
||||
$pattern = '/^('
|
||||
. addcslashes($this->regex, '/')
|
||||
. ')(;q=[0-9]\\.[0-9])?$/i';
|
||||
return preg_match($pattern, $header);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether language matches HTTP header User-Agent
|
||||
*
|
||||
* @param string $header Header content
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function matchesUserAgent($header)
|
||||
{
|
||||
$pattern = '/(\(|\[|;[[:space:]])('
|
||||
. addcslashes($this->regex, '/')
|
||||
. ')(;|\]|\))/i';
|
||||
return preg_match($pattern, $header);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether langauge is RTL
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isRTL()
|
||||
{
|
||||
return in_array($this->code, array('ar', 'fa', 'he', 'ur'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Activates given translation
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function activate()
|
||||
{
|
||||
$GLOBALS['lang'] = $this->code;
|
||||
|
||||
// Set locale
|
||||
_setlocale(LC_MESSAGES, $this->code);
|
||||
_bindtextdomain('phpmyadmin', LOCALE_PATH);
|
||||
_bind_textdomain_codeset('phpmyadmin', 'UTF-8');
|
||||
_textdomain('phpmyadmin');
|
||||
|
||||
/* Text direction for language */
|
||||
if ($this->isRTL()) {
|
||||
$GLOBALS['text_dir'] = 'rtl';
|
||||
} else {
|
||||
$GLOBALS['text_dir'] = 'ltr';
|
||||
}
|
||||
|
||||
/* TCPDF */
|
||||
$GLOBALS['l'] = array();
|
||||
|
||||
/* TCPDF settings */
|
||||
$GLOBALS['l']['a_meta_charset'] = 'UTF-8';
|
||||
$GLOBALS['l']['a_meta_dir'] = $GLOBALS['text_dir'];
|
||||
$GLOBALS['l']['a_meta_language'] = $this->code;
|
||||
|
||||
/* TCPDF translations */
|
||||
$GLOBALS['l']['w_page'] = __('Page number:');
|
||||
|
||||
/* Show possible warnings from langauge selection */
|
||||
LanguageManager::getInstance()->showWarnings();
|
||||
}
|
||||
}
|
||||
783
libraries/LanguageManager.php
Normal file
783
libraries/LanguageManager.php
Normal file
@ -0,0 +1,783 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Hold the PMA\libraries\LanguageManager class
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
namespace PMA\libraries;
|
||||
|
||||
use PMA\libraries\Language;
|
||||
|
||||
/**
|
||||
* Language selection manager
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
class LanguageManager
|
||||
{
|
||||
/**
|
||||
* @var array Definition data for languages
|
||||
*
|
||||
* Each member contains:
|
||||
* - English language name
|
||||
* - Native language name
|
||||
* - Match regullar expression
|
||||
* - MySQL locale
|
||||
*/
|
||||
private static $_language_data = array(
|
||||
'af' => array(
|
||||
'Afrikaans',
|
||||
'',
|
||||
'af|afrikaans',
|
||||
'',
|
||||
),
|
||||
'ar' => array(
|
||||
'Arabic',
|
||||
'العربية',
|
||||
'ar|arabic',
|
||||
'ar_AE',
|
||||
),
|
||||
'az' => array(
|
||||
'Azerbaijani',
|
||||
'Azərbaycanca',
|
||||
'az|azerbaijani',
|
||||
'',
|
||||
),
|
||||
'bn' => array(
|
||||
'Bangla',
|
||||
'বাংলা',
|
||||
'bn|bangla',
|
||||
'',
|
||||
),
|
||||
'be' => array(
|
||||
'Belarusian',
|
||||
'Беларуская',
|
||||
'be|belarusian',
|
||||
'be_BY',
|
||||
),
|
||||
'be@latin' => array(
|
||||
'Belarusian (latin)',
|
||||
'Biełaruskaja',
|
||||
'be[-_]lat|be@latin|belarusian latin',
|
||||
'',
|
||||
),
|
||||
'bg' => array(
|
||||
'Bulgarian',
|
||||
'Български',
|
||||
'bg|bulgarian',
|
||||
'bg_BG',
|
||||
),
|
||||
'bs' => array(
|
||||
'Bosnian',
|
||||
'Bosanski',
|
||||
'bs|bosnian',
|
||||
'',
|
||||
),
|
||||
'br' => array(
|
||||
'Breton',
|
||||
'Brezhoneg',
|
||||
'br|breton',
|
||||
'',
|
||||
),
|
||||
'brx' => array(
|
||||
'Bodo',
|
||||
'बड़ो',
|
||||
'brx|bodo',
|
||||
'',
|
||||
),
|
||||
'ca' => array(
|
||||
'Catalan',
|
||||
'Català',
|
||||
'ca|catalan',
|
||||
'ca_ES',
|
||||
),
|
||||
'ckb' => array(
|
||||
'Sorani',
|
||||
'سۆرانی',
|
||||
'ckb|sorani',
|
||||
'',
|
||||
),
|
||||
'cs' => array(
|
||||
'Czech',
|
||||
'Čeština',
|
||||
'cs|czech',
|
||||
'cs_CZ',
|
||||
),
|
||||
'cy' => array(
|
||||
'Welsh',
|
||||
'Cymraeg',
|
||||
'cy|welsh',
|
||||
'',
|
||||
),
|
||||
'da' => array(
|
||||
'Danish',
|
||||
'Dansk',
|
||||
'da|danish',
|
||||
'da_DK',
|
||||
),
|
||||
'de' => array(
|
||||
'German',
|
||||
'Deutsch',
|
||||
'de|german',
|
||||
'de_DE',
|
||||
),
|
||||
'el' => array(
|
||||
'Greek',
|
||||
'Ελληνικά',
|
||||
'el|greek',
|
||||
'',
|
||||
),
|
||||
'en' => array(
|
||||
'English',
|
||||
'',
|
||||
'en|english',
|
||||
'en_US',
|
||||
),
|
||||
'en_gb' => array(
|
||||
'English (United Kingdom)',
|
||||
'',
|
||||
'en[_-]gb|english (United Kingdom)',
|
||||
'en_GB',
|
||||
),
|
||||
'eo' => array(
|
||||
'Esperanto',
|
||||
'Esperanto',
|
||||
'eo|esperanto',
|
||||
'',
|
||||
),
|
||||
'es' => array(
|
||||
'Spanish',
|
||||
'Español',
|
||||
'es|spanish',
|
||||
'es_ES',
|
||||
),
|
||||
'et' => array(
|
||||
'Estonian',
|
||||
'Eesti',
|
||||
'et|estonian',
|
||||
'et_EE',
|
||||
),
|
||||
'eu' => array(
|
||||
'Basque',
|
||||
'Euskara',
|
||||
'eu|basque',
|
||||
'eu_ES',
|
||||
),
|
||||
'fa' => array(
|
||||
'Persian',
|
||||
'فارسی',
|
||||
'fa|persian',
|
||||
'',
|
||||
),
|
||||
'fi' => array(
|
||||
'Finnish',
|
||||
'Suomi',
|
||||
'fi|finnish',
|
||||
'fi_FI',
|
||||
),
|
||||
'fr' => array(
|
||||
'French',
|
||||
'Français',
|
||||
'fr|french',
|
||||
'fr_FR',
|
||||
),
|
||||
'fy' => array(
|
||||
'Frisian',
|
||||
'Frysk',
|
||||
'fy|frisian',
|
||||
'',
|
||||
),
|
||||
'gl' => array(
|
||||
'Galician',
|
||||
'Galego',
|
||||
'gl|galician',
|
||||
'gl_ES',
|
||||
),
|
||||
'gu' => array(
|
||||
'Gujarati',
|
||||
'ગુજરાતી',
|
||||
'gu|gujarati',
|
||||
'gu_IN',
|
||||
),
|
||||
'he' => array(
|
||||
'Hebrew',
|
||||
'עברית',
|
||||
'he|hebrew',
|
||||
'he_IL',
|
||||
),
|
||||
'hi' => array(
|
||||
'Hindi',
|
||||
'हिन्दी',
|
||||
'hi|hindi',
|
||||
'hi_IN',
|
||||
),
|
||||
'hr' => array(
|
||||
'Croatian',
|
||||
'Hrvatski',
|
||||
'hr|croatian',
|
||||
'hr_HR',
|
||||
),
|
||||
'hu' => array(
|
||||
'Hungarian',
|
||||
'Magyar',
|
||||
'hu|hungarian',
|
||||
'hu_HU',
|
||||
),
|
||||
'hy' => array(
|
||||
'Armenian',
|
||||
'Հայերէն',
|
||||
'hy|armenian',
|
||||
'',
|
||||
),
|
||||
'ia' => array(
|
||||
'Interlingua',
|
||||
'',
|
||||
'ia|interlingua',
|
||||
'',
|
||||
),
|
||||
'id' => array(
|
||||
'Indonesian',
|
||||
'Bahasa Indonesia',
|
||||
'id|indonesian',
|
||||
'id_ID',
|
||||
),
|
||||
'it' => array(
|
||||
'Italian',
|
||||
'Italiano',
|
||||
'it|italian',
|
||||
'it_IT',
|
||||
),
|
||||
'ja' => array(
|
||||
'Japanese',
|
||||
'日本語',
|
||||
'ja|japanese',
|
||||
'ja_JP',
|
||||
),
|
||||
'ko' => array(
|
||||
'Korean',
|
||||
'한국어',
|
||||
'ko|korean',
|
||||
'ko_KR',
|
||||
),
|
||||
'ka' => array(
|
||||
'Georgian',
|
||||
'ქართული',
|
||||
'ka|georgian',
|
||||
'',
|
||||
),
|
||||
'kk' => array(
|
||||
'Kazakh',
|
||||
'Қазақ',
|
||||
'kk|kazakh',
|
||||
'',
|
||||
),
|
||||
'km' => array(
|
||||
'Khmer',
|
||||
'ខ្មែរ',
|
||||
'km|khmer',
|
||||
'',
|
||||
),
|
||||
'kn' => array(
|
||||
'Kannada',
|
||||
'ಕನ್ನಡ',
|
||||
'kn|kannada',
|
||||
'',
|
||||
),
|
||||
'ksh' => array(
|
||||
'Colognian',
|
||||
'Kölsch',
|
||||
'ksh|colognian',
|
||||
'',
|
||||
),
|
||||
'ky' => array(
|
||||
'Kyrgyz',
|
||||
'Кыргызча',
|
||||
'ky|kyrgyz',
|
||||
'',
|
||||
),
|
||||
'li' => array(
|
||||
'Limburgish',
|
||||
'Lèmbörgs',
|
||||
'li|limburgish',
|
||||
'',
|
||||
),
|
||||
'lt' => array(
|
||||
'Lithuanian',
|
||||
'Lietuvių',
|
||||
'lt|lithuanian',
|
||||
'lt_LT',
|
||||
),
|
||||
'lv' => array(
|
||||
'Latvian',
|
||||
'Latviešu',
|
||||
'lv|latvian',
|
||||
'lv_LV',
|
||||
),
|
||||
'mk' => array(
|
||||
'Macedonian',
|
||||
'Macedonian',
|
||||
'mk|macedonian',
|
||||
'mk_MK',
|
||||
),
|
||||
'ml' => array(
|
||||
'Malayalam',
|
||||
'Malayalam',
|
||||
'ml|malayalam',
|
||||
'',
|
||||
),
|
||||
'mn' => array(
|
||||
'Mongolian',
|
||||
'Монгол',
|
||||
'mn|mongolian',
|
||||
'mn_MN',
|
||||
),
|
||||
'ms' => array(
|
||||
'Malay',
|
||||
'Bahasa Melayu',
|
||||
'ms|malay',
|
||||
'ms_MY',
|
||||
),
|
||||
'ne' => array(
|
||||
'Nepali',
|
||||
'नेपाली',
|
||||
'ne|nepali',
|
||||
'',
|
||||
),
|
||||
'nb' => array(
|
||||
'Norwegian',
|
||||
'Norsk',
|
||||
'nb|norwegian',
|
||||
'nb_NO',
|
||||
),
|
||||
'nl' => array(
|
||||
'Dutch',
|
||||
'Nederlands',
|
||||
'nl|dutch',
|
||||
'nl_NL',
|
||||
),
|
||||
'pa' => array(
|
||||
'Punjabi',
|
||||
'ਪੰਜਾਬੀ',
|
||||
'pa|punjabi',
|
||||
'',
|
||||
),
|
||||
'pl' => array(
|
||||
'Polish',
|
||||
'Polski',
|
||||
'pl|polish',
|
||||
'pl_PL',
|
||||
),
|
||||
'pt_br' => array(
|
||||
'Brazilian Portuguese',
|
||||
'Português',
|
||||
'pt[-_]br|brazilian portuguese',
|
||||
'pt_BR',
|
||||
),
|
||||
'pt' => array(
|
||||
'Portuguese',
|
||||
'Português',
|
||||
'pt|portuguese',
|
||||
'pt_PT',
|
||||
),
|
||||
'ro' => array(
|
||||
'Romanian',
|
||||
'Română',
|
||||
'ro|romanian',
|
||||
'ro_RO',
|
||||
),
|
||||
'ru' => array(
|
||||
'Russian',
|
||||
'Русский',
|
||||
'ru|russian',
|
||||
'ru_RU',
|
||||
),
|
||||
'si' => array(
|
||||
'Sinhala',
|
||||
'සිංහල',
|
||||
'si|sinhala',
|
||||
'',
|
||||
),
|
||||
'sk' => array(
|
||||
'Slovak',
|
||||
'Slovenčina',
|
||||
'sk|slovak',
|
||||
'sk_SK',
|
||||
),
|
||||
'sl' => array(
|
||||
'Slovenian',
|
||||
'Slovenščina',
|
||||
'sl|slovenian',
|
||||
'sl_SI',
|
||||
),
|
||||
'sq' => array(
|
||||
'Slbanian',
|
||||
'Shqip',
|
||||
'sq|albanian',
|
||||
'sq_AL',
|
||||
),
|
||||
'sr@latin' => array(
|
||||
'Serbian (latin)',
|
||||
'Srpski',
|
||||
'sr[-_]lat|sr@latin|serbian latin',
|
||||
'sr_YU',
|
||||
),
|
||||
'sr' => array(
|
||||
'Serbian',
|
||||
'Српски',
|
||||
'sr|serbian',
|
||||
'sr_YU',
|
||||
),
|
||||
'sv' => array(
|
||||
'Swedish',
|
||||
'Svenska',
|
||||
'sv|swedish',
|
||||
'sv_SE',
|
||||
),
|
||||
'ta' => array(
|
||||
'Tamil',
|
||||
'தமிழ்',
|
||||
'ta|tamil',
|
||||
'ta_IN',
|
||||
),
|
||||
'te' => array(
|
||||
'Telugu',
|
||||
'తెలుగు',
|
||||
'te|telugu',
|
||||
'te_IN',
|
||||
),
|
||||
'th' => array(
|
||||
'Thai',
|
||||
'ภาษาไทย',
|
||||
'th|thai',
|
||||
'th_TH',
|
||||
),
|
||||
'tk' => array(
|
||||
'Turkmen',
|
||||
'Türkmençe',
|
||||
'tk|turkmen',
|
||||
'',
|
||||
),
|
||||
'tr' => array(
|
||||
'Turkish',
|
||||
'Türkçe',
|
||||
'tr|turkish',
|
||||
'tr_TR',
|
||||
),
|
||||
'tt' => array(
|
||||
'Tatarish',
|
||||
'Tatarça',
|
||||
'tt|tatarish',
|
||||
'',
|
||||
),
|
||||
'ug' => array(
|
||||
'Uyghur',
|
||||
'ئۇيغۇرچە',
|
||||
'ug|uyghur',
|
||||
'',
|
||||
),
|
||||
'uk' => array(
|
||||
'Ukrainian',
|
||||
'Українська',
|
||||
'uk|ukrainian',
|
||||
'uk_UA',
|
||||
),
|
||||
'ur' => array(
|
||||
'Urdu',
|
||||
'اُردوُ',
|
||||
'ur|urdu',
|
||||
'ur_PK',
|
||||
),
|
||||
'uz@latin' => array(
|
||||
'Uzbek (latin)',
|
||||
'O‘zbekcha',
|
||||
'uz[-_]lat|uz@latin|uzbek-latin',
|
||||
'',
|
||||
),
|
||||
'uz' => array(
|
||||
'Uzbek (cyrillic)',
|
||||
'Ўзбекча',
|
||||
'uz[-_]cyr|uz@cyrillic|uzbek-cyrillic',
|
||||
'',
|
||||
),
|
||||
'vi' => array(
|
||||
'Vietnamese',
|
||||
'Tiếng Việt',
|
||||
'vi|vietnamese',
|
||||
'vi_VN',
|
||||
),
|
||||
'vls' => array(
|
||||
'Flemish',
|
||||
'West-Vlams',
|
||||
'vls|flemish',
|
||||
'',
|
||||
),
|
||||
'zh_tw' => array(
|
||||
'Chinese traditional',
|
||||
'中文',
|
||||
'zh[-_](tw|hk)|chinese traditional',
|
||||
'zh_TW',
|
||||
),
|
||||
// only TW and HK use traditional Chinese while others (CN, SG, MY)
|
||||
// use simplified Chinese
|
||||
'zh_cn' => array(
|
||||
'Chinese simplified',
|
||||
'中文',
|
||||
'zh(?)([-_][[:alpha:]]{2,3})?|chinese simplified',
|
||||
'zh_CN',
|
||||
),
|
||||
);
|
||||
|
||||
private $_available_locales;
|
||||
private $_available_languages;
|
||||
private $_lang_failed_cfg;
|
||||
private $_lang_failed_cookie;
|
||||
private $_lang_failed_request;
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* Returns LanguageManager singleton
|
||||
*
|
||||
* @return LanguageManager
|
||||
*/
|
||||
public static function getInstance()
|
||||
{
|
||||
if (self::$instance === NULL) {
|
||||
self::$instance = new LanguageManager;
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of available locales
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function listLocaleDir()
|
||||
{
|
||||
$result = array('en');
|
||||
|
||||
/* Check for existing directory */
|
||||
if (!is_dir(LOCALE_PATH)) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
/* Open the directory */
|
||||
$handle = @opendir(LOCALE_PATH);
|
||||
/* This can happen if the kit is English-only */
|
||||
if ($handle === false) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
/* Process all files */
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
$path = LOCALE_PATH
|
||||
. '/' . $file
|
||||
. '/LC_MESSAGES/phpmyadmin.mo';
|
||||
if ($file != "."
|
||||
&& $file != ".."
|
||||
&& file_exists($path)
|
||||
) {
|
||||
$result[] = $file;
|
||||
}
|
||||
}
|
||||
/* Close the handle */
|
||||
closedir($handle);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns (cached) list of all available locales
|
||||
*
|
||||
* @return array of strings
|
||||
*/
|
||||
public function availableLocales()
|
||||
{
|
||||
if (! $this->_available_locales) {
|
||||
|
||||
if (empty($GLOBALS['cfg']['FilterLanguages'])) {
|
||||
$this->_available_locales = $this->listLocaleDir();
|
||||
} else {
|
||||
$this->_available_locales = preg_grep(
|
||||
'@' . $GLOBALS['cfg']['FilterLanguages'] . '@',
|
||||
$this->listLocaleDir()
|
||||
);
|
||||
}
|
||||
}
|
||||
return $this->_available_locales;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns (cached) list of all available languages
|
||||
*
|
||||
* @return array of Language objects
|
||||
*/
|
||||
public function availableLanguages()
|
||||
{
|
||||
if (! $this->_available_languages) {
|
||||
$this->_available_languages = array();
|
||||
|
||||
foreach($this->availableLocales() as $lang) {
|
||||
$lang = strtolower($lang);
|
||||
if (isset($this::$_language_data[$lang])) {
|
||||
$data = $this::$_language_data[$lang];
|
||||
$this->_available_languages[$lang] = new Language(
|
||||
$lang,
|
||||
$data[0],
|
||||
$data[1],
|
||||
$data[2],
|
||||
$data[3]
|
||||
);
|
||||
} else {
|
||||
$this->_available_languages[$lang] = new Language(
|
||||
$lang,
|
||||
ucfirst($lang),
|
||||
ucfirst($lang),
|
||||
$lang,
|
||||
''
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $this->_available_languages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns (cached) list of all available languages sorted
|
||||
* by name
|
||||
*
|
||||
* @return array of Language objects
|
||||
*/
|
||||
public function sortedLanguages()
|
||||
{
|
||||
$this->availableLanguages();
|
||||
uasort($this->_available_languages, function($a, $b)
|
||||
{
|
||||
return $a->cmp($b);
|
||||
}
|
||||
);
|
||||
return $this->_available_languages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return Language object for given code
|
||||
*
|
||||
* @param string $code Language code
|
||||
*
|
||||
* @return object|false Language object or false on failure
|
||||
*/
|
||||
public function getLanguage($code)
|
||||
{
|
||||
$langs = $this->availableLanguages();
|
||||
if (isset($langs[$code])) {
|
||||
return $langs[$code];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return currently active Language object
|
||||
*
|
||||
* @return object Language object
|
||||
*/
|
||||
public function getCurrentLanguage()
|
||||
{
|
||||
return $this->_available_languages[$GLOBALS['lang']];
|
||||
}
|
||||
|
||||
/**
|
||||
* Activates language based on configuration, user preferences or
|
||||
* browser
|
||||
*
|
||||
* @return Language
|
||||
*/
|
||||
public function selectLanguage()
|
||||
{
|
||||
$langs = $this->availableLanguages();
|
||||
|
||||
// check forced language
|
||||
if (! empty($GLOBALS['cfg']['Lang'])) {
|
||||
if (isset($langs[$GLOBALS['cfg']['Lang']])) {
|
||||
return $langs[$GLOBALS['cfg']['Lang']];
|
||||
}
|
||||
$this->_lang_failed_cfg = true;
|
||||
}
|
||||
|
||||
// Don't use REQUEST in following code as it might be confused by cookies
|
||||
// with same name. Check user requested language (POST)
|
||||
if (! empty($_POST['lang'])) {
|
||||
if (isset($langs[$_POST['lang']])) {
|
||||
return $langs[$_POST['lang']];
|
||||
}
|
||||
$this->_lang_failed_request = true;
|
||||
}
|
||||
|
||||
// check user requested language (GET)
|
||||
if (! empty($_GET['lang'])) {
|
||||
if (isset($langs[$_GET['lang']])) {
|
||||
return $langs[$_GET['lang']];
|
||||
}
|
||||
$this->_lang_failed_request = true;
|
||||
}
|
||||
|
||||
// check previous set language
|
||||
if (! empty($_COOKIE['pma_lang'])) {
|
||||
if (isset($langs[$_COOKIE['pma_lang']])) {
|
||||
return $langs[$_COOKIE['pma_lang']];
|
||||
}
|
||||
$this->_lang_failed_cookie = true;
|
||||
}
|
||||
|
||||
// try to find out user's language by checking its HTTP_ACCEPT_LANGUAGE variable;
|
||||
// prevent XSS
|
||||
$accepted_languages = PMA_getenv('HTTP_ACCEPT_LANGUAGE');
|
||||
if ($accepted_languages && false === mb_strpos($accepted_languages, '<')) {
|
||||
foreach (explode(',', $accepted_languages) as $header) {
|
||||
foreach ($langs as $language) {
|
||||
if ($language->matchesAcceptLanguage($header)) {
|
||||
return $language;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// try to find out user's language by checking its HTTP_USER_AGENT variable
|
||||
$user_agent = PMA_getenv('HTTP_USER_AGENT');
|
||||
if (! empty($user_agent)) {
|
||||
foreach ($langs as $language) {
|
||||
if ($language->matchesUserAgent($user_agent)) {
|
||||
return $language;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Didn't catch any valid lang : we use the default settings
|
||||
if (isset($langs[$GLOBALS['cfg']['DefaultLang']])) {
|
||||
return $langs[$GLOBALS['cfg']['DefaultLang']];
|
||||
}
|
||||
|
||||
// Fallback to English
|
||||
return $langs['en'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays warnings about invalid languages. This needs to be postponed
|
||||
* to show messages at time when language is initialized.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function showWarnings()
|
||||
{
|
||||
// now, that we have loaded the language strings we can send the errors
|
||||
if ($this->_lang_failed_cfg
|
||||
|| $this->_lang_failed_cookie
|
||||
|| $this->_lang_failed_request
|
||||
) {
|
||||
trigger_error(
|
||||
__('Ignoring unsupported language code.'),
|
||||
E_USER_ERROR
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -36,12 +36,12 @@ use PMA\libraries\ErrorHandler;
|
||||
use PMA\libraries\Message;
|
||||
use PMA\libraries\plugins\AuthenticationPlugin;
|
||||
use PMA\libraries\DbList;
|
||||
use PMA\libraries\Theme;
|
||||
use PMA\libraries\ThemeManager;
|
||||
use PMA\libraries\Tracker;
|
||||
use PMA\libraries\Response;
|
||||
use PMA\libraries\TypesMySQL;
|
||||
use PMA\libraries\Util;
|
||||
use PMA\libraries\LanguageManager;
|
||||
|
||||
/**
|
||||
* block attempts to directly run this script
|
||||
@ -474,10 +474,16 @@ if (PMA_isValid($_REQUEST['sql_query'])) {
|
||||
/******************************************************************************/
|
||||
/* loading language file LABEL_loading_language_file */
|
||||
|
||||
/**
|
||||
* Load gettext functions.
|
||||
*/
|
||||
require_once GETTEXT_INC;
|
||||
|
||||
/**
|
||||
* lang detection is done here
|
||||
*/
|
||||
require './libraries/select_lang.inc.php';
|
||||
$language = LanguageManager::getInstance()->selectLanguage();
|
||||
$language->activate();
|
||||
|
||||
// Defines the cell alignment values depending on text direction
|
||||
if ($GLOBALS['text_dir'] == 'ltr') {
|
||||
@ -1090,3 +1096,32 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
include 'libraries/config/user_preferences.forms.php';
|
||||
include_once 'libraries/config/page_settings.forms.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* @global array MySQL charsets map
|
||||
*/
|
||||
$GLOBALS['mysql_charset_map'] = array(
|
||||
'big5' => 'big5',
|
||||
'cp-866' => 'cp866',
|
||||
'euc-jp' => 'ujis',
|
||||
'euc-kr' => 'euckr',
|
||||
'gb2312' => 'gb2312',
|
||||
'gbk' => 'gbk',
|
||||
'iso-8859-1' => 'latin1',
|
||||
'iso-8859-2' => 'latin2',
|
||||
'iso-8859-7' => 'greek',
|
||||
'iso-8859-8' => 'hebrew',
|
||||
'iso-8859-8-i' => 'hebrew',
|
||||
'iso-8859-9' => 'latin5',
|
||||
'iso-8859-13' => 'latin7',
|
||||
'iso-8859-15' => 'latin1',
|
||||
'koi8-r' => 'koi8r',
|
||||
'shift_jis' => 'sjis',
|
||||
'tis-620' => 'tis620',
|
||||
'utf-8' => 'utf8',
|
||||
'windows-1250' => 'cp1250',
|
||||
'windows-1251' => 'cp1251',
|
||||
'windows-1252' => 'latin1',
|
||||
'windows-1256' => 'cp1256',
|
||||
'windows-1257' => 'cp1257',
|
||||
);
|
||||
|
||||
@ -246,7 +246,7 @@ function PMA_fatalError(
|
||||
} else {
|
||||
$error_header = 'Error';
|
||||
}
|
||||
$lang = $GLOBALS['available_languages'][$GLOBALS['lang']][1];
|
||||
$lang = $GLOBALS['lang'];
|
||||
$dir = $GLOBALS['text_dir'];
|
||||
|
||||
// on fatal errors it cannot hurt to always delete the current session
|
||||
|
||||
@ -5,20 +5,7 @@
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
|
||||
/**
|
||||
* Compares the names of two languages.
|
||||
* Used by uasort in PMA_getLanguageSelectorHtml()
|
||||
*
|
||||
* @param array $a The first language being compared
|
||||
* @param array $b The second language being compared
|
||||
*
|
||||
* @return int the sorted array
|
||||
*/
|
||||
function PMA_languageCmp($a, $b)
|
||||
{
|
||||
return strcmp($a[1], $b[1]);
|
||||
}
|
||||
use PMA\libraries\LanguageManager;
|
||||
|
||||
/**
|
||||
* Returns HTML code for the language selector
|
||||
@ -32,13 +19,12 @@ function PMA_languageCmp($a, $b)
|
||||
*/
|
||||
function PMA_getLanguageSelectorHtml($use_fieldset = false, $show_doc = true)
|
||||
{
|
||||
global $lang;
|
||||
|
||||
$retval = '';
|
||||
$available_languages = LanguageManager::getInstance()->sortedLanguages();
|
||||
|
||||
// Display language selection only if there
|
||||
// is more than one language to choose from
|
||||
if (count($GLOBALS['available_languages']) > 1) {
|
||||
if (count($available_languages) > 1) {
|
||||
$retval .= '<form method="get" action="index.php" class="disableAjax">';
|
||||
|
||||
$_form_params = array(
|
||||
@ -66,18 +52,15 @@ function PMA_getLanguageSelectorHtml($use_fieldset = false, $show_doc = true)
|
||||
$retval .= '<select name="lang" class="autosubmit" lang="en"'
|
||||
. ' dir="ltr" id="sel-lang">';
|
||||
|
||||
uasort($GLOBALS['available_languages'], 'PMA_languageCmp');
|
||||
foreach ($GLOBALS['available_languages'] as $id => $tmplang) {
|
||||
$lang_name = PMA_languageName($tmplang);
|
||||
|
||||
foreach ($available_languages as $language) {
|
||||
//Is current one active?
|
||||
if ($lang == $id) {
|
||||
if ($language->isActive()) {
|
||||
$selected = ' selected="selected"';
|
||||
} else {
|
||||
$selected = '';
|
||||
}
|
||||
$retval .= '<option value="' . $id . '"' . $selected . '>';
|
||||
$retval .= $lang_name;
|
||||
$retval .= '<option value="' . $language->getCode() . '"' . $selected . '>';
|
||||
$retval .= $language->getName();
|
||||
$retval .= '</option>';
|
||||
}
|
||||
|
||||
|
||||
@ -1,164 +0,0 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* phpMyAdmin Language Loading File
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
|
||||
require_once 'libraries/select_lang.lib.php';
|
||||
|
||||
/**
|
||||
* @global string path to the translations directory;
|
||||
* may be absent if the kit is English-only
|
||||
*/
|
||||
$GLOBALS['lang_path'] = './locale/';
|
||||
|
||||
/**
|
||||
* Load gettext functions.
|
||||
*/
|
||||
require_once GETTEXT_INC;
|
||||
|
||||
/**
|
||||
* @global string interface language
|
||||
*/
|
||||
$GLOBALS['lang'] = 'en';
|
||||
/**
|
||||
* @global boolean whether loading lang from cfg failed
|
||||
*/
|
||||
$GLOBALS['lang_failed_cfg'] = false;
|
||||
/**
|
||||
* @global boolean whether loading lang from cookie failed
|
||||
*/
|
||||
$GLOBALS['lang_failed_cookie'] = false;
|
||||
/**
|
||||
* @global boolean whether loading lang from user request failed
|
||||
*/
|
||||
$GLOBALS['lang_failed_request'] = false;
|
||||
/**
|
||||
* @global string text direction ltr or rtl
|
||||
*/
|
||||
$GLOBALS['text_dir'] = 'ltr';
|
||||
|
||||
/**
|
||||
* @global array supported languages
|
||||
*/
|
||||
$GLOBALS['available_languages'] = PMA_langList();
|
||||
|
||||
// Language filtering support
|
||||
if (! empty($GLOBALS['cfg']['FilterLanguages'])) {
|
||||
$new_lang = array();
|
||||
foreach ($GLOBALS['available_languages'] as $key => $val) {
|
||||
if (preg_match('@' . $GLOBALS['cfg']['FilterLanguages'] . '@', $key)) {
|
||||
$new_lang[$key] = $val;
|
||||
}
|
||||
}
|
||||
if (count($new_lang) > 0) {
|
||||
$GLOBALS['available_languages'] = $new_lang;
|
||||
}
|
||||
unset($key, $val, $new_lang);
|
||||
}
|
||||
|
||||
/**
|
||||
* @global array MySQL charsets map
|
||||
*/
|
||||
$GLOBALS['mysql_charset_map'] = array(
|
||||
'big5' => 'big5',
|
||||
'cp-866' => 'cp866',
|
||||
'euc-jp' => 'ujis',
|
||||
'euc-kr' => 'euckr',
|
||||
'gb2312' => 'gb2312',
|
||||
'gbk' => 'gbk',
|
||||
'iso-8859-1' => 'latin1',
|
||||
'iso-8859-2' => 'latin2',
|
||||
'iso-8859-7' => 'greek',
|
||||
'iso-8859-8' => 'hebrew',
|
||||
'iso-8859-8-i' => 'hebrew',
|
||||
'iso-8859-9' => 'latin5',
|
||||
'iso-8859-13' => 'latin7',
|
||||
'iso-8859-15' => 'latin1',
|
||||
'koi8-r' => 'koi8r',
|
||||
'shift_jis' => 'sjis',
|
||||
'tis-620' => 'tis620',
|
||||
'utf-8' => 'utf8',
|
||||
'windows-1250' => 'cp1250',
|
||||
'windows-1251' => 'cp1251',
|
||||
'windows-1252' => 'latin1',
|
||||
'windows-1256' => 'cp1256',
|
||||
'windows-1257' => 'cp1257',
|
||||
);
|
||||
|
||||
/*
|
||||
* Do the work!
|
||||
*/
|
||||
|
||||
if (! PMA_langCheck()) {
|
||||
// fallback language
|
||||
$fall_back_lang = 'en';
|
||||
$line = __LINE__;
|
||||
if (! PMA_langSet($fall_back_lang)) {
|
||||
trigger_error(
|
||||
'phpMyAdmin-ERROR: invalid lang code: '
|
||||
. __FILE__ . '#' . $line . ', check hard coded fall back language.',
|
||||
E_USER_WARNING
|
||||
);
|
||||
// stop execution
|
||||
// and tell the user that his chosen language is invalid
|
||||
PMA_fatalError(
|
||||
'Could not load any language, '
|
||||
. 'please check your language settings and folder.'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Set locale
|
||||
_setlocale(LC_MESSAGES, $GLOBALS['lang']);
|
||||
_bindtextdomain('phpmyadmin', $GLOBALS['lang_path']);
|
||||
_bind_textdomain_codeset('phpmyadmin', 'UTF-8');
|
||||
_textdomain('phpmyadmin');
|
||||
|
||||
/**
|
||||
* Messages for phpMyAdmin.
|
||||
*
|
||||
* These messages are here for easy transition to Gettext.
|
||||
* You should not add any messages here, use instead gettext directly
|
||||
* in your template/PHP file.
|
||||
*/
|
||||
|
||||
if (! function_exists('__')) {
|
||||
PMA_fatalError('Bad invocation!');
|
||||
}
|
||||
|
||||
/* Text direction for language */
|
||||
if (in_array($GLOBALS['lang'], array('ar', 'fa', 'he', 'ur'))) {
|
||||
$GLOBALS['text_dir'] = 'rtl';
|
||||
} else {
|
||||
$GLOBALS['text_dir'] = 'ltr';
|
||||
}
|
||||
|
||||
/* TCPDF */
|
||||
$GLOBALS['l'] = array();
|
||||
|
||||
/* TCPDF settings */
|
||||
$GLOBALS['l']['a_meta_charset'] = 'UTF-8';
|
||||
$GLOBALS['l']['a_meta_dir'] = $GLOBALS['text_dir'];
|
||||
$GLOBALS['l']['a_meta_language'] = $GLOBALS['lang'];
|
||||
|
||||
/* TCPDF translations */
|
||||
$GLOBALS['l']['w_page'] = __('Page number:');
|
||||
|
||||
|
||||
// now, that we have loaded the language strings we can send the errors
|
||||
if ($GLOBALS['lang_failed_cfg']
|
||||
|| $GLOBALS['lang_failed_cookie']
|
||||
|| $GLOBALS['lang_failed_request']
|
||||
) {
|
||||
trigger_error(
|
||||
__('Ignoring unsupported language code.'),
|
||||
E_USER_ERROR
|
||||
);
|
||||
}
|
||||
unset(
|
||||
$line, $fall_back_lang, $GLOBALS['lang_failed_cfg'],
|
||||
$GLOBALS['lang_failed_cookie'], $GLOBALS['lang_failed_request']
|
||||
);
|
||||
@ -1,467 +0,0 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* phpMyAdmin Language Loading File
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
|
||||
/**
|
||||
* Returns language name
|
||||
*
|
||||
* @param string $tmplang Language code
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function PMA_languageName($tmplang)
|
||||
{
|
||||
$lang_name = ucfirst(
|
||||
mb_substr(mb_strrchr($tmplang[0], '|'), 1)
|
||||
);
|
||||
|
||||
// Include native name if non empty
|
||||
if (!empty($tmplang[2])) {
|
||||
$lang_name = $tmplang[2] . ' - ' . $lang_name;
|
||||
}
|
||||
|
||||
return $lang_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries to find the language to use
|
||||
*
|
||||
* @return bool success if valid lang is found, otherwise false
|
||||
*/
|
||||
function PMA_langCheck()
|
||||
{
|
||||
// check forced language
|
||||
if (! empty($GLOBALS['cfg']['Lang'])) {
|
||||
if (PMA_langSet($GLOBALS['cfg']['Lang'])) {
|
||||
return true;
|
||||
} else {
|
||||
$GLOBALS['lang_failed_cfg'] = $GLOBALS['cfg']['Lang'];
|
||||
}
|
||||
}
|
||||
|
||||
// Don't use REQUEST in following code as it might be confused by cookies
|
||||
// with same name. Check user requested language (POST)
|
||||
if (! empty($_POST['lang'])) {
|
||||
if (PMA_langSet($_POST['lang'])) {
|
||||
return true;
|
||||
} elseif (!is_string($_POST['lang'])) {
|
||||
/* Faked request, don't care on localisation */
|
||||
$GLOBALS['lang_failed_request'] = 'Yes';
|
||||
} else {
|
||||
$GLOBALS['lang_failed_request'] = $_POST['lang'];
|
||||
}
|
||||
}
|
||||
|
||||
// check user requested language (GET)
|
||||
if (! empty($_GET['lang'])) {
|
||||
if (PMA_langSet($_GET['lang'])) {
|
||||
return true;
|
||||
} elseif (!is_string($_GET['lang'])) {
|
||||
/* Faked request, don't care on localisation */
|
||||
$GLOBALS['lang_failed_request'] = 'Yes';
|
||||
} else {
|
||||
$GLOBALS['lang_failed_request'] = $_GET['lang'];
|
||||
}
|
||||
}
|
||||
|
||||
// check previous set language
|
||||
if (! empty($_COOKIE['pma_lang'])) {
|
||||
if (PMA_langSet($_COOKIE['pma_lang'])) {
|
||||
return true;
|
||||
} elseif (!is_string($_COOKIE['pma_lang'])) {
|
||||
/* Faked request, don't care on localisation */
|
||||
$GLOBALS['lang_failed_cookie'] = 'Yes';
|
||||
} else {
|
||||
$GLOBALS['lang_failed_cookie'] = $_COOKIE['pma_lang'];
|
||||
}
|
||||
}
|
||||
|
||||
// try to find out user's language by checking its HTTP_ACCEPT_LANGUAGE variable;
|
||||
// prevent XSS
|
||||
$accepted_languages = PMA_getenv('HTTP_ACCEPT_LANGUAGE');
|
||||
if ($accepted_languages
|
||||
&& false === mb_strpos($accepted_languages, '<')
|
||||
) {
|
||||
foreach (explode(',', $accepted_languages) as $lang) {
|
||||
if (PMA_langDetect($lang, 1)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($accepted_languages);
|
||||
|
||||
// try to find out user's language by checking its HTTP_USER_AGENT variable
|
||||
if (PMA_langDetect(PMA_getenv('HTTP_USER_AGENT'), 2)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Didn't catch any valid lang : we use the default settings
|
||||
if (PMA_langSet($GLOBALS['cfg']['DefaultLang'])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* checks given lang and sets it if valid
|
||||
* returns true on success, otherwise false
|
||||
*
|
||||
* @param string &$lang language to set
|
||||
*
|
||||
* @return bool success
|
||||
*/
|
||||
function PMA_langSet(&$lang)
|
||||
{
|
||||
/* Partial backward compatibility with 3.3 and older branches */
|
||||
$lang = str_replace('-utf-8', '', $lang);
|
||||
|
||||
if (!is_string($lang)
|
||||
|| empty($lang)
|
||||
|| empty($GLOBALS['available_languages'][$lang])
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
$GLOBALS['lang'] = $lang;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Analyzes some PHP environment variables to find the most probable language
|
||||
* that should be used
|
||||
*
|
||||
* @param string $str string to analyze
|
||||
* @param integer $envType type of the PHP environment variable which value is $str
|
||||
*
|
||||
* @return bool true on success, otherwise false
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
function PMA_langDetect($str, $envType)
|
||||
{
|
||||
if (empty($str)) {
|
||||
return false;
|
||||
}
|
||||
if (empty($GLOBALS['available_languages'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($GLOBALS['available_languages'] as $lang => $value) {
|
||||
// $envType = 1 for the 'HTTP_ACCEPT_LANGUAGE' environment variable,
|
||||
// 2 for the 'HTTP_USER_AGENT' one
|
||||
$expr = $value[0];
|
||||
if (mb_strpos($expr, '[-_]') === false) {
|
||||
$expr = str_replace('|', '([-_][[:alpha:]]{2,3})?|', $expr);
|
||||
}
|
||||
$pattern1 = '/^(' . addcslashes($expr, '/') . ')(;q=[0-9]\\.[0-9])?$/i';
|
||||
$pattern2 = '/(\(|\[|;[[:space:]])(' . addcslashes($expr, '/')
|
||||
. ')(;|\]|\))/i';
|
||||
if (($envType == 1 && preg_match($pattern1, $str))
|
||||
|| ($envType == 2 && preg_match($pattern2, $str))
|
||||
) {
|
||||
if (PMA_langSet($lang)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
} // end of the 'PMA_langDetect()' function
|
||||
|
||||
|
||||
/**
|
||||
* All the supported languages have to be listed in the array below.
|
||||
* 1. The key must be the "official" ISO 639 language code and, if required,
|
||||
* the dialect code. It can also contain some information about the
|
||||
* charset (see the Russian case).
|
||||
* 2. The first of the values associated to the key is used in a regular
|
||||
* expression to find some keywords corresponding to the language inside two
|
||||
* environment variables.
|
||||
* These values contain:
|
||||
* - the "official" ISO language code and, if required, the dialect code
|
||||
* too ('bu' for Bulgarian, 'fr([-_][[:alpha:]]{2})?' for all French
|
||||
* dialects, 'zh[-_]tw' for Chinese traditional...), the dialect has to
|
||||
* be specified first;
|
||||
* - the '|' character (it means 'OR');
|
||||
* - the full language name.
|
||||
* 3. The second value associated to the key is the language code as defined by
|
||||
* the RFC1766.
|
||||
* 4. The third value is its native name in html entities or UTF-8.
|
||||
*
|
||||
* Beware that the sorting order (first values associated to keys by
|
||||
* alphabetical reverse order in the array) is important: 'zh-tw' (chinese
|
||||
* traditional) must be detected before 'zh' (chinese simplified) for
|
||||
* example.
|
||||
*
|
||||
* @param string $lang language
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function PMA_langDetails($lang)
|
||||
{
|
||||
switch ($lang) {
|
||||
case 'af':
|
||||
return array('af|afrikaans', 'af', '');
|
||||
case 'ar':
|
||||
return array(
|
||||
'ar|arabic',
|
||||
'ar',
|
||||
'العربية'
|
||||
);
|
||||
case 'az':
|
||||
return array('az|azerbaijani', 'az', 'Azərbaycanca');
|
||||
case 'bn':
|
||||
return array('bn|bangla', 'bn', 'বাংলা');
|
||||
case 'be':
|
||||
return array(
|
||||
'be|belarusian',
|
||||
'be',
|
||||
'Беларуская'
|
||||
);
|
||||
case 'be@latin':
|
||||
return array('be[-_]lat|belarusian latin', 'be-lat', 'Biełaruskaja');
|
||||
case 'bg':
|
||||
return array(
|
||||
'bg|bulgarian',
|
||||
'bg',
|
||||
'Български'
|
||||
);
|
||||
case 'bs':
|
||||
return array('bs|bosnian', 'bs', 'Bosanski');
|
||||
case 'br':
|
||||
return array('br|breton', 'br', 'Brezhoneg');
|
||||
case 'brx':
|
||||
return array('brx|bodo', 'brx', 'बड़ो');
|
||||
case 'ca':
|
||||
return array('ca|catalan', 'ca', 'Català');
|
||||
case 'ckb':
|
||||
return array('ckb', 'ckb', 'سۆرانی');
|
||||
case 'cs':
|
||||
return array('cs|czech', 'cs', 'Čeština');
|
||||
case 'cy':
|
||||
return array('cy|welsh', 'cy', 'Cymraeg');
|
||||
case 'da':
|
||||
return array('da|danish', 'da', 'Dansk');
|
||||
case 'de':
|
||||
return array('de|german', 'de', 'Deutsch');
|
||||
case 'el':
|
||||
return array(
|
||||
'el|greek',
|
||||
'el',
|
||||
'Ελληνικά'
|
||||
);
|
||||
case 'en':
|
||||
return array('en|english', 'en', '');
|
||||
case 'en_GB':
|
||||
return array('en[_-]gb|english (United Kingdom)', 'en-gb', '');
|
||||
case 'eo':
|
||||
return array('eo|esperanto', 'eo', 'Esperanto');
|
||||
case 'es':
|
||||
return array('es|spanish', 'es', 'Español');
|
||||
case 'et':
|
||||
return array('et|estonian', 'et', 'Eesti');
|
||||
case 'eu':
|
||||
return array('eu|basque', 'eu', 'Euskara');
|
||||
case 'fa':
|
||||
return array('fa|persian', 'fa', 'فارسی');
|
||||
case 'fi':
|
||||
return array('fi|finnish', 'fi', 'Suomi');
|
||||
case 'fr':
|
||||
return array('fr|french', 'fr', 'Français');
|
||||
case 'fy':
|
||||
return array('fy|frisian', 'fy', 'Frysk');
|
||||
case 'gl':
|
||||
return array('gl|galician', 'gl', 'Galego');
|
||||
case 'gu':
|
||||
return array('gu|gujarati', 'gu', 'ગુજરાતી');
|
||||
case 'he':
|
||||
return array('he|hebrew', 'he', 'עברית');
|
||||
case 'hi':
|
||||
return array('hi|hindi', 'hi', 'हिन्दी');
|
||||
case 'hr':
|
||||
return array('hr|croatian', 'hr', 'Hrvatski');
|
||||
case 'hu':
|
||||
return array('hu|hungarian', 'hu', 'Magyar');
|
||||
case 'hy':
|
||||
return array('hy|armenian', 'hy', 'Հայերէն');
|
||||
case 'ia':
|
||||
return array('ia|interlingua', 'ia', 'Interlingua');
|
||||
case 'id':
|
||||
return array('id|indonesian', 'id', 'Bahasa Indonesia');
|
||||
case 'it':
|
||||
return array('it|italian', 'it', 'Italiano');
|
||||
case 'ja':
|
||||
return array('ja|japanese', 'ja', '日本語');
|
||||
case 'ko':
|
||||
return array('ko|korean', 'ko', '한국어');
|
||||
case 'ka':
|
||||
return array(
|
||||
'ka|georgian',
|
||||
'ka',
|
||||
'ქართული'
|
||||
);
|
||||
case 'kk':
|
||||
return array('kk|kazakh', 'kk', 'Қазақ');
|
||||
case 'km':
|
||||
return array('km|khmer', 'km', 'ខ្មែរ');
|
||||
case 'kn':
|
||||
return array('kn|kannada', 'kn', 'ಕನ್ನಡ');
|
||||
case 'ksh':
|
||||
return array('ksh|colognian', 'ksh', 'Kölsch');
|
||||
case 'ky':
|
||||
return array('ky|kyrgyz', 'ky', 'Кыргызча');
|
||||
case 'li':
|
||||
return array('li|limburgish', 'li', 'Lèmbörgs');
|
||||
case 'lt':
|
||||
return array('lt|lithuanian', 'lt', 'Lietuvių');
|
||||
case 'lv':
|
||||
return array('lv|latvian', 'lv', 'Latviešu');
|
||||
case 'mk':
|
||||
return array('mk|macedonian', 'mk', 'Macedonian');
|
||||
case 'ml':
|
||||
return array('ml|malayalam', 'ml', 'Malayalam');
|
||||
case 'mn':
|
||||
return array(
|
||||
'mn|mongolian',
|
||||
'mn',
|
||||
'Монгол'
|
||||
);
|
||||
case 'ms':
|
||||
return array('ms|malay', 'ms', 'Bahasa Melayu');
|
||||
case 'ne':
|
||||
return array('ne|nepali', 'ne', 'नेपाली');
|
||||
case 'nl':
|
||||
return array('nl|dutch', 'nl', 'Nederlands');
|
||||
case 'nb':
|
||||
return array('nb|norwegian', 'nb', 'Norsk');
|
||||
case 'pa':
|
||||
return array('pa|punjabi', 'pa', 'ਪੰਜਾਬੀ');
|
||||
case 'pl':
|
||||
return array('pl|polish', 'pl', 'Polski');
|
||||
case 'pt_BR':
|
||||
return array('pt[-_]br|brazilian portuguese', 'pt-BR', 'Português');
|
||||
case 'pt':
|
||||
return array('pt|portuguese', 'pt', 'Português');
|
||||
case 'ro':
|
||||
return array('ro|romanian', 'ro', 'Română');
|
||||
case 'ru':
|
||||
return array(
|
||||
'ru|russian',
|
||||
'ru',
|
||||
'Русский'
|
||||
);
|
||||
case 'si':
|
||||
return array('si|sinhala', 'si', 'සිංහල');
|
||||
case 'sk':
|
||||
return array('sk|slovak', 'sk', 'Slovenčina');
|
||||
case 'sl':
|
||||
return array('sl|slovenian', 'sl', 'Slovenščina');
|
||||
case 'sq':
|
||||
return array('sq|albanian', 'sq', 'Shqip');
|
||||
case 'sr@latin':
|
||||
return array('sr[-_]lat|serbian latin', 'sr-lat', 'Srpski');
|
||||
case 'sr':
|
||||
return array(
|
||||
'sr|serbian',
|
||||
'sr',
|
||||
'Српски'
|
||||
);
|
||||
case 'sv':
|
||||
return array('sv|swedish', 'sv', 'Svenska');
|
||||
case 'ta':
|
||||
return array('ta|tamil', 'ta', 'தமிழ்');
|
||||
case 'te':
|
||||
return array('te|telugu', 'te', 'తెలుగు');
|
||||
case 'th':
|
||||
return array(
|
||||
'th|thai',
|
||||
'th',
|
||||
'ภาษาไทย'
|
||||
);
|
||||
case 'tk':
|
||||
return array('tk|turkmen', 'tk', 'türkmençe');
|
||||
case 'tr':
|
||||
return array('tr|turkish', 'tr', 'Türkçe');
|
||||
case 'tt':
|
||||
return array('tt|tatarish', 'tt', 'Tatarça');
|
||||
case 'ug':
|
||||
return array('ug|uyghur', 'ug', 'ئۇيغۇرچە');
|
||||
case 'uk':
|
||||
return array(
|
||||
'uk|ukrainian',
|
||||
'uk',
|
||||
'Українська'
|
||||
);
|
||||
case 'ur':
|
||||
return array('ur|urdu', 'ur', 'اُردوُ');
|
||||
case 'uz@latin':
|
||||
return array('uz[-_]lat|uzbek-latin', 'uz-lat', 'O‘zbekcha');
|
||||
case 'uz':
|
||||
return array(
|
||||
'uz[-_]cyr|uzbek-cyrillic',
|
||||
'uz-cyr',
|
||||
'Ўзбекча'
|
||||
);
|
||||
case 'vi':
|
||||
return array('vi|vietnamese', 'vi', 'Tiếng Việt');
|
||||
case 'vls':
|
||||
return array('vls|flemish', 'vls', 'West-Vlams');
|
||||
case 'zh_TW':
|
||||
return array(
|
||||
'zh[-_](tw|hk)|chinese traditional',
|
||||
'zh-TW',
|
||||
'中文'
|
||||
);
|
||||
case 'zh_CN':
|
||||
// only TW and HK use traditional Chinese while others (CN, SG, MY)
|
||||
// use simplified Chinese
|
||||
return array(
|
||||
'zh(?)([-_][[:alpha:]]{2,3})?|chinese simplified',
|
||||
'zh',
|
||||
'中文'
|
||||
);
|
||||
}
|
||||
return array("$lang|$lang", $lang, $lang);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of languages supported by phpMyAdmin
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function PMA_langList()
|
||||
{
|
||||
/* We can always speak English */
|
||||
$result = array('en' => PMA_langDetails('en'));
|
||||
|
||||
/* Check for existing directory */
|
||||
if (!is_dir($GLOBALS['lang_path'])) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
/* Open the directory */
|
||||
$handle = @opendir($GLOBALS['lang_path']);
|
||||
/* This can happen if the kit is English-only */
|
||||
if ($handle === false) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
/* Process all files */
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
$path = $GLOBALS['lang_path'] . '/' . $file . '/LC_MESSAGES/phpmyadmin.mo';
|
||||
if ($file != "."
|
||||
&& $file != ".."
|
||||
&& file_exists($path)
|
||||
) {
|
||||
$result[$file] = PMA_langDetails($file);
|
||||
}
|
||||
}
|
||||
/* Close the handle */
|
||||
closedir($handle);
|
||||
|
||||
return $result;
|
||||
}
|
||||
@ -89,6 +89,11 @@ define('PHPSECLIB_INC_DIR', './libraries/phpseclib/');
|
||||
*/
|
||||
define('SQL_PARSER_AUTOLOAD', './libraries/sql-parser/autoload.php');
|
||||
|
||||
/**
|
||||
* Path to files with compiled locales (*.mo)
|
||||
*/
|
||||
define('LOCALE_PATH', './locale/');
|
||||
|
||||
/**
|
||||
* Avoid referring to nonexistent files (causes warnings when open_basedir
|
||||
* is used)
|
||||
|
||||
8
po/fr.po
8
po/fr.po
@ -4,7 +4,7 @@ msgstr ""
|
||||
"Project-Id-Version: phpMyAdmin-docs 4.0.0-dev\n"
|
||||
"Report-Msgid-Bugs-To: translators@phpmyadmin.net\n"
|
||||
"POT-Creation-Date: 2016-01-08 16:50+0100\n"
|
||||
"PO-Revision-Date: 2016-01-09 15:57+0000\n"
|
||||
"PO-Revision-Date: 2016-01-13 12:38+0000\n"
|
||||
"Last-Translator: Marc Delisle <marc@infomarc.info>\n"
|
||||
"Language-Team: French "
|
||||
"<https://hosted.weblate.org/projects/phpmyadmin/master/fr/>\n"
|
||||
@ -40,7 +40,7 @@ msgstr "Affichage des lignes %1$s - %2$s."
|
||||
|
||||
#: db_datadict.php:57 libraries/operations.lib.php:34
|
||||
msgid "Database comment"
|
||||
msgstr "Commentaire sur la base de données :"
|
||||
msgstr "Commentaire sur la base de données"
|
||||
|
||||
#: db_datadict.php:104 libraries/plugins/schema/pdf/PdfRelationSchema.php:595
|
||||
#: templates/columns_definitions/column_definitions_form.phtml:84
|
||||
@ -137,7 +137,7 @@ msgstr "Null"
|
||||
#: templates/database/structure/body_for_table_summary.phtml:55
|
||||
#: templates/table/structure/table_structure_header.phtml:12
|
||||
msgid "Default"
|
||||
msgstr "Défaut"
|
||||
msgstr "Valeur par défaut"
|
||||
|
||||
#: db_datadict.php:118 libraries/plugins/export/ExportHtmlword.php:399
|
||||
#: libraries/plugins/export/ExportLatex.php:528
|
||||
@ -239,7 +239,7 @@ msgstr "Voir une exportation (schéma) de la base de données"
|
||||
#: libraries/controllers/database/DatabaseStructureController.php:158
|
||||
#: libraries/navigation/NavigationTree.php:917
|
||||
msgid "No tables found in database."
|
||||
msgstr "Aucune table n'a été trouvée dans cette base."
|
||||
msgstr "Aucune table n'a été trouvée dans cette base de données."
|
||||
|
||||
#: db_export.php:65 libraries/ServerStatusData.php:126
|
||||
#: libraries/config/messages.inc.php:279
|
||||
|
||||
@ -56,6 +56,10 @@ define('PMA_VERSION', $CFG->get('PMA_VERSION'));
|
||||
unset($CFG);
|
||||
require_once 'libraries/sql-parser/autoload.php';
|
||||
|
||||
/* Ensure default langauge is active */
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
PMA\libraries\LanguageManager::getInstance()->getLanguage('en')->activate();
|
||||
|
||||
// Set proxy information from env, if available
|
||||
$http_proxy = getenv('http_proxy');
|
||||
if ($http_proxy && ($url_info = parse_url($http_proxy))) {
|
||||
|
||||
@ -9,9 +9,7 @@
|
||||
/*
|
||||
* Include to test.
|
||||
*/
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
require_once 'libraries/core.lib.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
use PMA\libraries\Advisor;
|
||||
|
||||
@ -13,8 +13,6 @@ use PMA\libraries\Config;
|
||||
use PMA\libraries\config\ConfigFile;
|
||||
use PMA\setup\lib\ConfigGenerator;
|
||||
|
||||
require_once 'libraries/core.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -12,11 +12,9 @@
|
||||
*/
|
||||
use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/core.lib.php';
|
||||
require_once 'libraries/relation.lib.php';
|
||||
require_once 'libraries/vendor_config.php';
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -9,8 +9,6 @@
|
||||
* Include to test.
|
||||
*/
|
||||
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/core.lib.php';
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'libraries/relation.lib.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
@ -9,9 +9,7 @@
|
||||
* Include to test.
|
||||
*/
|
||||
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
require_once 'libraries/core.lib.php';
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
|
||||
@ -11,9 +11,7 @@
|
||||
use PMA\libraries\plugins\transformations\Text_Plain_Link;
|
||||
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/js_escape.lib.php';
|
||||
require_once 'libraries/core.lib.php';
|
||||
require_once 'libraries/relation.lib.php';
|
||||
require_once 'libraries/string.lib.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
@ -12,9 +12,7 @@
|
||||
use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/js_escape.lib.php';
|
||||
require_once 'libraries/core.lib.php';
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/vendor_config.php';
|
||||
require_once 'libraries/relation.lib.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
@ -12,11 +12,9 @@
|
||||
use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/sanitizing.lib.php';
|
||||
require_once 'libraries/core.lib.php';
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
require_once 'libraries/vendor_config.php';
|
||||
require_once 'libraries/select_lang.inc.php';
|
||||
require_once 'libraries/relation.lib.php';
|
||||
require_once 'libraries/js_escape.lib.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
/*
|
||||
* Include to test.
|
||||
*/
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
/**
|
||||
|
||||
235
test/classes/LanguageTest.php
Normal file
235
test/classes/LanguageTest.php
Normal file
@ -0,0 +1,235 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* tests for Advisor class
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include to test.
|
||||
*/
|
||||
|
||||
use PMA\libraries\LanguageManager;
|
||||
|
||||
/**
|
||||
* Tests behaviour of PMA_Advisor class
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class LanguageTest extends PMATestCase
|
||||
{
|
||||
private $manager;
|
||||
|
||||
/**
|
||||
* Setup for Language tests.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setup()
|
||||
{
|
||||
$loc = LOCALE_PATH . '/cs/LC_MESSAGES/phpmyadmin.mo';
|
||||
if (! is_readable($loc)) {
|
||||
$this->markTestSkipped('Missing compiled locales.');
|
||||
}
|
||||
$this->manager = new LanguageManager();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test language filtering
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testAvailable()
|
||||
{
|
||||
$GLOBALS['cfg']['FilterLanguages'] = 'cs';
|
||||
|
||||
$langs = $this->manager->availableLocales();
|
||||
|
||||
$this->assertEquals(1, count($langs));
|
||||
$this->assertContains('cs', $langs);
|
||||
$GLOBALS['cfg']['FilterLanguages'] = '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Test no language filtering
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testAllAvailable()
|
||||
{
|
||||
$GLOBALS['cfg']['FilterLanguages'] = '';
|
||||
|
||||
$langs = $this->manager->availableLocales();
|
||||
|
||||
$this->assertContains('cs', $langs);
|
||||
$this->assertContains('en', $langs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test whether listing locales works
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testList()
|
||||
{
|
||||
$langs = $this->manager->listLocaleDir();
|
||||
$this->assertContains('cs', $langs);
|
||||
$this->assertContains('en', $langs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for getting available languages
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testLanguages()
|
||||
{
|
||||
$langs = $this->manager->availableLanguages();
|
||||
$this->assertGreaterThan(1, count($langs));
|
||||
|
||||
/* Ensure we have name for every language */
|
||||
foreach($langs as $lang) {
|
||||
$this->assertNotEquals($lang->getCode(), strtolower($lang->getEnglishName()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for MySQL locales
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testMySQLLocale()
|
||||
{
|
||||
$czech = $this->manager->getLanguage('cs');
|
||||
$this->assertEquals('cs_CZ', $czech->getMySQLLocale());
|
||||
|
||||
$korani = $this->manager->getLanguage('ckb');
|
||||
$this->assertEquals('', $korani->getMySQLLocale());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for getting available sorted languages
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testSortedLanguages()
|
||||
{
|
||||
$langs = $this->manager->sortedLanguages();
|
||||
$this->assertGreaterThan(1, count($langs));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test getting language by code
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testGet()
|
||||
{
|
||||
$lang = $this->manager->getLanguage('cs');
|
||||
$this->assertNotEquals(false, $lang);
|
||||
$this->assertEquals('Czech', $lang->getEnglishName());
|
||||
$this->assertEquals('Čeština', $lang->getNativeName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test language selection
|
||||
*
|
||||
* @param string $lang Value for forced language
|
||||
* @param string $post Value for language in POST
|
||||
* @param string $get Value for language in GET
|
||||
* @param string $cookie Value for language in COOKIE
|
||||
* @param string $accept Value for HTTP Accept-Language header
|
||||
* @param string $agent Value for HTTP User-Agent header
|
||||
* @param string $default Value for default language
|
||||
* @param string $expect Expected language name
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @dataProvider selectDataProvider
|
||||
*/
|
||||
public function testSelect($lang, $post, $get, $cookie, $accept, $agent, $default, $expect)
|
||||
{
|
||||
$GLOBALS['cfg']['Lang'] = $lang;
|
||||
$_POST['lang'] = $post;
|
||||
$_GET['lang'] = $get;
|
||||
$_COOKIE['pma_lang'] = $cookie;
|
||||
$_SERVER['HTTP_ACCEPT_LANGUAGE'] = $accept;
|
||||
$_SERVER['HTTP_USER_AGENT'] = $agent;
|
||||
$GLOBALS['cfg']['DefaultLang'] = $default;
|
||||
|
||||
$lang = $this->manager->selectLanguage();
|
||||
|
||||
$this->assertEquals($expect, $lang->getEnglishName());
|
||||
|
||||
$GLOBALS['cfg']['Lang'] = '';
|
||||
$_POST['lang'] = '';
|
||||
$_GET['lang'] = '';
|
||||
$_COOKIE['pma_lang'] = '';
|
||||
$_SERVER['HTTP_ACCEPT_LANGUAGE'] = '';
|
||||
$_SERVER['HTTP_USER_AGENT'] = '';
|
||||
$GLOBALS['cfg']['DefaultLang'] = 'en';
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider for language selection test.
|
||||
*
|
||||
* @return array Test parameters.
|
||||
*/
|
||||
public function selectDataProvider()
|
||||
{
|
||||
return array(
|
||||
array('cs', 'en', '', '' ,'' ,'', '', 'Czech'),
|
||||
array('', 'cs', '', '' ,'' ,'', '', 'Czech'),
|
||||
array('', 'cs', 'en', '' ,'' ,'', '', 'Czech'),
|
||||
array('', '', 'cs', '' ,'' ,'', '', 'Czech'),
|
||||
array('', '', '', '' ,'cs,en-US;q=0.7,en;q=0.3' ,'', '', 'Czech'),
|
||||
array(
|
||||
'', '', '', '', '',
|
||||
'Mozilla/5.0 (Linux; U; Android 2.2.2; tr-tr; GM FOX)',
|
||||
'', 'Turkish'
|
||||
),
|
||||
array('', '', '', '' ,'' ,'', 'cs', 'Czech'),
|
||||
array('', '', '', '' ,'' ,'', '', 'English'),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for setting and parsing locales
|
||||
*
|
||||
* @param string $locale locale name
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @group large
|
||||
* @dataProvider listLocales
|
||||
*/
|
||||
public function testGettext($locale)
|
||||
{
|
||||
/* We should be able to set the language */
|
||||
$this->manager->getLanguage($locale)->activate();
|
||||
|
||||
/* Grab some texts */
|
||||
$this->assertContains('%s', _ngettext('%s table', '%s tables', 10));
|
||||
$this->assertContains('%s', _ngettext('%s table', '%s tables', 1));
|
||||
|
||||
$this->assertEquals(
|
||||
$locale,
|
||||
$this->manager->getCurrentLanguage()->getCode()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider to generate list of available locales.
|
||||
*
|
||||
* @return array with arrays of available locales
|
||||
*/
|
||||
public function listLocales()
|
||||
{
|
||||
$ret = array();
|
||||
foreach (LanguageManager::getInstance()->availableLanguages() as $language) {
|
||||
$ret[] = array($language->getCode());
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
@ -13,11 +13,9 @@ use PMA\libraries\Menu;
|
||||
use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/sanitizing.lib.php';
|
||||
require_once 'libraries/core.lib.php';
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
require_once 'libraries/vendor_config.php';
|
||||
require_once 'libraries/select_lang.inc.php';
|
||||
require_once 'libraries/relation.lib.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
|
||||
@ -12,8 +12,6 @@
|
||||
use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/sanitizing.lib.php';
|
||||
require_once 'libraries/core.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -11,8 +11,6 @@
|
||||
*/
|
||||
use PMA\libraries\PDF;
|
||||
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/core.lib.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
*/
|
||||
use PMA\libraries\ServerStatusData;
|
||||
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
@ -11,7 +11,6 @@ require_once 'test/PMATestCase.php';
|
||||
/*
|
||||
* Include to test.
|
||||
*/
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/config.default.php';
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
|
||||
|
||||
@ -15,7 +15,6 @@ use PMA\libraries\Util;
|
||||
|
||||
require_once 'libraries/mysql_charsets.lib.php';
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
require_once 'libraries/relation.lib.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
@ -12,8 +12,6 @@
|
||||
use PMA\libraries\ThemeManager;
|
||||
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/core.lib.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -7,8 +7,6 @@
|
||||
*/
|
||||
use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/core.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
|
||||
@ -12,7 +12,6 @@
|
||||
use PMA\libraries\Tracker;
|
||||
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/relation.lib.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
|
||||
use PMA\libraries\TypesMySQL;
|
||||
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -12,7 +12,6 @@
|
||||
use PMA\libraries\config\ConfigFile;
|
||||
|
||||
require_once 'test/PMATestCase.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
|
||||
/**
|
||||
* Tests for Config File Management
|
||||
|
||||
@ -13,7 +13,6 @@ use PMA\libraries\Theme;
|
||||
|
||||
require_once 'test/PMATestCase.php';
|
||||
require_once 'libraries/config/config_functions.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/user_preferences.lib.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -12,7 +12,6 @@ use PMA\libraries\config\Form;
|
||||
use PMA\libraries\Theme;
|
||||
|
||||
require_once 'test/PMATestCase.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
|
||||
/**
|
||||
* Tests for PMA_Form class
|
||||
|
||||
@ -19,10 +19,6 @@ $GLOBALS['cfg']['ServerDefault'] = 1;
|
||||
$GLOBALS['url_query'] = "url_query";
|
||||
$GLOBALS['PMA_PHP_SELF'] = PMA_getenv('PHP_SELF');
|
||||
$GLOBALS['lang'] = "en";
|
||||
$GLOBALS['available_languages']= array(
|
||||
"en" => array("English", "US-ENGLISH"),
|
||||
"ch" => array("Chinese", "TW-Chinese")
|
||||
);
|
||||
$GLOBALS['text_dir'] = "text_dir";
|
||||
$GLOBALS['cfg']['Server'] = array(
|
||||
'DisableIS' => false
|
||||
@ -32,7 +28,6 @@ $GLOBALS['cfg']['Server'] = array(
|
||||
$_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
|
||||
|
||||
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
|
||||
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
use PMA\libraries\di\Container;
|
||||
use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
require_once 'libraries/mysql_charsets.lib.php';
|
||||
|
||||
|
||||
@ -10,7 +10,6 @@ use PMA\libraries\StorageEngine;
|
||||
use PMA\libraries\Theme;
|
||||
use PMA\libraries\controllers\server\ServerEnginesController;
|
||||
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
|
||||
@ -13,7 +13,6 @@ use PMA\libraries\Theme;
|
||||
use PMA\libraries\controllers\server\ServerPluginsController;
|
||||
use PMA\libraries\di\Container;
|
||||
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'libraries/sanitizing.lib.php';
|
||||
require_once 'libraries/js_escape.lib.php';
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
use PMA\libraries\di\Container;
|
||||
use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
|
||||
@ -19,7 +19,6 @@ use PMA\libraries\Theme;
|
||||
|
||||
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/relation.lib.php';
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
|
||||
|
||||
@ -14,7 +14,6 @@ use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/relation.lib.php';
|
||||
require_once 'test/libraries/stubs/ResponseStub.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
@ -13,7 +13,6 @@ use PMA\libraries\dbi\DBIMysql;
|
||||
|
||||
require_once 'libraries/relation.lib.php';
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
|
||||
@ -13,7 +13,6 @@ use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/relation.lib.php';
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
|
||||
use PMA\libraries\engines\Bdb;
|
||||
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
|
||||
use PMA\libraries\engines\Innodb;
|
||||
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
|
||||
use PMA\libraries\engines\Memory;
|
||||
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
|
||||
use PMA\libraries\engines\Myisam;
|
||||
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
|
||||
use PMA\libraries\engines\Ndbcluster;
|
||||
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
|
||||
@ -12,8 +12,6 @@
|
||||
|
||||
use PMA\libraries\engines\Pbxt;
|
||||
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/core.lib.php';
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
|
||||
@ -11,7 +11,6 @@ use PMA\libraries\Theme;
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'libraries/relation.lib.php';
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -19,7 +19,6 @@ $GLOBALS['cfg']['Server']['DisableIS'] = false;
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'libraries/relation.lib.php';
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/check_user_privileges.lib.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
|
||||
@ -10,7 +10,6 @@ use PMA\libraries\navigation\NodeFactory;
|
||||
use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/navigation/NodeFactory.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -10,7 +10,6 @@ use PMA\libraries\navigation\NodeFactory;
|
||||
use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/navigation/NodeFactory.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -12,7 +12,6 @@ use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
require_once 'libraries/relation.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -10,7 +10,6 @@ use PMA\libraries\navigation\NodeFactory;
|
||||
use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/navigation/NodeFactory.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -10,7 +10,6 @@ use PMA\libraries\navigation\NodeFactory;
|
||||
use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/navigation/NodeFactory.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -11,7 +11,6 @@ use PMA\libraries\navigation\nodes\Node;
|
||||
use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/navigation/NodeFactory.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -10,7 +10,6 @@ use PMA\libraries\navigation\NodeFactory;
|
||||
use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/navigation/NodeFactory.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -10,7 +10,6 @@ use PMA\libraries\navigation\NodeFactory;
|
||||
use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/navigation/NodeFactory.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -10,7 +10,6 @@ use PMA\libraries\navigation\NodeFactory;
|
||||
use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/navigation/NodeFactory.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -10,7 +10,6 @@ use PMA\libraries\navigation\NodeFactory;
|
||||
use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/navigation/NodeFactory.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -10,7 +10,6 @@ use PMA\libraries\navigation\NodeFactory;
|
||||
use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/navigation/NodeFactory.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -10,7 +10,6 @@ use PMA\libraries\navigation\NodeFactory;
|
||||
use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/navigation/NodeFactory.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -10,7 +10,6 @@ use PMA\libraries\navigation\NodeFactory;
|
||||
use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/navigation/NodeFactory.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -10,7 +10,6 @@ use PMA\libraries\navigation\NodeFactory;
|
||||
use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/navigation/NodeFactory.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -10,7 +10,6 @@ use PMA\libraries\navigation\NodeFactory;
|
||||
use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/navigation/NodeFactory.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -10,7 +10,6 @@ use PMA\libraries\navigation\NodeFactory;
|
||||
use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/navigation/NodeFactory.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -10,7 +10,6 @@ use PMA\libraries\navigation\NodeFactory;
|
||||
use PMA\libraries\Theme;
|
||||
|
||||
require_once 'libraries/navigation/NodeFactory.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
/**
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
|
||||
use PMA\libraries\plugins\auth\AuthenticationConfig;
|
||||
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/config.default.php';
|
||||
require_once 'libraries/js_escape.lib.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
@ -11,12 +11,10 @@ use PMA\libraries\Theme;
|
||||
|
||||
$GLOBALS['PMA_Config'] = new PMA\libraries\Config();
|
||||
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/config.default.php';
|
||||
require_once 'libraries/js_escape.lib.php';
|
||||
require_once 'libraries/sanitizing.lib.php';
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'libraries/select_lang.inc.php';
|
||||
require_once 'libraries/plugins/auth/AuthenticationCookie.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
@ -41,10 +39,6 @@ class AuthenticationCookieTest extends PMATestCase
|
||||
{
|
||||
$GLOBALS['PMA_Config']->enableBc();
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['available_languages'] = array(
|
||||
"en" => array("English", "US-ENGLISH"),
|
||||
"ch" => array("Chinese", "TW-Chinese")
|
||||
);
|
||||
$GLOBALS['text_dir'] = 'ltr';
|
||||
$GLOBALS['db'] = 'db';
|
||||
$GLOBALS['table'] = 'table';
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
|
||||
use PMA\libraries\plugins\auth\AuthenticationHttp;
|
||||
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/config.default.php';
|
||||
require_once 'libraries/sanitizing.lib.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
@ -37,10 +36,6 @@ class AuthenticationHttpTest extends PMATestCase
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['lang'] = "en";
|
||||
$GLOBALS['text_dir'] = "ltr";
|
||||
$GLOBALS['available_languages'] = array(
|
||||
"en" => array("English", "US-ENGLISH"),
|
||||
"ch" => array("Chinese", "TW-Chinese")
|
||||
);
|
||||
$GLOBALS['token_provided'] = true;
|
||||
$GLOBALS['token_mismatch'] = false;
|
||||
$this->object = new AuthenticationHttp();
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
|
||||
use PMA\libraries\plugins\auth\AuthenticationSignon;
|
||||
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/config.default.php';
|
||||
require_once 'libraries/sanitizing.lib.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
use PMA\libraries\plugins\export\ExportCodegen;
|
||||
|
||||
require_once 'libraries/export.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/config.default.php';
|
||||
require_once 'export.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
@ -9,7 +9,6 @@ use PMA\libraries\plugins\export\ExportCsv;
|
||||
|
||||
require_once 'libraries/export.lib.php';
|
||||
require_once 'libraries/config.default.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'export.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
use PMA\libraries\plugins\export\ExportExcel;
|
||||
|
||||
require_once 'libraries/export.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/config.default.php';
|
||||
require_once 'export.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
use PMA\libraries\plugins\export\ExportHtmlword;
|
||||
|
||||
require_once 'libraries/export.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/config.default.php';
|
||||
require_once 'libraries/relation.lib.php';
|
||||
require_once 'libraries/transformations.lib.php';
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
use PMA\libraries\plugins\export\ExportJson;
|
||||
|
||||
require_once 'libraries/export.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/config.default.php';
|
||||
require_once 'export.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
use PMA\libraries\plugins\export\ExportLatex;
|
||||
|
||||
require_once 'libraries/export.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/config.default.php';
|
||||
require_once 'libraries/relation.lib.php';
|
||||
require_once 'libraries/transformations.lib.php';
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
use PMA\libraries\plugins\export\ExportMediawiki;
|
||||
|
||||
require_once 'libraries/export.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/config.default.php';
|
||||
require_once 'export.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
@ -10,7 +10,6 @@ use PMA\libraries\plugins\export\ExportOds;
|
||||
//ExportOds required because of initialisation inside
|
||||
require_once 'libraries/plugins/export/ExportOds.php';
|
||||
require_once 'libraries/export.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/config.default.php';
|
||||
require_once 'export.php';
|
||||
require_once 'libraries/opendocument.lib.php';
|
||||
|
||||
@ -10,7 +10,6 @@ use PMA\libraries\plugins\export\ExportOdt;
|
||||
//ExportOdt required because of initialisation inside
|
||||
require_once 'libraries/plugins/export/ExportOdt.php';
|
||||
require_once 'libraries/export.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/config.default.php';
|
||||
require_once 'libraries/relation.lib.php';
|
||||
require_once 'libraries/transformations.lib.php';
|
||||
|
||||
@ -9,7 +9,6 @@ use PMA\libraries\plugins\export\ExportPdf;
|
||||
use PMA\libraries\plugins\export\PMA_ExportPdf;
|
||||
|
||||
require_once 'libraries/export.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/config.default.php';
|
||||
require_once 'export.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
use PMA\libraries\plugins\export\ExportPhparray;
|
||||
|
||||
require_once 'libraries/export.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/config.default.php';
|
||||
require_once 'export.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
@ -9,7 +9,6 @@ use PMA\libraries\plugins\export\ExportSql;
|
||||
use PMA\libraries\Table;
|
||||
|
||||
require_once 'libraries/export.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/config.default.php';
|
||||
require_once 'libraries/mysql_charsets.lib.php';
|
||||
require_once 'libraries/relation.lib.php';
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
use PMA\libraries\plugins\export\ExportTexytext;
|
||||
|
||||
require_once 'libraries/export.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/config.default.php';
|
||||
require_once 'libraries/relation.lib.php';
|
||||
require_once 'libraries/transformations.lib.php';
|
||||
|
||||
@ -11,7 +11,6 @@ use PMA\libraries\Table;
|
||||
$GLOBALS['db'] = 'db';
|
||||
|
||||
require_once 'libraries/export.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/config.default.php';
|
||||
require_once 'export.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
use PMA\libraries\plugins\export\ExportYaml;
|
||||
|
||||
require_once 'libraries/export.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/config.default.php';
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'export.php';
|
||||
|
||||
@ -7,7 +7,6 @@
|
||||
*/
|
||||
use PMA\libraries\plugins\export\TableProperty;
|
||||
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/config.default.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
|
||||
@ -18,7 +18,6 @@ $GLOBALS['server'] = 0;
|
||||
* Include to test.
|
||||
*/
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'libraries/import.lib.php';
|
||||
require_once 'libraries/sanitizing.lib.php';
|
||||
|
||||
@ -19,7 +19,6 @@ $GLOBALS['plugin_param'] = "table";
|
||||
*/
|
||||
require_once 'libraries/sanitizing.lib.php';
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'libraries/import.lib.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
@ -16,7 +16,6 @@ $GLOBALS['server'] = 0;
|
||||
* Include to test.
|
||||
*/
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'libraries/import.lib.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
@ -17,7 +17,6 @@ $GLOBALS['server'] = 0;
|
||||
* Include to test.
|
||||
*/
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'libraries/import.lib.php';
|
||||
require_once 'libraries/sanitizing.lib.php';
|
||||
|
||||
@ -14,7 +14,6 @@ use PMA\libraries\plugins\import\ImportShp;
|
||||
$GLOBALS['server'] = 0;
|
||||
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'libraries/import.lib.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
@ -17,7 +17,6 @@ $GLOBALS['server'] = 0;
|
||||
* Include to test.
|
||||
*/
|
||||
require_once 'libraries/url_generating.lib.php';
|
||||
require_once 'libraries/php-gettext/gettext.inc';
|
||||
require_once 'libraries/database_interface.inc.php';
|
||||
require_once 'libraries/import.lib.php';
|
||||
require_once 'test/PMATestCase.php';
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user