import { defineSyncApi } from '../../helpers/api' import { useI18n } from '@dcloudio/uni-core' import { BuiltInLocale } from '@dcloudio/uni-i18n' export const getLanguage = defineSyncApi( 'getLanguage', () => { const i18n = useI18n() return i18n.getLocale() } ) export const setLanguage = defineSyncApi( 'setLanguage', (locale) => { const i18n = useI18n() return i18n.setLocale(locale as BuiltInLocale) } )