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