@ -37,6 +37,8 @@ export const dict: Record<string, TranslationEntry> = {
|
||||
|
||||
// ── 页脚 / Footer ──
|
||||
'© 2026 PORTFOLIO STUDIO. ALL RIGHTS RESERVED.': { cn: '© 2026 PORTFOLIO STUDIO. 保留所有权利。' },
|
||||
|
||||
'Runway looks': {cn: '秀场造型'}
|
||||
};
|
||||
|
||||
/** 把 {name} 形式的占位符替换成参数值。 */
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { getLocaleByPath } from 'astro:i18n';
|
||||
import { getLocaleByPath, getRelativeLocaleUrl } from 'astro:i18n';
|
||||
import { DEFAULT_LOCALE, LOCALES, type Locale } from '@/i18n/config';
|
||||
import { translate } from '@/i18n/dictionary';
|
||||
|
||||
@ -38,7 +38,7 @@ export function useTranslations(locale: Locale) {
|
||||
export function getI18n(Astro: { currentLocale?: string | undefined }) {
|
||||
const locale = (Astro.currentLocale as Locale) ?? DEFAULT_LOCALE;
|
||||
const { t } = useTranslations(locale);
|
||||
return { locale, t };
|
||||
return { locale, t, getRelativeLocaleUrl };
|
||||
}
|
||||
|
||||
export { LOCALES, DEFAULT_LOCALE };
|
||||
|
||||
Reference in New Issue
Block a user