vite-auto-i18n
v0.1.0
Published
Auto wrap up i18n function
Downloads
2
Readme
vite-auto-i18n
Auto wrap up i18n function
- [x] React
- [x] Vue with
.tsx
- [ ] Vue with
.vue
Install
npm i -D vite-auto-i18n
Usage
import autoI18n from 'vite-auto-i18n'
export default {
plugins: [
autoI18n(/* options */)
]
}
Example
See 👉🏻 example
API
export interface I18nOptions {
filter?: (text: string, id: string) => boolean | void
filterFile?: (id: string) => boolean | void
/**
* @default '@/i18n'
*/
importPath?: (id: string) => string
/**
* @default 'default'
*/
importMember?: (id: string) => string
/**
* @default '_i18n_t_'
*/
i18nFnName?: (id: string) => string
}