| @@ -191,18 +191,14 @@ | ||
| 191 | 191 | |
| 192 | 192 | $third_party_cookie_check_iframe = '<span style="display:none;"><iframe class="jetpack-notes-cookie-check" src="https://widgets.wp.com/3rd-party-cookie-check/index.html"></iframe></span>'; |
| 193 | 193 | |
| 194 | 194 | $title = self::get_notes_markup(); |
| 195 | - | |
| 196 | - // The default fallback is `en_US`. Remove underscore if present, noting that lang codes can be more than three chars. | |
| 197 | - $user_locale = strtolower( explode( '_', $user_locale, 2 )[0] ); | |
| 198 | - | |
| 199 | 195 | $wp_admin_bar->add_menu( |
| 200 | 196 | array( |
| 201 | 197 | 'id' => 'notes', |
| 202 | 198 | 'title' => $title, |
| 203 | 199 | 'meta' => array( |
| 204 | - 'html' => '<div id="wpnt-notes-panel2" class="intrinsic-ignore" style="display:none" lang="' . esc_attr( $user_locale ) . '" dir="' . ( is_rtl() ? 'rtl' : 'ltr' ) . '"><div class="wpnt-notes-panel-header"><span class="wpnt-notes-header">' . __( 'Notifications', 'jetpack' ) . '</span><span class="wpnt-notes-panel-link"></span></div></div>' . $third_party_cookie_check_iframe, | |
| 200 | + 'html' => '<div id="wpnt-notes-panel2" class="intrinsic-ignore" style="display:none" lang="' . esc_attr( strtolower( substr( $user_locale, 0, 2 ) ) ) . '" dir="' . ( is_rtl() ? 'rtl' : 'ltr' ) . '"><div class="wpnt-notes-panel-header"><span class="wpnt-notes-header">' . __( 'Notifications', 'jetpack' ) . '</span><span class="wpnt-notes-panel-link"></span></div></div>' . $third_party_cookie_check_iframe, | |
| 205 | 201 | 'class' => 'menupop', |
| 206 | 202 | ), |
| 207 | 203 | 'parent' => 'top-secondary', |
| 208 | 204 | 'href' => 'https://wordpress.com/notifications', |