Changeset 7080
- Timestamp:
- 04/10/2018 05:29:44 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wp15.wordpress.net/public_html/content/mu-plugins/locales.php
r7079 r7080 44 44 } 45 45 46 $locale_status = wp_list_pluck( $translation_sets, 'percent_translated', 'wp_locale' ); 47 update_option( 'wp15_locale_status', $locale_status ); 46 update_option( 'wp15_locale_data', $translation_sets ); 48 47 49 48 foreach ( $translation_sets as $set ) { … … 213 212 */ 214 213 function locale_notice() { 214 $locale_data = get_option( 'wp15_locale_data', array() ); 215 216 if ( empty( $locale_data ) ) { 217 return; 218 } 219 215 220 $current_locale = get_locale(); 216 $status = get_option( 'wp15_locale_status', array() ); 221 $statuses = wp_list_pluck( $locale_data, 'percent_translated', 'wp_locale' ); 222 $mapped_locales = wp_list_pluck( $locale_data, 'locale', 'wp_locale' ); 217 223 $threshold = 90; 218 224 $is_dismissed = ! empty( $_COOKIE['wp15-locale-notice-dismissed'] ); 219 225 220 if ( isset( $status[ $current_locale ] ) && absint( $status[ $current_locale ] ) <= $threshold && ! $is_dismissed ) : ?> 226 if ( isset( $statuses[ $current_locale ] ) && absint( $statuses[ $current_locale ] ) <= $threshold && ! $is_dismissed ) : 227 $contribute_url = 'https://translate.wordpress.org/projects/meta/wp15/'; 228 229 if ( isset( $mapped_locales[ $current_locale ] ) ) { 230 $contribute_url .= $mapped_locales[ $current_locale ] . '/default'; 231 } 232 ?> 221 233 <div class="wp15-locale-notice"> 222 234 <p> 223 235 <?php 224 236 printf( 237 /* translators: %s placeholder is a URL. */ 225 238 wp_kses_post( __( 'The translation for this locale is incomplete. Help us get to 100 percent by <a href="%s">contributing a translation</a>.', 'wp15' ) ), 226 esc_url( sprintf( 227 'https://translate.wordpress.org/projects/meta/wp15/%s/default', 228 strtolower( str_replace( '_', '-', $current_locale ) ) 229 ) ) 239 esc_url( $contribute_url ) 230 240 ); 231 241 ?>
Note: See TracChangeset
for help on using the changeset viewer.