0.3.13 • Published 11 months ago

@instance-oom/i18n-locales v0.3.13

Weekly downloads
-
License
MIT
Repository
-
Last release
11 months ago

💿 Installation

npm i @instance-oom/i18n-locales
// vite.config.ts
import VueI18nLocalesPlugin from '@instance-oom/i18n-locales/vite';

export default defineConfig({
  plugins: [
    VueI18nLocalesPlugin({ dir: path.resolve(__dirname, './src/locales') }),
    vue()
  ],
})
// xxx.ts
import { createApp } from 'vue'
import { createI18n } from 'vue-i18n'
/*
 * All i18n resources specified in the plugin `include` option can be loaded
 * at once using the import syntax
 */
import messages from '@instance-oom/i18n-locales/messages';
import { createI18nLocales } from '@instance-oom/i18n-locales/locales';

const i18n = createI18n({
  locale: 'en',
  messages: messages
})

const app = createApp()
app
  .use(createI18nLocales())
  .use(i18n)
  .mount('#app');
<template>
  <div>
    {{ $t(LOCALES.xxx) }}
  </div>
</template>
0.3.13

11 months ago

0.1.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago