Add admin site settings sections and locale defaults
This commit is contained in:
+9
-1
@@ -29,11 +29,19 @@ export function stripLocalePrefix(pathname: string): string {
|
||||
}
|
||||
|
||||
export function getLocalizedPath(locale: string, pathname = "/"): string {
|
||||
return getLocalizedPathWithDefault(locale, pathname, routing.defaultLocale);
|
||||
}
|
||||
|
||||
export function getLocalizedPathWithDefault(
|
||||
locale: string,
|
||||
pathname = "/",
|
||||
defaultLocale: AppLocale = routing.defaultLocale,
|
||||
): string {
|
||||
const localeKey = resolveLocale(locale);
|
||||
const normalizedPath = pathname === "" ? "/" : pathname;
|
||||
const strippedPath = stripLocalePrefix(normalizedPath);
|
||||
|
||||
if (localeKey === routing.defaultLocale) {
|
||||
if (localeKey === defaultLocale) {
|
||||
return strippedPath;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user