Translation update done using Pootle.
[phpmyadmin/dkf.git] / libraries / display_select_lang.lib.php
blobb11df0dc7408ca04a87d55c7376cd85c0cf5959a
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Code for displaying language selection
6 * @version $Id$
7 * @package phpMyAdmin
8 */
9 if (! defined('PHPMYADMIN')) {
10 exit;
13 /**
14 * Sorts available languages by their true english names
16 * @param array the array to be sorted
17 * @param mixed a required parameter
18 * @return the sorted array
19 * @access private
21 function PMA_language_cmp(&$a, &$b) {
22 return (strcmp($a[1], $b[1]));
23 } // end of the 'PMA_language_cmp()' function
25 /**
26 * Displays for for language selection
28 * @access public
30 function PMA_select_language($use_fieldset = FALSE, $show_doc = TRUE) {
31 global $cfg, $lang;
34 <form method="post" action="index.php" target="_parent">
35 <?php
36 $_form_params = array(
37 'db' => $GLOBALS['db'],
38 'table' => $GLOBALS['table'],
40 echo PMA_generate_common_hidden_inputs($_form_params);
42 // For non-English, display "Language" with emphasis because it's
43 // not a proper word in the current language; we show it to help
44 // people recognize the dialog
45 $language_title = __('Language')
46 . (__('Language') != 'Language' ? ' - <em>Language</em>' : '');
47 if ($show_doc) {
48 $language_title .= ' <a href="./translators.html" target="documentation">' .
49 ($cfg['ReplaceHelpImg']
50 ? '<img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'b_info.png" width="11" height="11" alt="Info" />'
51 : '(*)') . '</a>';
53 if ($use_fieldset) {
54 echo '<fieldset><legend xml:lang="en" dir="ltr">' . $language_title . '</legend>';
55 } else {
56 echo '<bdo xml:lang="en" dir="ltr">' . $language_title . ':</bdo>';
60 <select name="lang" onchange="this.form.submit();" xml:lang="en" dir="ltr">
61 <?php
63 uasort($GLOBALS['available_languages'], 'PMA_language_cmp');
64 foreach ($GLOBALS['available_languages'] as $id => $tmplang) {
65 $lang_name = PMA_langName($tmplang);
67 //Is current one active?
68 if ($lang == $id) {
69 $selected = ' selected="selected"';
70 } else {
71 $selected = '';
74 echo ' ';
75 echo '<option value="' . $id . '"' . $selected . '>' . $lang_name
76 . '</option>' . "\n";
80 </select>
81 <?php
82 if ($use_fieldset) {
83 echo '</fieldset>';
87 <noscript>
88 <?php
89 if ($use_fieldset) {
90 echo '<fieldset class="tblFooters">';
94 <input type="submit" value="Go" />
95 <?php
96 if ($use_fieldset) {
97 echo '</fieldset>';
101 </noscript>
102 </form>
103 <?php
104 } // End of function PMA_select_language