Changeset 4490
- Timestamp:
- 12/06/2016 06:12:53 PM (8 years ago)
- Location:
- sites/trunk/api.wordpress.org/public_html/core/credits
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/api.wordpress.org/public_html/core/credits/index.php
r2291 r4490 44 44 if ( ( isset( $_GET['locale'] ) && 'en_US' != $_GET['locale'] ) || ( 'cli' == php_sapi_name() && isset( $argv[2] ) ) ) { 45 45 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 46 71 $gp_locale = GP_Locales::by_field( 'wp_locale', isset( $argv[2] ) ? $argv[2] : $_GET['locale'] ); 47 72 if ( $gp_locale ) { -
sites/trunk/api.wordpress.org/public_html/core/credits/wp-credits.php
r4489 r4490 143 143 $path = 'wp/' . $path; 144 144 145 $locale = $gp_locale->slug; 145 $locale_parts = explode( '/', $gp_locale->slug ); 146 $locale = $locale_parts[0]; 147 $slug = isset( $locale_parts[1] ) ? $locale_parts[1] : 'default'; 146 148 147 149 $path = $wpdb->escape( like_escape( $path ) . '%' ); 148 150 $locale = $wpdb->escape( $locale ); 151 $slug = $wpdb->escape( $slug ); 149 152 150 153 $date = $wpdb->prepare( "AND tt.date_added > %s", $this->get_start_date() ); … … 160 163 WHERE tp.path LIKE '$path' 161 164 AND tts.locale = '$locale' 162 AND tts.slug = ' default'165 AND tts.slug = '$slug' 163 166 AND ( tt.status = 'current' || tt.status = 'old' ) 164 167 AND tt.user_id IS NOT NULL … … 220 223 $project_ids[] = '0'; // Global validators 221 224 225 $locale_parts = explode( '/', $gp_locale->slug ); 226 $locale = $locale_parts[0]; 227 222 228 return $wpdb->get_col( $wpdb->prepare( " 223 229 SELECT `user_id` FROM `translate_translation_editors` 224 230 WHERE `project_id` IN (" . implode( ', ', $project_ids ) . ") AND `locale` = %s 225 ", $ gp_locale->slug) );231 ", $locale ) ); 226 232 } 227 233
Note: See TracChangeset
for help on using the changeset viewer.