@easy_vscode/i18n
v1.2.7
Published
I18n of Easy Vscode
Downloads
3
Readme
@easy_vscode/i18n
I18n for easy-vscode
Usage
Add languages resource:
import { addResources } from '@easy_vscode/i18n'
import en from './locales/en'
import zh from './locales/zh'
addResources({
en: {
translation: en
},
zh: {
translation: zh
}
})
export * from './constants'
Translate:
import i18n, { useTranslationValues } from '@easy_vscode/i18n'
import { K } from '../../i18n'
// Batch translate values
const [TYPE, BACKGROUND] = useTranslationValues(K.TYPE, K.BACKGROUND)
// Translate value directly
const label = i18n.t(K.LABEL)