diff --git a/modules/widgets/follow-button.php b/modules/widgets/follow-button.php index 54cb5f187d55b..82b7a1c74afd2 100644 --- a/modules/widgets/follow-button.php +++ b/modules/widgets/follow-button.php @@ -26,6 +26,21 @@ public function widget( $args, $instance ) { $attributes = array(); $instance = wp_parse_args( (array) $instance, array( 'show_name' => 1, 'show_count' => 0 ) ); + $wpcom_locale = get_locale(); + + if ( ! class_exists( 'GP_Locales' ) ) { + if ( defined( 'JETPACK__GLOTPRESS_LOCALES_PATH' ) && file_exists( JETPACK__GLOTPRESS_LOCALES_PATH ) ) { + require JETPACK__GLOTPRESS_LOCALES_PATH; + } + } + + if ( class_exists( 'GP_Locales' ) ) { + $wpcom_locale_object = GP_Locales::by_field( 'wp_locale', get_locale() ); + if ( $wpcom_locale_object instanceof GP_Locale ) { + $wpcom_locale = $wpcom_locale_object->slug; + } + } + if ( empty( $instance['show_name'] ) ) { $attributes[] = 'data-show-blog-name="false"'; } @@ -41,7 +56,7 @@ public function widget( $args, $instance ) { class="wordpress-follow-button" href="" data-blog="" - data-lang="" + data-lang="" >