You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Integrates with [i18next](https://www.i18next.com) to enable internationalization of enum labels.
10
+
> Integrates [next-international](https://next-international.vercel.app) to achieve internationalization of enum labels
11
11
12
12
## Introduction
13
13
14
-
`@enum-plus/plugin-i18next` is a plugin for [enum-plus](https://github.com/shijistar/enum-plus) that automatically integrates with [i18next](https://www.i18next.com/) to achieve internationalization of enum labels. It allows you to use i18next localization keys in your enum definitions, which are dynamically displayed as translated text for the current language.
14
+
`@enum-plus/plugin-next-international` is a plugin for [enum-plus](https://github.com/shijistar/enum-plus) that automatically integrates with [next-international](https://next-international.vercel.app) to achieve internationalization of enum labels. It allows you to use next-international localization keys in your enum definitions, which are dynamically displayed as translated text for the current language.
15
15
16
-
> This plugin does not support automatic UI updates after switching languages, which requires integration with front-end frameworks (such as React, Vue, etc.). Please consider using the [@enum-plus/plugin-react](https://github.com/shijistar/enum-plus/tree/main/packages/plugin-react) or [@enum-plus/plugin-i18next-vue](https://github.com/shijistar/enum-plus/tree/main/packages/plugin-i18next-vue) plugins.
16
+
> ⚠️ Please note that this plugin only supports client-side environments and does not support server-side rendering.
17
17
18
18
## Installation
19
19
20
20
```bash
21
-
npm install @enum-plus/plugin-i18next
21
+
npm install @enum-plus/plugin-next-international
22
22
```
23
23
24
-
Import the `@enum-plus/plugin-i18next` plugin and install it in the entry file of your application:
24
+
Import the `@enum-plus/plugin-next-international` plugin and install it in the entry file of your application:
// When the button is clicked, the Select component will automatically update to display "星期一"
141
+
```
142
+
143
+
### Dropdown Search
144
+
145
+
In `component` mode, since the enum's `label` has become a component instance rather than a string type, it cannot be directly used for text search. You can use the `isMatch` or `isMatchCaseSensitive` methods to filter enum items.
The `isMatch` method is used to filter enum items based on a search text, supporting fuzzy matching of the enum item's `label`, ignoring case sensitivity.
The `isMatchCaseSensitive` method is used to filter enum items based on a search text, supporting fuzzy matching of the enum item's `label`, with case sensitivity.
0 commit comments