Initial commit: New MoreminiMore website with fresh design

This commit is contained in:
MoreminiMore
2026-04-22 01:59:05 +07:00
commit 76409638cc
14010 changed files with 2052041 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
function parseI18nUrl(url, defaultLocale, locales, base) {
if (!url.startsWith(base)) {
return void 0;
}
let s = url.slice(base.length);
if (!s || s === "/") {
return { locale: defaultLocale, path: "/" };
}
if (s[0] !== "/") {
s = "/" + s;
}
const locale = s.split("/")[1];
if (locale in locales) {
let path = s.slice(1 + locale.length);
if (!path) {
path = "/";
}
return { locale, path };
}
return { locale: defaultLocale, path: s };
}
export {
parseI18nUrl
};