--- import { getNextLangUrl, getNextSupportedLangUrl } from '@/i18n/path' import { isPostPage, isTagPage } from '@/utils/page' interface Props { supportedLangs: string[] } const { supportedLangs } = Astro.props const currentPath = Astro.url.pathname const isPost = isPostPage(currentPath) const isTag = isTagPage(currentPath) // Check if only the supported language switch list is used const useSupportedLangs = isPost || (isTag && supportedLangs.length > 0) // Choose a language switch list according to the page type const nextUrl = useSupportedLangs ? getNextSupportedLangUrl(currentPath, supportedLangs) // Switch between supported languages : getNextLangUrl(currentPath) // Switch between all languages ---