mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
Use get_available_languages() in options-general.php instead of manually looping on the language dir. Props sivel. Fixes #13023
git-svn-id: http://svn.automattic.com/wordpress/trunk@14416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
856f478a9e
commit
1f18095da6
@ -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>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user