summaryrefslogtreecommitdiffstats
path: root/wp-admin/options-general.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-admin/options-general.php')
-rw-r--r--wp-admin/options-general.php15
1 files changed, 6 insertions, 9 deletions
diff --git a/wp-admin/options-general.php b/wp-admin/options-general.php
index e2be9c0..8fdf3ef 100644
--- a/wp-admin/options-general.php
+++ b/wp-admin/options-general.php
@@ -92,22 +92,19 @@ endfor;
</select></td>
</tr>
<?php
-$lang_files = glob( ABSPATH . LANGDIR . '/*.mo' );
+if( is_dir( ABSPATH . LANGDIR ) && $dh = opendir( ABSPATH . LANGDIR ) )
+ while( ( $lang_file = readdir( $dh ) ) !== false )
+ if( substr( $lang_file, -3 ) == '.mo' )
+ $lang_files[] = $lang_file;
$lang = get_option('WPLANG');
-if( is_array( $lang_files ) ) {
+if( is_array($lang_files) && !empty($lang_files) ) {
?>
<tr valign="top">
<th width="33%" scope="row"><?php _e('Blog language:') ?></th>
<td>
<select name="WPLANG" id="WPLANG">
- <?php
- echo '<option value=""'.((empty($lang)) ? 'selected="selected"': '').'>'.__('English').'</option>';
- foreach ( (array) $lang_files as $key => $val ) {
- $code_lang = basename( $val, '.mo' );
- echo '<option value="'.$code_lang.'"'.(($lang == $code_lang) ? ' selected="selected"' : '').'> '.format_code_lang($code_lang).'</option>';
- }
- ?>
+ <?php mu_dropdown_languages( $lang_files, get_option('WPLANG') ); ?>
</select>
</td>
</tr>