Translation update done using Pootle.
[phpmyadmin/dkf.git] / libraries / display_select_lang.lib.php
blob493939bba905c5bede2d7197c80adf2b2e9fdbcb
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Code for displaying language selection
6 * @package phpMyAdmin
7 */
8 if (! defined('PHPMYADMIN')) {
9 exit;
12 /**
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
18 * @access private
20 function PMA_language_cmp(&$a, &$b) {
21 return (strcmp($a[1], $b[1]));
22 } // end of the 'PMA_language_cmp()' function
24 /**
25 * Displays for for language selection
27 * @access public
29 function PMA_select_language($use_fieldset = FALSE, $show_doc = TRUE) {
30 global $cfg, $lang;
33 <form method="post" action="index.php" target="_parent">
34 <?php
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>' : '');
46 if ($show_doc) {
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" />'
50 : '(*)') . '</a>';
52 if ($use_fieldset) {
53 echo '<fieldset><legend xml:lang="en" dir="ltr">' . $language_title . '</legend>';
54 } else {
55 echo '<bdo xml:lang="en" dir="ltr">' . $language_title . ':</bdo>';
59 <select name="lang" onchange="this.form.submit();" xml:lang="en" dir="ltr">
60 <?php
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?
67 if ($lang == $id) {
68 $selected = ' selected="selected"';
69 } else {
70 $selected = '';
73 echo ' ';
74 echo '<option value="' . $id . '"' . $selected . '>' . $lang_name
75 . '</option>' . "\n";
79 </select>
80 <?php
81 if ($use_fieldset) {
82 echo '</fieldset>';
86 <noscript>
87 <?php
88 if ($use_fieldset) {
89 echo '<fieldset class="tblFooters">';
93 <input type="submit" value="Go" />
94 <?php
95 if ($use_fieldset) {
96 echo '</fieldset>';
100 </noscript>
101 </form>
102 <?php
103 } // End of function PMA_select_language