Skip to content

Commit

Permalink
Correctly render og:locale (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
dejagersh authored Oct 30, 2023
1 parent 6d8e36c commit 04a3d30
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Support/SEOData.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct(
public ?string $canonical_url = null,
) {
if ( $this->locale === null ) {
$this->locale = Str::of(app()->getLocale())->lower()->kebab();
$this->locale = app()->getLocale();
}
}

Expand Down
9 changes: 8 additions & 1 deletion tests/Feature/Tags/OpenGraphTagsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,11 @@
->assertSee('<meta property="article:section" content="Laravel">', false)
->assertSee('<meta property="article:tag" content="PHP">', false)
->assertSee('<meta property="article:tag" content="Laravel">', false);
});
});

it('can correctly render locale tags', function () {
config()->set('app.locale', 'en_GB');

get(route('seo.test-plain'))
->assertSee('<meta property="og:locale" content="en_GB">', false);
});

0 comments on commit 04a3d30

Please sign in to comment.