update
Some checks failed
deploy / deploy (push) Has been cancelled

This commit is contained in:
toom1996
2026-08-19 20:42:42 +08:00
parent e1552feb8c
commit 975c55feb2
8 changed files with 568 additions and 55 deletions

View File

@ -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} 形式的占位符替换成参数值。 */

View File

@ -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 };