@blink-the-ui/i18n
v0.0.1-alpha.22
Published
i18n support for blink-the-ui
Maintainers
Readme
@blink-the-ui/i18n
Internationalization support for blink-the-ui components.
Installation
npm install @blink-the-ui/i18nUsage
import { createApp } from 'vue';
import { i18n } from '@blink-the-ui/i18n';
const app = createApp(App);
app.use(i18n);
app.mount('#app');Adding New Languages
- Create a new folder under
src/localeswith the language code (e.g.frfor French) - Create a JSON file with the translation keys
- Import and register the new language in
src/index.ts
Switching Languages
import { i18n } from '@blink-the-ui/i18n';
// Switch to Chinese
i18n.global.locale.value = 'zh';
// Switch to English
i18n.global.locale.value = 'en';