Skip to content

Instantly share code, notes, and snippets.

@rubenrivera
Last active August 20, 2018 16:37
Show Gist options
  • Save rubenrivera/12931eb6dc266f7074b22fa8b3f17d1f to your computer and use it in GitHub Desktop.
Save rubenrivera/12931eb6dc266f7074b22fa8b3f17d1f to your computer and use it in GitHub Desktop.
Functión autoejecutable para evitar la traducción del nombre de un complemento en el título de un post de Blogger. Inclúyase al inicio del post en la vista HTML y modifique los valores de addonName y newAddonName
<script>
(function(){
var addonName = 'Visor de Registros';
var newAddonName = 'Visor&nbsp;de&nbsp;Registros';
var dTitle = document.querySelector('title');
dTitle.classList.add('notranslate');
dTitle.setAttribute('translate','no');
var eTitle = document.querySelector('.post-title,.entry-title');
var title = eTitle.innerHTML.replace(addonName,'<span class="notranslate" translate="no">newAddonName</span>');
eTitle.innerHTML = title;
})();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment