vite-auto-i18n
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

vite-auto-i18n

Auto wrap up i18n function

NPM version NPM Downloads

  • [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
}

/vite-auto-i18n/

    Package Sidebar

    Install

    npm i vite-auto-i18n

    Weekly Downloads

    0

    Version

    0.1.0

    License

    MIT

    Unpacked Size

    10.1 kB

    Total Files

    6

    Last publish

    Collaborators

    • caoxie