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 1160801 commit b010192Copy full SHA for b010192
edge-runtime/lib/util.ts
@@ -29,11 +29,13 @@ export const addBasePath = (path: string, basePath?: string) => {
29
return path
30
}
31
32
+// add locale prefix if not present, allowing for locale fallbacks
33
export const addLocale = (path: string, locale?: string) => {
34
if (
35
locale &&
36
path.toLowerCase() !== `/${locale.toLowerCase()}` &&
- !path.toLowerCase().startsWith(`/${locale.toLowerCase()}/`)
37
+ !path.toLowerCase().startsWith(`/${locale.toLowerCase()}/`) &&
38
+ !path.toLowerCase().startsWith(`/${locale.toLowerCase()}-`)
39
) {
40
return `/${locale}${path}`
41
0 commit comments