mirror of
https://github.com/zen-browser/www.git
synced 2025-07-07 08:55:32 +02:00
fix(i18n): fix get path for external links (#665)
This commit is contained in:
parent
1b129bbe6c
commit
350edb5b73
1 changed files with 5 additions and 0 deletions
|
@ -16,6 +16,11 @@ export type Locale = (typeof locales)[number]
|
|||
export const getPath =
|
||||
(locale?: Locale): ((arg0: string) => string) =>
|
||||
(path: string) => {
|
||||
// Return external URLs unchanged
|
||||
if (path.startsWith('http://') || path.startsWith('https://')) {
|
||||
return path
|
||||
}
|
||||
|
||||
// Check if path already contains any locale prefix
|
||||
const existingLocale = locales.find(l => path.startsWith(`/${l}/`))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue