I am utilizing the social-share-button gem to share blog posts on social media. The website has been internationalized, making it bilingual (English and German). Everything is functioning correctly, but I encounter an issue with the social share buttons when switching to German:
show.html.erb
<div id="share_box">
<% if I18n.locale == :de %>
<h3 class="share_title wow bounceIn" data-wow-duration="1400ms" data-wow-delay="200ms">Teile diesen Beitrag</h3>
<% else %>
<h3 class="share_title wow bounceIn" data-wow-duration="1400ms" data-wow-delay="200ms">Share this Post</h3>
<% end %>
<div class="wow fadeIn" data-wow-duration="1400ms" data-wow-delay="200ms">
<% if I18n.locale == :de %>
<%= social_share_button_tag(@post.title_de, :url => post_url(@post)) %>
<% else %>
<%= social_share_button_tag(@post.title_en, :url => post_url(@post)) %>
<% end %>
</div>
</div>
English:
https://i.sstatic.net/woAdp.png
<a rel="nofollow " data-site="twitter" class="ssb-icon ssb-twitter" onclick="return SocialShareButton.share(this);" title="Share to Twitter" href="#"></a>
German:
https://i.sstatic.net/mTRVy.png
<a rel="nofollow " data-site="twitter" class="ssb-icon ssb-twitter" onclick="return SocialShareButton.share(this);" title="<span class=" translation_missing"="">Share To" href="#"></a>
There appears to be a translation missing inside the gem causing this undesirable text to appear! To address this issue, I want to hide the text using CSS. However, I am struggling to target the text!
This is what I have attempted so far:
1) Had zero effect
.translation_missing {
display: none !important;
}
2) The whole icons disappeared
a[title] {
display: none !important;
}
3) Tried to get rid of it with JavaScript (Only the hover text disappeared)
$(document).ready(function() {
$("a").removeAttr("title");
});
Hover text was:
<span class=
Element on Inspect with JavaScript:
<a rel="nofollow " data-site="twitter" class="ssb-icon ssb-twitter" onclick="return SocialShareButton.share(this);" translation_missing"="">Share To" href="#"></a>
If anyone has any suggestions on how to solve this issue and remove this unwanted text, your help would be greatly appreciated! Thank you in advance!