--- import '../styles/global.css' import { getLocaleFromUrl, useTranslations, useTranslatedPath } from '../i18n/utils' import { LOCALES, LOCALE_NAMES, isLocaleSegment } from '../i18n/config' const { title = 'Portfolio Studio', activeCategory = 'Shows', activeNavTab, activeThemePalette = null, } = Astro.props; const locale = getLocaleFromUrl(Astro.url) const { t } = useTranslations(locale) const translatePath = useTranslatedPath(locale) // 当前路径去掉语言前缀,用于语言切换器拼出「同页面、另一语言」的链接 const _segs = Astro.url.pathname.split('/').filter(Boolean); const _stripped = _segs.length > 0 && isLocaleSegment(_segs[0]) ? '/' + _segs.slice(1).join('/') : Astro.url.pathname; const currentPath = _stripped === '' ? '/' : _stripped; const categories: { label: string; value: PortfolioCategory | 'Trending Colors' }[] = [ { label: 'x', value: 'x' }, { label: 'Backstage', value: 'Backstage' }, { label: 'Events', value: 'Events' }, { label: 'Street', value: 'Street' }, { label: 'Trending Colors', value: 'Trending Colors' }, ]; ---