Making WordPress.org


Ignore:
Timestamp:
12/06/2016 06:12:53 PM (10 years ago)
Author:
ocean90
Message:

Credits API: Add support for language variants.

Fixes #1768.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/core/credits/index.php

    r2291 r4490  
    4444if ( ( isset( $_GET['locale'] ) && 'en_US' != $_GET['locale'] ) || ( 'cli' == php_sapi_name() && isset( $argv[2] ) ) ) {
    4545        require GLOTPRESS_LOCALES_PATH;
     46
     47        // Temporary: Add language variants to the list of GlotPress locales.
     48        $GLOBALS['gp_locales'] = new GP_Locales();
     49
     50        $de_formal = clone GP_Locales::by_field( 'wp_locale', 'de_DE' );
     51        $de_formal->english_name = 'German (Formal)';
     52        $de_formal->native_name = 'Deutsch (Sie)';
     53        $de_formal->slug = 'de/formal';
     54        $de_formal->wp_locale = 'de_DE_formal';
     55        $GLOBALS['gp_locales']->locales['de/formal'] = $de_formal;
     56
     57        $nl_formal = clone GP_Locales::by_field( 'wp_locale', 'nl_NL' );
     58        $nl_formal->english_name = 'Dutch (Formal)';
     59        $nl_formal->native_name = 'Nederlands (Formeel)';
     60        $nl_formal->slug = 'nl/formal';
     61        $nl_formal->wp_locale = 'nl_NL_formal';
     62        $GLOBALS['gp_locales']->locales['nl/formal'] = $nl_formal;
     63
     64        $de_ch_informal = clone GP_Locales::by_field( 'wp_locale', 'de_CH' );
     65        $de_ch_informal->english_name = 'German (Switzerland, Informal)';
     66        $de_ch_informal->native_name = 'Deutsch (Schweiz, Du)';
     67        $de_ch_informal->slug = 'de-ch/informal';
     68        $de_ch_informal->wp_locale = 'de_CH_informal';
     69        $GLOBALS['gp_locales']->locales['de-ch/informal'] = $de_ch_informal;
     70
    4671        $gp_locale = GP_Locales::by_field( 'wp_locale', isset( $argv[2] ) ? $argv[2] : $_GET['locale'] );
    4772        if ( $gp_locale ) {
Note: See TracChangeset for help on using the changeset viewer.