/** WordPress Administration Bootstrap */
require_once( dirname( __FILE__ ) . '/admin.php' );
+/** WordPress Translation Install API */
+require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
+
if ( ! current_user_can( 'manage_options' ) )
wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) );
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready(function($){
+ var $siteName = $( '#wp-admin-bar-site-name' ).children( 'a' ).first(),
+ homeURL = ( <?php echo wp_json_encode( get_home_url() ); ?> || '' ).replace( /^(https?:\/\/)?(www\.)?/, '' );
+
+ $( '#blogname' ).on( 'input', function() {
+ var title = $.trim( $( this ).val() ) || homeURL;
+
+ // Truncate to 40 characters.
+ if ( 40 < title.length ) {
+ title = title.substring( 0, 40 ) + '\u2026';
+ }
+
+ $siteName.text( title );
+ });
+
$("input[name='date_format']").click(function(){
if ( "date_format_custom_radio" != $(this).attr("id") )
$("input[name='date_format_custom']").val( $(this).val() ).siblings('.example').text( $(this).siblings('span').text() );
date : format.val()
}, function(d) { format.siblings('.spinner').hide(); format.siblings('.example').text(d); } );
});
+
+ var languageSelect = $( '#WPLANG' );
+ $( 'form' ).submit( function() {
+ // Don't show a spinner for English and installed languages,
+ // as there is nothing to download.
+ if ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) {
+ $( '#submit', this ).after( '<span class="spinner language-install-spinner" />' );
+ }
+ });
});
//]]>
</script>
'<p>' . __('If you want site visitors to be able to register themselves, as opposed to by the site administrator, check the membership box. A default user role can be set for all new users, whether self-registered or registered by the site admin.') . '</p>';
}
-$options_help .= '<p>' . __('UTC means Coordinated Universal Time.') . '</p>' .
+$options_help .= '<p>' . __( 'You can set the language, and the translation files will be automatically downloaded and installed (available if your filesystem is writable).' ) . '</p>' .
+ '<p>' . __( 'UTC means Coordinated Universal Time.' ) . '</p>' .
'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>';
get_current_screen()->add_help_tab( array(
<?php
$languages = get_available_languages();
+$translations = wp_get_available_translations();
if ( ! is_multisite() && defined( 'WPLANG' ) && '' !== WPLANG && 'en_US' !== WPLANG && ! in_array( WPLANG, $languages ) ) {
$languages[] = WPLANG;
}
-if ( $languages ) {
+if ( ! empty( $languages ) || ! empty( $translations ) ) {
?>
<tr>
<th width="33%" scope="row"><label for="WPLANG"><?php _e( 'Site Language' ); ?></label></th>
}
wp_dropdown_languages( array(
- 'name' => 'WPLANG',
- 'id' => 'WPLANG',
- 'selected' => $locale,
- 'languages' => $languages,
+ 'name' => 'WPLANG',
+ 'id' => 'WPLANG',
+ 'selected' => $locale,
+ 'languages' => $languages,
+ 'translations' => $translations,
+ 'show_available_translations' => ( ! is_multisite() || is_super_admin() ) && wp_can_install_language_pack(),
) );
// Add note about deprecated WPLANG constant.