diff --git a/src/SEOTools/SEOMeta.php b/src/SEOTools/SEOMeta.php index 072e7d9..6bd673f 100644 --- a/src/SEOTools/SEOMeta.php +++ b/src/SEOTools/SEOMeta.php @@ -146,7 +146,7 @@ public function generate($minify = false) $html = []; if ($title) { - $html[] = "$title"; + $html[] = Arr::get($this->config, 'add_notranslate_class', false) ? "$title" : "$title"; } if ($description) { diff --git a/src/resources/config/seotools.php b/src/resources/config/seotools.php index ff93cb5..f61ad97 100644 --- a/src/resources/config/seotools.php +++ b/src/resources/config/seotools.php @@ -27,6 +27,8 @@ 'pinterest' => null, 'yandex' => null, ], + + 'add_notranslate_class' => false, ], 'opengraph' => [ /* diff --git a/tests/SEOTools/SEOMetaTest.php b/tests/SEOTools/SEOMetaTest.php index a3646cf..4483e7f 100644 --- a/tests/SEOTools/SEOMetaTest.php +++ b/tests/SEOTools/SEOMetaTest.php @@ -289,4 +289,20 @@ public function test_utf8() $this->assertEquals($description, $this->seoMeta->getDescription()); $this->setRightAssertion($fullHeader); } + + public function test_it_can_add_notranslate_class_to_title() + { + $this->seoMeta = new SEOMeta(new \Illuminate\Config\Repository([ + 'add_notranslate_class' => true, + 'defaults' => [ + 'title' => 'It\'s Over 9000!', + 'description' => 'For those who helped create the Genki Dama', + ], + ])); + + $expected = "It's Over 9000!"; + $expected .= ""; + + $this->setRightAssertion($expected); + } }