artesaos / seotools

SEO Tools for Laravel
MIT License
3.11k stars 503 forks source link

Add class="notranslate" to meta tag #139

Closed bcoelhodev closed 5 years ago

bcoelhodev commented 5 years ago

Hi,

I don't want the Google translate the meta tags, so i need add class="notranslate" attribute to the meta tags. It's possible?

Like this <title class="notranslate">Page title</title>

peterangelov commented 5 years ago

Fast (maybe little bit dirty) solution? If you don't want to modify this package (as not all who use it might want this feature) you could modify the output in the template.

{!! str_replace('<title>', '<title class="notranslate">', SEOMeta::generate()) !!}
peterangelov commented 5 years ago

@vinicius73 hi, I have prepared fix for this but I don't know how to test it properly. If the addition of "notranslate" class is controlled by config value, I can not change it during unit test, as the config values are set when SEOMeta class is added to service container as singleton. Any idea?

vinicius73 commented 5 years ago

Closed by #178