Skip to content

Commit cdafb21

Browse files
committed
fix:adjustment regex helpers/current_path_locale
Signed-off-by: Crisciany Souza <[email protected]>
1 parent dec92d7 commit cdafb21

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/helpers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ function current_path_locale($page): string
2929
$path = trim($page->getPath(), '/');
3030

3131
/**
32-
* - [a-z]{2,3} language code
32+
* - [a-z]{2} language code
3333
* - [A-Z]{2} region code
3434
*
3535
* @var string $locale_regex
3636
*/
37-
$locale_regex = '/^(?<locale>(?:[a-z]{2,3}-[A-Z]{2})|(?:[a-z]{2,3}))(?:[^a-zA-Z]|$)/';
37+
$locale_regex = '/^(?<locale>(?:[a-z]{2}-[A-Z]{2})|(?:[a-z]{2}))(?:[^a-zA-Z]|$)/';
3838

3939
preg_match($locale_regex, $path, $matches);
4040

0 commit comments

Comments
 (0)