Changeset 3540
- Timestamp:
- 06/22/2016 10:58:39 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin-translations.php
r3534 r3540 152 152 if ( is_array( $http_locales ) ) { 153 153 foreach ( $http_locales as $http_locale ) { 154 @list( $lang, $region ) = explode( '-', $http_locale ); 155 if ( is_null( $region ) ) { 156 $region = $lang; 157 } 158 154 159 /* 155 160 * Discard English -- it's the default for all browsers, 156 161 * ergo not very reliable information 157 162 */ 158 if ( 'en' === $ http_locale || 'en-US' === $http_locale) {163 if ( 'en' === $lang ) { 159 164 continue; 160 165 } 161 166 162 @list( $lang, $region ) = explode( '-', $http_locale ); 163 if ( is_null( $region ) ) { 164 $region = $lang; 165 } 167 // Region should be uppercase. 168 $region = strtoupper( $region ); 166 169 167 170 if ( $mapped = $this->map_locale( $lang, $region, $available_locales ) ) { … … 273 276 unset( $translation ); 274 277 275 #wp_cache_add( 'original-' . $original_id, $translations, 'lang-guess-translations', 900 );278 wp_cache_add( 'original-' . $original_id, $translations, 'lang-guess-translations', 900 ); 276 279 277 280 return isset( $translations[ $gp_locale ] ) ? $translations[ $gp_locale ] : $string;
Note: See TracChangeset
for help on using the changeset viewer.