Use get_available_languages() in options-general.php instead of manually looping on the language dir. Props sivel. Fixes #13023

git-svn-id: https://develop.svn.wordpress.org/trunk@14416 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Nikolay Bachiyski 2010-05-03 22:06:49 +00:00
parent f01af5fefd
commit 6eba1c3232
1 changed files with 4 additions and 12 deletions

View File

@ -310,27 +310,19 @@ endfor;
</tr>
<?php do_settings_fields('general', 'default'); ?>
<?php
$lang_files = array();
if ( is_multisite() && is_dir( ABSPATH . LANGDIR ) && $dh = opendir( ABSPATH . LANGDIR ) ) {
while ( ( $lang_file = readdir( $dh ) ) !== false ) {
if ( substr( $lang_file, -3 ) == '.mo' )
$lang_files[] = $lang_file;
}
}
if ( !empty($lang_files) ) {
$languages = get_available_languages();
if ( is_multisite() && !empty( $languages ) ):
?>
<tr valign="top">
<th width="33%" scope="row"><?php _e('Site language:') ?></th>
<td>
<select name="WPLANG" id="WPLANG">
<?php mu_dropdown_languages( $lang_files, get_option('WPLANG') ); ?>
<?php mu_dropdown_languages( $languages, get_option('WPLANG') ); ?>
</select>
</td>
</tr>
<?php
} // languages
endif;
?>
</table>