@@ -823,13 +823,31 @@ function likes_master() {
823
823
if ( is_ssl () )
824
824
$ protocol = 'https ' ;
825
825
826
- $ locale = ( '' == get_locale () || 'en ' == get_locale () ) ? '' : '&lang= ' . strtolower ( substr ( get_locale (), 0 , 2 ) );
826
+ if ( version_compare ( $ GLOBALS ['wp_version ' ], '3.8-alpha ' , '>= ' ) ) {
827
+ add_filter ( 'mp6_enabled ' , '__return_true ' , 97 );
828
+ }
829
+
830
+ $ _locale = get_locale ();
831
+
832
+ // We have to account for WP.org vs WP.com locale divergence
833
+ if ( $ this ->in_jetpack ) {
834
+ if ( ! defined ( 'JETPACK__GLOTPRESS_LOCALES_PATH ' ) || ! file_exists ( JETPACK__GLOTPRESS_LOCALES_PATH ) ) {
835
+ return false ;
836
+ }
837
+
838
+ require_once JETPACK__GLOTPRESS_LOCALES_PATH ;
839
+
840
+ $ gp_locale = GP_Locales::by_field ( 'wp_locale ' , $ _locale );
841
+ $ _locale = isset ( $ gp_locale ->slug ) ? $ gp_locale ->slug : '' ;
842
+ }
843
+
844
+ $ likes_locale = ( '' == $ _locale || 'en ' == $ _locale ) ? '' : '&lang= ' . strtolower ( $ _locale );
827
845
828
846
// @todo: Remove this opt-out filter in the future
829
847
if ( apply_filters ( 'wpl_sharing_2014_1 ' , true ) ) {
830
- $ src = sprintf ( '%1$s://widgets.wp.com/likes/master.html?ver=%2$s#ver=%2$s%3$s&mp6=%4$d ' , $ protocol , $ this ->version , $ locale , apply_filters ( 'mp6_enabled ' , 0 ) );
848
+ $ src = sprintf ( '%1$s://widgets.wp.com/likes/master.html?ver=%2$s#ver=%2$s%3$s&mp6=%4$d ' , $ protocol , $ this ->version , $ likes_locale , apply_filters ( 'mp6_enabled ' , 0 ) );
831
849
} else {
832
- $ src = sprintf ( '%1$s://widgets.wp.com/likes/master-legacy.html?ver=%2$s#ver=%2$s%3$s&mp6=%4$d ' , $ protocol , $ this ->version , $ locale , apply_filters ( 'mp6_enabled ' , 0 ) );
850
+ $ src = sprintf ( '%1$s://widgets.wp.com/likes/master-legacy.html?ver=%2$s#ver=%2$s%3$s&mp6=%4$d ' , $ protocol , $ this ->version , $ likes_locale , apply_filters ( 'mp6_enabled ' , 0 ) );
833
851
}
834
852
835
853
$ likersText = wp_kses ( __ ( '<span>%d</span> bloggers like this: ' , 'jetpack ' ), array ( 'span ' => array () ) );
0 commit comments