webpack-gc-i18n-plugin 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/readme-en.md ADDED
@@ -0,0 +1,740 @@
1
+ <div align="center">
2
+ <img src="./logo.svg" alt="auto-i18n-translation-plugins" width="300">
3
+ </div>
4
+
5
+ # 🚀 auto-i18n-translation-plugins
6
+
7
+ ## 🍉 Plugin Introduction
8
+
9
+ A 🎉 **frontend auto-translation plugin** that supports all JavaScript-based frontend frameworks (like Vue2/3 and React). No source code modification needed! Easily achieve multi-language support with one click 🌐🚀. Comes with Youdao and Google translation services by default, while supporting custom translators. Compatible with major build tools like Webpack, Vite, and Rollup.
10
+
11
+ ### 🎯 Key Features:
12
+
13
+ - 🛠️ **No source code changes** - Quick multi-language translation with one click
14
+ - 🌐 **Supports multiple translation services** (Google, Youdao, and custom translators)
15
+ - 🔍 **Smart detection** of text needing translation
16
+ - 🔧 **Flexible configuration options** for different project needs
17
+
18
+ Note: Youdao translation requires users to apply for their translation service - the demo keys have been exhausted.
19
+
20
+ ---
21
+
22
+ ## 📚 Plugin Debugging
23
+
24
+ ```bash
25
+ pnpm install
26
+ pnpm run build
27
+ pnpm run preview // Don't select React, contains too much English text
28
+ ```
29
+
30
+ ---
31
+
32
+ ## 📖 Supported Features
33
+
34
+ - **Frameworks**: All JavaScript-based frontend frameworks (Vue2/3, React, etc.)
35
+ - **Build Tools**: Fully compatible with Webpack, Vite, Rsbuild and Rollup 🚀
36
+ - **Translation Services**: Default support for **Youdao** and **Google** translation, plus custom translators
37
+
38
+ ---
39
+
40
+ ## ❓ Common Issues
41
+
42
+ [Documentation](https://juejin.cn/post/7483435518526062626).
43
+
44
+ ---
45
+
46
+ ## 🌟 Quick Start 🚀
47
+
48
+ ### 1️⃣ Install Plugin 📦
49
+
50
+ #### **🌐 Vite Project:**
51
+
52
+ ```bash
53
+ npm install vite-auto-i18n-plugin --save-dev
54
+ # or
55
+ yarn add vite-auto-i18n-plugin --dev
56
+ ```
57
+
58
+ #### **🛠️ Webpack Project (Compatible with Webpack 4/5):**
59
+
60
+ ```bash
61
+ npm install webpack-auto-i18n-plugin --save-dev
62
+ # or
63
+ yarn add webpack-auto-i18n-plugin --dev
64
+ ```
65
+
66
+ #### **⚡ Rsbuild Project:**
67
+
68
+ ```bash
69
+ npm install rsbuild-auto-i18n-plugin --save-dev
70
+ # 或
71
+ yarn add rsbuild-auto-i18n-plugin --dev
72
+ ```
73
+
74
+ ---
75
+
76
+ ### 2️⃣ Language Switching 🌐
77
+
78
+ #### ⚙️ Basic Switching
79
+
80
+ ```js
81
+ window.localStorage.setItem('lang', value)
82
+ window.location.reload()
83
+
84
+ // value is the key of the language mapping object
85
+ // The mapping object is located in the lang/index.js file by default. You can check this part of the code inside.
86
+ const langMap = {
87
+ 'en': (),
88
+ 'zhcn': ()
89
+ }
90
+ ```
91
+
92
+ #### 📲 Instant Language Switching
93
+
94
+ If you don't want to switch languages by refreshing the page, you can directly modify the language via `$changeLang` and then re - render the corresponding components.
95
+
96
+ ```js
97
+ window.$changeLang('en')
98
+ ```
99
+
100
+ For example, in Vue2, you can switch languages without refreshing the page in the following way:
101
+
102
+ ```Html
103
+ <template>
104
+ <div id="app" v-if="isShow">
105
+ <button @click="changeLang('en')">Switch to English</button>
106
+ <button @click="changeLang('zh-cn')">Switch to Chinese</button>
107
+ <router-view></router-view>
108
+ </div>
109
+ </template>
110
+ <script>
111
+ export default {
112
+ data() {
113
+ return {
114
+ isShow: true
115
+ }
116
+ },
117
+ methods: {
118
+ changeLang(lang) {
119
+ window.$changeLang(lang)
120
+ this.isShow = false
121
+ this.$nextTick(() => {
122
+ this.isShow = true
123
+ })
124
+ }
125
+ }
126
+ }
127
+ </script>
128
+ ```
129
+
130
+ #### 🔄 Replace Language Packs
131
+
132
+ If you want to modify the built - in generated language packs, you can directly modify the `langMap` in the global object. For example:
133
+
134
+ ```js
135
+ window.langMap = {
136
+ en: {
137
+ zccsau6: 'hello'
138
+ },
139
+ 'zh-cn': {
140
+ zccsau6: '你好'
141
+ }
142
+ }
143
+ ```
144
+
145
+ Then you can refresh the page by using the above **Instant Language Switching** method.
146
+
147
+ ---
148
+
149
+ ### 3️⃣ Basic Configuration 🔧
150
+
151
+ #### **Vite Configuration Example** (vite.config.js):
152
+
153
+ ```javascript
154
+ import vitePluginsAutoI18n, { YoudaoTranslator } from 'vite-auto-i18n-plugin'
155
+ import vue from '@vitejs/plugin-vue'
156
+ import { defineConfig } from 'vite'
157
+
158
+ export default defineConfig({
159
+ plugins: [
160
+ vue({
161
+ template: {
162
+ compilerOptions: {
163
+ hoistStatic: false,
164
+ cacheHandlers: false
165
+ }
166
+ }
167
+ }),
168
+ vitePluginsAutoI18n({
169
+ translator: new YoudaoTranslator({
170
+ appId: '4cdb9baea8066fef',
171
+ appKey: 'ONI6AerZnGRyDqr3w7UM730mPuF8mB3j'
172
+ })
173
+ })
174
+ ]
175
+ })
176
+ ```
177
+
178
+ #### **Webpack Configuration Example** (webpack.config.js):
179
+
180
+ ```javascript
181
+ const webpackPluginsAutoI18n = require('webpack-auto-i18n-plugin')
182
+ const { YoudaoTranslator } = require('webpack-auto-i18n-plugin')
183
+
184
+ const i18nPlugin = new webpackPluginsAutoI18n.default({
185
+ translator: new YoudaoTranslator({
186
+ appId: '4cdb9baea8066fef',
187
+ appKey: 'ONI6AerZnGRyDqr3w7UM730mPuF8mB3j'
188
+ })
189
+ })
190
+
191
+ module.exports = {
192
+ plugins: [
193
+ new VueLoaderPlugin(),
194
+ new HtmlWebpackPlugin({
195
+ template: './public/index.html'
196
+ }),
197
+ i18nPlugin
198
+ ]
199
+ }
200
+ ```
201
+
202
+ #### **Rsbuild Configuration Example** (rsbuild.config.js):
203
+
204
+ ````javascript
205
+ const rsbuildPluginsAutoI18n = require('rsbuild-auto-i18n-plugin')
206
+ const { YoudaoTranslator } = require('rsbuild-auto-i18n-plugin')
207
+
208
+ export default defineConfig({
209
+ plugins: [
210
+ pluginReact(),
211
+ rsbuildPluginsAutoI18n({
212
+ targetLangList: ['en'],
213
+ translator: new YoudaoTranslator({
214
+ appId: '4cdb9baea8066fef',
215
+ appKey: 'ONI6AerZnGRyDqr3w7UM730mPuF8mB3j'
216
+ })
217
+ })
218
+ ],
219
+ });
220
+
221
+ ---
222
+
223
+ ### 4️⃣ Translator Configuration Examples 🛠️
224
+
225
+ The plugin uses Google Translate by default (with a default proxy port of 7890). When the network does not support accessing Google, we recommend using **Youdao Translate** ✨, which has excellent translation quality. Currently, the plugin has built - in support for Google, Youdao, and Baidu translation services. If you need to customize a translator, you can refer to the examples below.
226
+
227
+ The following examples use `vite` as an example, and `webpack`、`rsbuild` is similar.
228
+
229
+ #### **Using Google Translate (Default)**
230
+
231
+ ```javascript
232
+ import { GoogleTranslator } from 'vite-auto-i18n-plugin'
233
+
234
+ ...
235
+ translator: new GoogleTranslator({
236
+ proxyOption: {
237
+ host: '127.0.0.1',
238
+ port: 7890,
239
+ headers: {
240
+ 'User-Agent': 'Node'
241
+ }
242
+ }
243
+ })
244
+ ...
245
+ ````
246
+
247
+ #### **Using Youdao Translation**
248
+
249
+ You need to apply for an API. [API documentation](https://ai.youdao.com/DOCSIRMA/html/trans/api/wbfy/index.html).
250
+
251
+ ```javascript
252
+ import { YoudaoTranslator } from 'vite-auto-i18n-plugin'
253
+
254
+ ...
255
+ translator: new YoudaoTranslator({
256
+ appId: 'The appId you applied for',
257
+ appKey: 'The appKey you applied for'
258
+ })
259
+ ...
260
+ ```
261
+
262
+ #### **Baidu Translator**
263
+
264
+ You need to apply for an API. [API documentation](https://api.fanyi.baidu.com/product/113).
265
+
266
+ ```javascript
267
+ import { BaiduTranslator } from 'vite-auto-i18n-plugin'
268
+
269
+ ...
270
+ translator: new BaiduTranslator({
271
+ appId: 'The appId you applied for', // Baidu Translate AppId
272
+ appKey: 'The appKey you applied for' // Baidu Translate AppKey
273
+ })
274
+ ...
275
+ ```
276
+
277
+ #### **Volcengine AI Translator**
278
+
279
+ It supports translation using `doubao` or `deepseek`. The translation effect of large AI models is more accurate than traditional API translation, but it takes longer.
280
+ Introduction to Volcengine large models: https://www.volcengine.com/docs/82379/1099455.
281
+ You need to activate the large model service and apply for an API. [API documentation](https://www.volcengine.com/docs/82379/1298454).
282
+
283
+ ```javascript
284
+ import { VolcengineTranslator } from 'vite-auto-i18n-plugin'
285
+
286
+ ...
287
+ translator: new VolcengineTranslator({
288
+ apiKey: 'The apiKey you applied for',
289
+ model: 'The model you want to call, for example: `doubao-1-5-pro-32k-250115`. Please ensure that the corresponding model has been activated in the console before use.'
290
+ })
291
+ ...
292
+ ```
293
+
294
+ #### **Empty Translator**
295
+
296
+ If you only need to scan the target language without performing translation, this translator will generate a JSON file.
297
+
298
+ ```javascript
299
+ import { EmptyTranslator } from 'vite-auto-i18n-plugin'
300
+
301
+ ...
302
+ translator: new EmptyTranslator()
303
+ ...
304
+ ```
305
+
306
+ #### **Custom Translator**
307
+
308
+ If you have a personal translation API, you can customize a translator in the following ways:
309
+
310
+ The simplest way is to define a translator instance using the `Translator` base class.
311
+
312
+ ```javascript
313
+ import { Translator } from 'vite-auto-i18n-plugin'
314
+ import axios from 'axios'
315
+
316
+ ...
317
+ translator: new Translator({
318
+ name: 'My Translator',
319
+ // Translation method
320
+ fetchMethod: (str, fromKey, toKey, _separator) => {
321
+ // The actual API call may be more complex than the example. For details, please refer to the implementation of YoudaoTranslator in the source code. Path: packages\autoI18nPluginCore\src\translators\youdao.ts
322
+ const myApi = 'https://www.my-i18n.cn/api/translate?from=${fromKey}&to=${toKey}&t={+new Date}'
323
+ return axios.post(myApi, { str })
324
+ .then(res => res.data)
325
+ },
326
+ // Interface trigger interval. Some interfaces may be blocked if triggered frequently. Please set a reasonable interface trigger interval according to the actual situation.
327
+ interval: 1000
328
+ })
329
+ ...
330
+ ```
331
+
332
+ If you need more advanced features, you can use inheritance. However, there is currently no relevant scenario.
333
+
334
+ ```javascript
335
+ import { Translator } from 'vite-auto-i18n-plugin'
336
+
337
+ class CustomTranslator extends Translator {
338
+ constructor () {
339
+ super({
340
+ name: 'My Translator',
341
+ ...
342
+ })
343
+ }
344
+ }
345
+
346
+ ...
347
+ translator: new CustomTranslator()
348
+ ...
349
+ ```
350
+
351
+ ---
352
+
353
+ ### 5️⃣ Project Entry Configuration 🏗️
354
+
355
+ Please import the language configuration file at the top of the **project entry file** (e.g., `main.js`):
356
+
357
+ ```javascript
358
+ import '../lang/index.js' // 📍 Must be imported on the first line of the entry file. The file will be automatically generated when the plugin is run. By default, it is located in the 'lang' folder at the same level as the packaging configuration directory. The 'index.js' inside is the configuration file.
359
+ ```
360
+
361
+ **Generated File Description:**
362
+
363
+ The generated `lang/index.js` file contains the following global functions and objects:
364
+
365
+ - `window.$t(key, defaultValue, namespace)` - Translation function
366
+ - `window.$$t(value)` - Simple translation function (returns original value)
367
+ - `window.$deepScan(value)` - Deep scan marker function (only effective when `deepScan: true`)
368
+ - `window.$iS(template, args)` - Interpolation string function (supports `${0}` or `\${0}` format placeholders)
369
+ - `window.$changeLang(lang)` - Language switching function
370
+ - `window.langMap` - Language mapping object
371
+
372
+ **Compatibility Guarantee:**
373
+
374
+ Starting from v1.1.17, all global functions and objects are mounted through an intelligent fallback mechanism, fully compatible with legacy browsers (including IE 11).
375
+
376
+ ---
377
+
378
+ ## ⚙️ Configuration Parameters
379
+
380
+ | Parameter | Type | Required | Default | Description |
381
+ | -------------------- | ---------- | -------- | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
382
+ | enabled | boolean | ❌ | `true` | Whether to trigger translation. |
383
+ | translateType | string | ❌ | `full-auto` | Translation mode: `full-auto` or `semi-auto` |
384
+ | translateKey | string | ✅ | `$t` | Translation function name (e.g., `$t`) |
385
+ | excludedCall | string[] | ❌ | `['$i8n', 'require', …]` | Function calls to exclude from translation |
386
+ | excludedPattern | RegExp[] | ❌ | `[/\.\w+$/]` | Patterns to exclude (e.g., file extensions) |
387
+ | excludedPath | string[] | ❌ | `['node_modules']` | Directories to exclude (e.g., `node_modules`) |
388
+ | includePath | RegExp[] | ❌ | `[/src\//]` | Whitelist of directories to include (default: `src`) |
389
+ | globalPath | string | ❌ | `'./lang'` | Path for translation config files |
390
+ | distPath | string | ✅ | `''` | Output path for built files |
391
+ | distKey | string | ✅ | `'index'` | Main translation file name |
392
+ | namespace | string | ✅ | `lang` | Project namespace for distinguishing translation configs |
393
+ | originLang | string | ✅ | `'zh-cn'` | Source language |
394
+ | targetLangList | string[] | ✅ | `['en']` | Target languages |
395
+ | buildToDist | boolean | ❌ | `false` | Whether to bundle translation files into main build |
396
+ | translator | Translator | ❌ | `GoogleTranslator` | Translator instance |
397
+ | translatorOption | object | ❌ | `{}` | Translator options (lower priority than `translator`) |
398
+ | rewriteConfig | boolean | ❌ | `true` | Whether to rewrite config file on each plugin run |
399
+ | deepScan | boolean | ❌ | `false` | Experimental: Whether to perform deep string scanning |
400
+ | commonTranslateKey | string | ❌ | `''` | Common translation key for sharing language settings across multiple projects with different namespaces. When set, language switching will prioritize reading the language from localStorage using commonTranslateKey, enabling unified language management across projects |
401
+ | insertFileExtensions | string[] | ❌ | `[]` | List of file extensions to insert translation code into |
402
+ | isClear | boolean | ❌ | `false` | Whether to clear content not in context (clear source language key-value pairs not in context), only supported in build mode |
403
+ | isClearSpace | boolean | ❌ | `false` | Whether to remove whitespace from both ends of source strings, whitespace is preserved by default |
404
+ | languageJsonMode | string | ❌ | `'merged'` | Language JSON storage mode: `'merged'` (all languages in one index.json) or `'split'` (separate json file for each language) |
405
+
406
+ ---
407
+
408
+ ## 🔍 What does `deepScan` do?
409
+
410
+ `deepScan` is an experimental property controlling whether the plugin performs deep string scanning.
411
+
412
+ By default, the plugin scans strings/template strings - if any target language text is found, the entire string is included:
413
+
414
+ ```js
415
+ ;`<div>
416
+ <p>你好</p>
417
+ </div>`
418
+ ```
419
+
420
+ Since there's Chinese text, the whole string would be included, potentially causing inaccurate translation. With `deepScan` enabled, the plugin splits and reconstructs template strings, only translating matching text:
421
+
422
+ ```js
423
+ ;`<div>
424
+ <p>${$t('你好')}</p>
425
+ </div>`
426
+ ```
427
+
428
+ Now only '你好' gets translated, not the entire string.
429
+
430
+ ### 🔥 Using the $deepScan Function
431
+
432
+ When `deepScan: true` is enabled, the plugin automatically generates a `$deepScan` global function. This function marks template strings that need deep scanning:
433
+
434
+ ```js
435
+ // Wrap template strings with $deepScan
436
+ const template = $deepScan(`
437
+ <div class="container">
438
+ <h1>Welcome</h1>
439
+ <p>This is a test</p>
440
+ </div>
441
+ `)
442
+
443
+ // The plugin automatically converts it to:
444
+ const template = `
445
+ <div class="container">
446
+ <h1>${$t('Welcome')}</h1>
447
+ <p>${$t('This is a test')}</p>
448
+ </div>
449
+ `
450
+ ```
451
+
452
+ **Notes:**
453
+ - `$deepScan` only returns the original value at runtime without any processing
454
+ - Primarily used to tell the plugin at compile time that this string needs deep scanning
455
+ - Only takes effect when `deepScan: true` is configured
456
+
457
+ ---
458
+
459
+ ## 🌐 Global Object Compatibility
460
+
461
+ Starting from v1.1.17, the generated translation config file (`lang/index.js`) is fully compatible with legacy browsers, including IE 11.
462
+
463
+ ### Compatibility Mechanism
464
+
465
+ The plugin uses the following fallback priority to obtain the global object:
466
+
467
+ 1. `globalThis` - Modern browsers (ES2020+)
468
+ 2. `window` - Browser environment (IE 11+ compatible)
469
+ 3. `global` - Node.js environment
470
+ 4. `self` - Web Workers environment
471
+
472
+ ### Supported Browser Versions
473
+
474
+ - ✅ Chrome 49+
475
+ - ✅ Firefox 52+
476
+ - ✅ Safari 10+
477
+ - ✅ Edge 12+
478
+ - ✅ IE 11
479
+ - ✅ All modern browsers
480
+
481
+ **No additional configuration needed** - the generated files automatically handle compatibility.
482
+
483
+ ---
484
+
485
+ ## 👋 `translateType` Functionality
486
+
487
+ Added in v1.0.11, with two options:
488
+
489
+ `full-auto`: Fully automatic translation (default supports Chinese, Japanese, Korean, Russian)
490
+
491
+ `semi-auto`: Semi-automatic translation (supports all source languages)
492
+
493
+ In `semi-auto` mode, users must wrap target text with `translateKey` (e.g., `$t('hello')`), which the plugin will then translate.
494
+
495
+ Example:
496
+
497
+ ```js
498
+ const HelloWorld: React.FC<HelloWorldProps> = ({ name = 'World' }) => {
499
+ return (
500
+ <div className="hello-world">
501
+ <h1>
502
+ {$t('Hello,')} {name}!
503
+ </h1>
504
+ <p>{$t('Welcome to our application')}</p>
505
+ </div>
506
+ )
507
+ }
508
+ ```
509
+
510
+ ---
511
+
512
+ ## ❓ Why `buildToDist`?
513
+
514
+ In Vite, the plugin only generates translation config files. Without `buildToDist`, these files won't be bundled. ⚠️ Enabling this bundles them but may create duplicate config files.
515
+
516
+ ---
517
+
518
+ ## 🔄 How to Update Translations?
519
+
520
+ After running the plugin, two files are generated in `\lang`:
521
+
522
+ - **index.js**: Translation function logic
523
+ - **index.json**: Translation content
524
+
525
+ To update translations, simply modify `index.json`.
526
+
527
+ ---
528
+
529
+ ## ⚠️ Usage Notes
530
+
531
+ 1. **Proxy Requirements**
532
+
533
+ - In China, **Youdao Translate** is strongly recommended
534
+ - Google Translate requires proxy configuration
535
+ - Default proxy port: **7890** (customizable via `proxyOption`)
536
+
537
+ 2. **Translation Frequency**
538
+
539
+ - Google Translate is free but may limit frequent requests 🔒
540
+ - Set reasonable intervals between requests 💡
541
+
542
+ 3. **Translation Updates**
543
+ - `index.json` in `globalPath` is the core translation file
544
+ - Changes take effect immediately after saving
545
+
546
+ 4. **JSON Storage Mode Switching** ⚠️
547
+
548
+ - When switching `languageJsonMode` config (`merged` ↔ `split`), it's **strongly recommended** to set `rewriteConfig` to `true`.
549
+ - This ensures the plugin regenerates config files and avoids errors caused by conflicts between old and new mode files.
550
+ - After switching modes, the plugin will automatically handle JSON file merging or splitting.
551
+
552
+ ---
553
+
554
+ ## 📦 User Group
555
+
556
+ QQ Group
557
+
558
+ ![qq](./qq.jpg)
559
+
560
+ ---
561
+
562
+ ## 📦 Example Project
563
+
564
+ Example project: [example](./example) (click to view)
565
+
566
+ ## 📜 License
567
+
568
+ MIT License 🪪 - Free to use and contribute!
569
+
570
+ May this plugin make your i18n development easier and more efficient! 🌍✨
571
+
572
+ ---
573
+
574
+ ## ✨ Update
575
+
576
+ Since v1.0.5, simply import the generated `index.js` in your entry file - no need to manually create language switching functions. 👏
577
+
578
+ ---
579
+
580
+ ## 🎆 Authors
581
+
582
+ Original authors: wenps, xu-code, Caleb-Xu, Winfans
583
+
584
+ ## Changelog
585
+
586
+ ### v1.1.17 (Latest Version)
587
+
588
+ - **Enhanced Global Object Compatibility**: Generated translation config files now support legacy browsers (IE 11+) through a fallback mechanism: `globalThis` → `window` → `global` → `self`
589
+ - **Optimized deepScan Feature**: Added `$deepScan` global function for marking template string parts that need deep scanning, improving translation accuracy
590
+ - **Improved Code Structure**: Optimized translation function generation logic, all code wrapped in IIFE to prevent global scope pollution
591
+
592
+ ### v1.1.16 (Recommended Version)
593
+
594
+ - Fixed issue where double quotes in template strings caused abnormal ID mapping generation
595
+
596
+ ### v1.1.15 (Recommended Version)
597
+
598
+ - Added Node 14 compatibility
599
+
600
+ ### v1.1.14 (Recommended Version)
601
+
602
+ - Fixed rewriteConfig exception issue
603
+
604
+ ### v1.1.13 (Not Recommended Version)
605
+
606
+ - Added JSON split configuration
607
+
608
+ ### v1.1.12 (Recommended Version)
609
+
610
+ - Optimized console output format
611
+
612
+ ### v1.1.11 (Recommended Version)
613
+
614
+ - Optimized console output format, reduced redundant printing
615
+ - Added translation progress bar display
616
+ - Support for Webpack 4
617
+
618
+ ### v1.1.10 (Recommended Version)
619
+
620
+ - Added rsbuild plugin
621
+
622
+ ### v1.1.9 (Recommended Version)
623
+
624
+ - Fixed issue where deepScan string splitting wasn't handling line breaks and other special characters
625
+
626
+ ### v1.1.8 (Recommended Version)
627
+
628
+ - Renamed configuration for controlling leading/trailing whitespace removal
629
+
630
+ ### v1.1.7 (Recommended Version)
631
+
632
+ - Added compatibility for enable feature and translation initialization completion
633
+ - Added configuration option to control whether to remove leading/trailing whitespace during scanning
634
+ - Fixed issue with abnormal triggering of new translations
635
+ - Fixed issue where cleanup configuration was not taking effect
636
+
637
+ ### v1.1.6 (Recommended Version)
638
+
639
+ - Fixed issue where clearing whitespace before/after template strings caused mismatch between JSON and translation functions
640
+ - Fixed issue where Chinese brackets in interpolation caused interpolation to fail
641
+ - Added configuration cleanup functionality
642
+
643
+ ### v1.1.5 (Recommended Version)
644
+
645
+ - Added support for interpolation translation
646
+
647
+ ### v1.1.4 (Recommended Version)
648
+
649
+ - Fixed template string processing exception in exclude functions
650
+ - Added interval configuration for Google Translate
651
+ - Added support for custom interface parameters in translators
652
+
653
+ ### v1.1.3 (Recommended Version)
654
+
655
+ - Added the ability to update languages without refreshing and best practices
656
+
657
+ ### v1.1.2
658
+
659
+ - Fixed AI translation exceptions
660
+
661
+ ### v1.1.1
662
+
663
+ - New translation disable function
664
+
665
+ ### v1.1.0
666
+
667
+ - New AI translator
668
+ - New Vue2 extension plugin mechanism for translation plugins
669
+
670
+ ### v1.0.26 (Recommended Version)
671
+
672
+ - Added custom extension arrays
673
+
674
+ ### v1.0.25 (Recommended Version)
675
+
676
+ - Added a universal translation key
677
+
678
+ ### v1.0.24 (Recommended Version)
679
+
680
+ - Fixed the exception issue in semi-automatic mode
681
+
682
+ ### v1.0.23 (Recommended Version)
683
+
684
+ - Fixed a major bug in packaging and writing.
685
+
686
+ ### v1.0.22
687
+
688
+ - Added scan translator
689
+
690
+ ### v1.0.21
691
+
692
+ - Added deep scanning
693
+
694
+ ### v1.0.20
695
+
696
+ - Fixed filter function issues and added config overwrite option
697
+
698
+ ### v1.0.19
699
+
700
+ - Backward compatibility for config files
701
+
702
+ ### v1.0.18
703
+
704
+ - Fixed optional chaining issues in older Node versions
705
+
706
+ ### v1.0.17
707
+
708
+ - Basic SSR support (experimental)
709
+
710
+ ### v1.0.16
711
+
712
+ - Fixed Vue3 comment node issues
713
+
714
+ ### v1.0.15
715
+
716
+ - Added Baidu Translate
717
+
718
+ ### v1.0.14
719
+
720
+ - Fixed new language type segmentation
721
+ - Added Japanese, Korean, Russian support
722
+
723
+ ### v1.0.13
724
+
725
+ - Bug fixes
726
+
727
+ ### v1.0.12
728
+
729
+ - Type optimizations
730
+
731
+ ### v1.0.11
732
+
733
+ - Bug fixes
734
+ - Added `translateType` option for semi-auto mode
735
+
736
+ ```js
737
+ // Users can wrap text with translateKey
738
+ // e.g., $t('hello') - plugin will scan and translate these
739
+ $t('hello')
740
+ ```