ice/packages/plugin-i18n
ClarkXia 72bfa88d17
Publish canary / Check Changeset exists (push) Has been cancelled Details
CI / build (16.x, ubuntu-latest) (push) Has been cancelled Details
CI / build (16.x, windows-latest) (push) Has been cancelled Details
CI / build (18.x, ubuntu-latest) (push) Has been cancelled Details
CI / build (18.x, windows-latest) (push) Has been cancelled Details
Version / Version (16) (push) Has been cancelled Details
Publish canary / Publish Canary (18) (push) Has been cancelled Details
chore: update version
2025-07-08 19:24:32 +08:00
..
src feat: i18n plugin (#6149) 2023-04-24 10:18:53 +08:00
CHANGELOG.md chore: update versions (#7077) 2025-06-24 10:10:55 +08:00
README.md feat: i18n plugin (#6149) 2023-04-24 10:18:53 +08:00
build.config.mts fix: source map url in prod files but the sourceMap files not published (#6511) 2023-09-06 10:09:59 +08:00
package.json chore: update version 2025-07-08 19:24:32 +08:00
runtime.d.ts feat: i18n plugin (#6149) 2023-04-24 10:18:53 +08:00
tsconfig.json feat: i18n plugin (#6149) 2023-04-24 10:18:53 +08:00
types.d.ts feat: i18n plugin (#6149) 2023-04-24 10:18:53 +08:00

README.md

@ice/plugin-i18n

组件功能描述

Install

$ npm i @ice/plugin-i18n --save-dev

Usage

import { defineConfig } from '@ice/app';
import i18n from '@ice/plugin-i18n';

export default defineConfig({
  plugins: [
    i18n({
      locales: ['zh-CN', 'en-US'],
      defaultLocale: 'zh-CN',
    }),
  ],
});

Options

locales

  • type: string[]

The locales you want to support in your app. This option is required.

defaultLocale

  • type: string

The default locale you want to be used when visiting a non-locale prefixed path. This option is required.

autoRedirect

  • type: boolean
  • default: true

Redirect to the preferred locale automatically. This option should be used with the middleware. If you deploy your application in production, you should read the example for more detail.