- Timestamp:
- 04/06/2018 10:34:48 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wp15.wordpress.net/public_html/content/mu-plugins/locales.php
r7039 r7057 58 58 'locale-switcher', 59 59 WP_CONTENT_URL . '/mu-plugins/assets/locale-switcher.js', 60 array( 'jquery', 'select2' ),60 array( 'jquery', 'select2', 'utils' ), 61 61 1, 62 62 true … … 69 69 'locale' => get_locale(), 70 70 'dir' => is_rtl() ? 'rtl' : 'ltr', 71 'cookie' => array( 72 'expires' => YEAR_IN_SECONDS, 73 'cpath' => SITECOOKIEPATH, 74 'domain' => '', 75 'secure' => true, 76 ) 71 77 ) 72 78 ); … … 149 155 wp_enqueue_script( 'locale-switcher' ); 150 156 } 157 158 /** 159 * Prints markup for a notice when a locale isn't fully translated. 160 */ 161 function locale_notice() { 162 $current_locale = get_locale(); 163 $status = get_option( 'wp15_locale_status', array() ); 164 $threshold = 90; 165 $is_dismissed = ! empty( $_COOKIE['wp15-locale-notice-dismissed'] ); 166 167 if ( isset( $status[ $current_locale ] ) && absint( $status[ $current_locale ] ) <= $threshold && ! $is_dismissed ) : ?> 168 <div class="wp15-locale-notice"> 169 <p> 170 <?php 171 printf( 172 wp_kses_post( __( 'The translation for this locale is incomplete. Help us get to 100%% by <a href="%s">contributing a translation</a>.', 'wp15' ) ), 173 esc_url( sprintf( 174 'https://translate.wordpress.org/projects/meta/wp15/%s/default', 175 strtolower( str_replace( '_', '-', $current_locale ) ) 176 ) ) 177 ); 178 ?> 179 </p> 180 <button type="button" class="wp15-locale-notice-dismiss"> 181 <span class="screen-reader-text"><?php _e( 'Dismiss this notice.' ); ?></span> 182 </button> 183 </div> 184 <?php endif; 185 }
Note: See TracChangeset
for help on using the changeset viewer.