. This was the last straw and I decided to write this article to help those who did not find the time to figure out the question. As you can see, the browser defined the localization as ru_Ru and in accordance with this, on the facebook button, replaced the signature “like” with “I like” . Of course, I am grateful for such care, but as can be seen in the picture - it adversely affects the appearance and functionality. As a result, I do not have the opportunity to see the counter itself, which displays the number of likes. The problem is global in nature, as I have met more than once, and it always looks at least not aesthetically pleasing.'//connect.facebook.net/en_US/all.js'; for XFBML . And src="http://www.facebook.com/plugins/like.php?locale=en_US&..." for the IFRAME . It's all very simple. But what to do, you need to use another option. For example, if we want to insert a button code using HTML5 < div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/ru_RU/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> js.src = "//connect.facebook.net/ru_RU/all.js#xfbml=1"; it can be seen that the code that was generated on the facebook site already has localization ru_RU . Replace with en_US and get a neat button with a signature like . <!-- AddThis Button BEGIN --> <div class="addthis_toolbox addthis_default_style "> <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a> <a class="addthis_counter addthis_pill_style"></a> </div> <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4f424c4c2820f671"></script> <!-- AddThis Button END -->
<!-- AddThis Button BEGIN --> <div class="addthis_toolbox addthis_default_style "> <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a> <a class="addthis_counter addthis_pill_style"></a> </div> <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4f424c4c2820f671"></script> <!-- AddThis Button END -->
a class="addthis_button_facebook_like" add the fb:like: attribute to the tag a class="addthis_button_facebook_like" fb:like: < > fb:like: < > . And the attribute name can be found in the documentation directly to the facebook plugin on their website. Outwardly, everything is very easy to follow the necessary attribute to the facebook site and successfully find it there. Surprisingly in the description of the attributes there is no need. For some reason, the developers did not consider it necessary to specify the attribute for the choice of localization separately, but let it be on their conscience. And so, after some thought, I decided to try to specify the following fb:like:locale="en_US" attribute fb:like:locale="en_US" . As a result, this not obvious opportunity helped. Now the AddThis script in the IFRAME for the facebook button will be passed to the desired parameter, and the button will become English.Source: https://habr.com/ru/post/138587/
All Articles