Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
I18n for vue3.
Note:
Issue/PR is welcomed, I'll response as soon as possible.
If you like this pack, can give a star.
npm install vue3-i18n --save
// i18n.js
import { createI18n } from "vue3-i18n";
const messages = {
en: {
menu: ["Home"],
test: "test",
},
zh: {
menu: ["首页"],
test: "测试",
},
};
const i18n = createI18n({
locale: "en",
messages: messages,
});
export default i18n;
// main.js
import { createApp } from "vue";
import i18n from "./i18n";
const app = createApp(App);
app
.use(i18n)
.mount("#app");
<p>{{ $t("test") }}</p>
<!-- array -->
<p>{{ $t("test[1]") }}</p>
<!-- object -->
<p>{{ $t("test.a") }}</p>
<script>
import { useI18n } from "vue3-i18n";
export default {
setup() {
const i18n = useI18n();
const setLocale = (lang) => {
i18n.setLocale(lang);
};
return {
setLocale,
};
},
};
</script>
MIT
FAQs
A i18n plugin for Vue3
The npm package vue3-i18n receives a total of 559 weekly downloads. As such, vue3-i18n popularity was classified as not popular.
We found that vue3-i18n demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.