WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/26/2014 07:58:33 PM (6 years ago)
Author:
ocean90
Message:

Language packs: No WPLANG anymore.

  • The WPLANG constant is no longer needed. Remove define('WPLANG', ); from wp-config-sample.php. Populate WPLANG option based on the WPLANG constant. When get_option('WPLANG') is an empty string it will override WPLANG.
  • Introduce translations_api() which is available to communicate with the translation API. Move translation install related functions to a new file.
  • Replace mu_dropdown_languages() with wp_dropdown_languages(). wp_dropdown_languages() is now populated by the translation API.
  • Remove wp_install_load_language() and allow load_default_textdomain() to switch a core translation.

fixes #13069, #15677, #19760, #28730, #29281.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/options.php

    r29206 r29630  
    152152    }
    153153
    154     // Handle custom date/time formats
     154    // Handle custom date/time formats.
    155155    if ( 'general' == $option_page ) {
    156156        if ( !empty($_POST['date_format']) && isset($_POST['date_format_custom']) && '\c\u\s\t\o\m' == wp_unslash( $_POST['date_format'] ) )
     
    180180            }
    181181            update_option( $option, $value );
     182        }
     183
     184        // Switch translation in case WPLANG was changed.
     185        $language = get_option( 'WPLANG' );
     186        if ( $language ) {
     187            load_default_textdomain( $language );
     188        } else {
     189            unload_textdomain( 'default' );
    182190        }
    183191    }
Note: See TracChangeset for help on using the changeset viewer.