8 lines
257 B
TypeScript
8 lines
257 B
TypeScript
import type { LocaleBundle } from '~/types/locale'
|
|
import { pickLocale } from '~/utils/pick-locale'
|
|
|
|
export function useLocalized<T>(bundle: LocaleBundle<T>) {
|
|
const { locale } = useSiteLocale()
|
|
return computed(() => pickLocale(bundle, locale.value))
|
|
}
|