2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Code for displaying language selection
8 if (! defined('PHPMYADMIN')) {
13 * Sorts available languages by their true english names
15 * @param array the array to be sorted
16 * @param mixed a required parameter
17 * @return the sorted array
20 function PMA_language_cmp(&$a, &$b) {
21 return (strcmp($a[1], $b[1]));
22 } // end of the 'PMA_language_cmp()' function
25 * Displays for for language selection
29 function PMA_select_language($use_fieldset = FALSE, $show_doc = TRUE) {
33 <form method
="post" action
="index.php" target
="_parent">
35 $_form_params = array(
36 'db' => $GLOBALS['db'],
37 'table' => $GLOBALS['table'],
39 echo PMA_generate_common_hidden_inputs($_form_params);
41 // For non-English, display "Language" with emphasis because it's
42 // not a proper word in the current language; we show it to help
43 // people recognize the dialog
44 $language_title = __('Language')
45 . (__('Language') != 'Language' ?
' - <em>Language</em>' : '');
47 $language_title .= ' <a href="./translators.html" target="documentation">' .
48 ($cfg['ReplaceHelpImg']
49 ?
'<img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'b_info.png" width="11" height="11" alt="Info" />'
53 echo '<fieldset><legend xml:lang="en" dir="ltr">' . $language_title . '</legend>';
55 echo '<bdo xml:lang="en" dir="ltr">' . $language_title . ':</bdo>';
59 <select name
="lang" onchange
="this.form.submit();" xml
:lang
="en" dir
="ltr">
62 uasort($GLOBALS['available_languages'], 'PMA_language_cmp');
63 foreach ($GLOBALS['available_languages'] as $id => $tmplang) {
64 $lang_name = PMA_langName($tmplang);
66 //Is current one active?
68 $selected = ' selected="selected"';
74 echo '<option value="' . $id . '"' . $selected . '>' . $lang_name
89 echo '<fieldset class="tblFooters">';
93 <input type
="submit" value
="Go" />
103 } // End of function PMA_select_language