Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/FrontLabsOfficial/vue-i18n-lite
🌐 Lightweight, minimal internationalization plugin for Vue.js
https://github.com/FrontLabsOfficial/vue-i18n-lite
vuejs
Last synced: 26 days ago
JSON representation
🌐 Lightweight, minimal internationalization plugin for Vue.js
- Host: GitHub
- URL: https://github.com/FrontLabsOfficial/vue-i18n-lite
- Owner: FrontLabsOfficial
- License: mit
- Created: 2021-05-01T07:15:15.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-12-18T04:32:18.000Z (5 months ago)
- Last Synced: 2024-03-30T13:21:20.950Z (about 2 months ago)
- Topics: vuejs
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/vue-i18n-lite
- Size: 223 KB
- Stars: 12
- Watchers: 5
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Lists
- awesome-vue - vue-i18n-lite - A super lightweight and minimal plugin that introduces internationalization into your Vue.js app with a simple API. (Components & Libraries / Utilities)
- awesome-vue - vue-i18n-lite - A super lightweight and minimal plugin that introduces internationalization into your Vue.js app with a simple API. (Components & Libraries / Utilities)
- awesome-vue - vue-i18n-lite - A super lightweight and minimal plugin that introduces internationalization into your Vue.js app with a simple API. (Components & Libraries / Utilities)
README
## 🔥️ Vue I18n Lite
A super lightweight and minimal plugin that introduces internationalization into your Vue.js app with a simple API
## 🚀 Usage
### Plugin```ts
import { createApp } from 'vue';
import { createI18n } from 'vue-i18n-lite';
import App from './App.vue';const i18n = createI18n({
locale: 'en',
fallbackLocale: 'en',
messages: {
'en': {
home: 'Home'
}
}
})const app = createApp(App);
app.use(i18n);```
### Composition API```ts
import { useI18n } from 'vue-i18n-lite';export default {
setup() {
const i18n = useI18n()
i18n.createI18n({
locale: 'en',
fallbackLocale: 'en',
messages: {
'en': {
home: 'Home'
}
}
})const { current, changeLocale } = i18n
return {
current,
changeLocale
}
}
}
```## 📦 Install
```bash
yarn add vue-i18n-lite
```### CDN
```html
```
It will be exposed to global as `window.VueI18nLite`
## Changelog
Detail changes for each release are documented in the [`CHANGELOG.md file`](https://github.com/FrontLabsOfficial/vue-i18n-lite/blob/master/CHANGELOG.md).
## ❤️ Thanks
This project is inspired by the following awesome projects.
- [dot-prop](https://github.com/sindresorhus/dot-prop)
- [vue-i18n](https://github.com/kazupon/vue-i18n)## 📄 License
MIT License © 2021 [Erik Pham](https://github.com/erikpham)