Making WordPress.org

Changeset 1733


Ignore:
Timestamp:
07/11/2015 04:01:36 PM (10 years ago)
Author:
ocean90
Message:

Translations API: Add the formal variant of German temporary to the list of GlotPress locales.

see #wp28303.
see #1121.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/translations/lib.php

    r1466 r1733  
    5252
    5353    require_once WPORGPATH . 'translate/glotpress/locales/locales.php';
     54    // Temporary: Add language variants to the list of GlotPress locales.
     55    $GLOBALS['gp_locales'] = new GP_Locales;
     56    $de_formal = clone GP_Locales::by_field( 'wp_locale', 'de_DE' );
     57    $de_formal->english_name = 'German (Formal)';
     58    $de_formal->native_name = 'Deutsch (Sie)';
     59    $de_formal->slug = 'de/formal';
     60    $de_formal->wp_locale = 'de_DE_formal';
     61    $GLOBALS['gp_locales']->locales['de/formal'] = $de_formal;
     62
    5463    $base_url = is_ssl() ? 'https' : 'http';
    5564    $base_url .= '://downloads.wordpress.org/translation/';
     
    6271            // Magic numbers: 78 is wp/dev/admin. 326 is 'Continue'.
    6372            $continue_translations = $wpdb->get_results(
    64                 "SELECT locale as gp_locale, translation_0 as translation
     73                "SELECT
     74                    IF(ts.slug <> 'default', CONCAT(ts.locale, '/', ts.slug), ts.locale) as slug,
     75                    translation_0 as translation
    6576                FROM translate_translation_sets ts
    6677                INNER JOIN translate_translations t
    6778                ON ts.id = t.translation_set_id
    6879                WHERE project_id = 78
    69                 AND slug = 'default'
    7080                AND original_id = 326", OBJECT_K
    7181            );
     
    247257    return $translations;
    248258}
    249 
Note: See TracChangeset for help on using the changeset viewer.