diff --git a/src/components/Comments/Waline.astro b/src/components/Comments/Waline.astro index 1fd6b72..cf2ce7c 100644 --- a/src/components/Comments/Waline.astro +++ b/src/components/Comments/Waline.astro @@ -2,18 +2,6 @@ import { defaultLocale, themeConfig } from '@/config' import { walineLocaleMap } from '@/i18n/config' -// Get the language code of Waline -function getWalineLang(currentPath: string, defaultLocale: string): string { - // Extract language code from path - const pathLang = Object.keys(walineLocaleMap).find(code => - currentPath.startsWith(`/${code}/`), - ) - // Return found path language or default language - const lang = pathLang || defaultLocale - return walineLocaleMap[lang as keyof typeof walineLocaleMap] -} - -const walineLang = getWalineLang(Astro.url.pathname, defaultLocale) const { waline: { serverURL = '', emoji = [], search = false, imageUploader = false } = {} } = themeConfig.comment ?? {} --- @@ -27,23 +15,31 @@ const { waline: { serverURL = '', emoji = [], search = false, imageUploader = fa