We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dec92d7 commit cdafb21Copy full SHA for cdafb21
src/helpers.php
@@ -29,12 +29,12 @@ function current_path_locale($page): string
29
$path = trim($page->getPath(), '/');
30
31
/**
32
- * - [a-z]{2,3} language code
+ * - [a-z]{2} language code
33
* - [A-Z]{2} region code
34
*
35
* @var string $locale_regex
36
*/
37
- $locale_regex = '/^(?<locale>(?:[a-z]{2,3}-[A-Z]{2})|(?:[a-z]{2,3}))(?:[^a-zA-Z]|$)/';
+ $locale_regex = '/^(?<locale>(?:[a-z]{2}-[A-Z]{2})|(?:[a-z]{2}))(?:[^a-zA-Z]|$)/';
38
39
preg_match($locale_regex, $path, $matches);
40
0 commit comments