Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Let me start off by saying this module saved me the work of implementing this myself so thanks for that.
But i'm using multiple languages on our websites(using i18n). Therefore it would seem pretty useful to me for anonymous users to see the tweetbutton in the language they're viewing the website in.
A simple modification to the 'tweetbutton_get_attributes' function accomplishes this.
I just added the following code to the function and modified the $attributes parameter:
global $language
$attributes['data-lang'] = $language->language;
Comments
Comment #1
y_h CreditAttribution: y_h commentedMake that
I was a little too fast on adding the code :)