ai-localize-config 2.0.7 → 3.1.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/CHANGELOG.md +17 -0
- package/dist/index.d.mts +19 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +18 -1
- package/dist/index.mjs +18 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# ai-localize-config
|
|
2
2
|
|
|
3
|
+
## 3.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- **`copyDefaultValues` config field** — Added `copyDefaultValues: boolean` (default `false`) to `LocalizationConfigSchema`. When `true`, target language locale files are pre-populated with the default language's source text values instead of empty strings, ensuring the app always has a visible fallback while translators fill in proper translations.
|
|
8
|
+
|
|
9
|
+
## 3.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- bug fixes
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
- ai-localize-shared@3.0.0
|
|
19
|
+
|
|
3
20
|
## 2.0.7
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -133,6 +133,23 @@ declare const LocalizationConfigSchema: z.ZodObject<{
|
|
|
133
133
|
* "ignoreTextPatterns": ["^MyBrand", "^theme-", "^data-"]
|
|
134
134
|
*/
|
|
135
135
|
ignoreTextPatterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
136
|
+
/**
|
|
137
|
+
* When `true`, target language locale files are pre-populated with the same
|
|
138
|
+
* source text values as the default language instead of empty strings.
|
|
139
|
+
*
|
|
140
|
+
* This ensures the app always has a visible fallback value while translators
|
|
141
|
+
* work on proper translations. Empty-string values cause the UI to show
|
|
142
|
+
* nothing at all for untranslated keys.
|
|
143
|
+
*
|
|
144
|
+
* Applies to both `extract` (new files) and `sync` (adding missing keys to
|
|
145
|
+
* existing files).
|
|
146
|
+
*
|
|
147
|
+
* Defaults to `false`.
|
|
148
|
+
*
|
|
149
|
+
* Example:
|
|
150
|
+
* "copyDefaultValues": true
|
|
151
|
+
*/
|
|
152
|
+
copyDefaultValues: z.ZodDefault<z.ZodBoolean>;
|
|
136
153
|
}, "strip", z.ZodTypeAny, {
|
|
137
154
|
framework: "react" | "react-cra" | "react-vite" | "react-nextjs" | "angular" | "angular-ngx" | "angular-i18n" | "vue" | "vue-i18n" | "jquery" | "vanilla-js" | "jsp" | "unknown";
|
|
138
155
|
defaultLanguage: string;
|
|
@@ -146,6 +163,7 @@ declare const LocalizationConfigSchema: z.ZodObject<{
|
|
|
146
163
|
localeStructure: "flat" | "nested";
|
|
147
164
|
keyStyle: "path" | "screaming_snake";
|
|
148
165
|
ignoreTextPatterns: string[];
|
|
166
|
+
copyDefaultValues: boolean;
|
|
149
167
|
keyPrefix?: string | undefined;
|
|
150
168
|
namespaces?: string[] | undefined;
|
|
151
169
|
includePatterns?: string[] | undefined;
|
|
@@ -199,6 +217,7 @@ declare const LocalizationConfigSchema: z.ZodObject<{
|
|
|
199
217
|
keyStyle?: "path" | "screaming_snake" | undefined;
|
|
200
218
|
staticKeys?: Record<string, string> | undefined;
|
|
201
219
|
ignoreTextPatterns?: string[] | undefined;
|
|
220
|
+
copyDefaultValues?: boolean | undefined;
|
|
202
221
|
}>;
|
|
203
222
|
type LocalizationConfigInput = z.input<typeof LocalizationConfigSchema>;
|
|
204
223
|
type LocalizationConfigOutput = z.output<typeof LocalizationConfigSchema>;
|
package/dist/index.d.ts
CHANGED
|
@@ -133,6 +133,23 @@ declare const LocalizationConfigSchema: z.ZodObject<{
|
|
|
133
133
|
* "ignoreTextPatterns": ["^MyBrand", "^theme-", "^data-"]
|
|
134
134
|
*/
|
|
135
135
|
ignoreTextPatterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
136
|
+
/**
|
|
137
|
+
* When `true`, target language locale files are pre-populated with the same
|
|
138
|
+
* source text values as the default language instead of empty strings.
|
|
139
|
+
*
|
|
140
|
+
* This ensures the app always has a visible fallback value while translators
|
|
141
|
+
* work on proper translations. Empty-string values cause the UI to show
|
|
142
|
+
* nothing at all for untranslated keys.
|
|
143
|
+
*
|
|
144
|
+
* Applies to both `extract` (new files) and `sync` (adding missing keys to
|
|
145
|
+
* existing files).
|
|
146
|
+
*
|
|
147
|
+
* Defaults to `false`.
|
|
148
|
+
*
|
|
149
|
+
* Example:
|
|
150
|
+
* "copyDefaultValues": true
|
|
151
|
+
*/
|
|
152
|
+
copyDefaultValues: z.ZodDefault<z.ZodBoolean>;
|
|
136
153
|
}, "strip", z.ZodTypeAny, {
|
|
137
154
|
framework: "react" | "react-cra" | "react-vite" | "react-nextjs" | "angular" | "angular-ngx" | "angular-i18n" | "vue" | "vue-i18n" | "jquery" | "vanilla-js" | "jsp" | "unknown";
|
|
138
155
|
defaultLanguage: string;
|
|
@@ -146,6 +163,7 @@ declare const LocalizationConfigSchema: z.ZodObject<{
|
|
|
146
163
|
localeStructure: "flat" | "nested";
|
|
147
164
|
keyStyle: "path" | "screaming_snake";
|
|
148
165
|
ignoreTextPatterns: string[];
|
|
166
|
+
copyDefaultValues: boolean;
|
|
149
167
|
keyPrefix?: string | undefined;
|
|
150
168
|
namespaces?: string[] | undefined;
|
|
151
169
|
includePatterns?: string[] | undefined;
|
|
@@ -199,6 +217,7 @@ declare const LocalizationConfigSchema: z.ZodObject<{
|
|
|
199
217
|
keyStyle?: "path" | "screaming_snake" | undefined;
|
|
200
218
|
staticKeys?: Record<string, string> | undefined;
|
|
201
219
|
ignoreTextPatterns?: string[] | undefined;
|
|
220
|
+
copyDefaultValues?: boolean | undefined;
|
|
202
221
|
}>;
|
|
203
222
|
type LocalizationConfigInput = z.input<typeof LocalizationConfigSchema>;
|
|
204
223
|
type LocalizationConfigOutput = z.output<typeof LocalizationConfigSchema>;
|
package/dist/index.js
CHANGED
|
@@ -159,7 +159,24 @@ var LocalizationConfigSchema = import_zod.z.object({
|
|
|
159
159
|
* Example:
|
|
160
160
|
* "ignoreTextPatterns": ["^MyBrand", "^theme-", "^data-"]
|
|
161
161
|
*/
|
|
162
|
-
ignoreTextPatterns: import_zod.z.array(import_zod.z.string()).default([])
|
|
162
|
+
ignoreTextPatterns: import_zod.z.array(import_zod.z.string()).default([]),
|
|
163
|
+
/**
|
|
164
|
+
* When `true`, target language locale files are pre-populated with the same
|
|
165
|
+
* source text values as the default language instead of empty strings.
|
|
166
|
+
*
|
|
167
|
+
* This ensures the app always has a visible fallback value while translators
|
|
168
|
+
* work on proper translations. Empty-string values cause the UI to show
|
|
169
|
+
* nothing at all for untranslated keys.
|
|
170
|
+
*
|
|
171
|
+
* Applies to both `extract` (new files) and `sync` (adding missing keys to
|
|
172
|
+
* existing files).
|
|
173
|
+
*
|
|
174
|
+
* Defaults to `false`.
|
|
175
|
+
*
|
|
176
|
+
* Example:
|
|
177
|
+
* "copyDefaultValues": true
|
|
178
|
+
*/
|
|
179
|
+
copyDefaultValues: import_zod.z.boolean().default(false)
|
|
163
180
|
});
|
|
164
181
|
|
|
165
182
|
// src/loader.ts
|
package/dist/index.mjs
CHANGED
|
@@ -120,7 +120,24 @@ var LocalizationConfigSchema = z.object({
|
|
|
120
120
|
* Example:
|
|
121
121
|
* "ignoreTextPatterns": ["^MyBrand", "^theme-", "^data-"]
|
|
122
122
|
*/
|
|
123
|
-
ignoreTextPatterns: z.array(z.string()).default([])
|
|
123
|
+
ignoreTextPatterns: z.array(z.string()).default([]),
|
|
124
|
+
/**
|
|
125
|
+
* When `true`, target language locale files are pre-populated with the same
|
|
126
|
+
* source text values as the default language instead of empty strings.
|
|
127
|
+
*
|
|
128
|
+
* This ensures the app always has a visible fallback value while translators
|
|
129
|
+
* work on proper translations. Empty-string values cause the UI to show
|
|
130
|
+
* nothing at all for untranslated keys.
|
|
131
|
+
*
|
|
132
|
+
* Applies to both `extract` (new files) and `sync` (adding missing keys to
|
|
133
|
+
* existing files).
|
|
134
|
+
*
|
|
135
|
+
* Defaults to `false`.
|
|
136
|
+
*
|
|
137
|
+
* Example:
|
|
138
|
+
* "copyDefaultValues": true
|
|
139
|
+
*/
|
|
140
|
+
copyDefaultValues: z.boolean().default(false)
|
|
124
141
|
});
|
|
125
142
|
|
|
126
143
|
// src/loader.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-localize-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Configuration loader and schema validator for ai-localize-core",
|
|
5
5
|
"author": "ai-localize-core contributors",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"zod": "^3.22.4",
|
|
48
48
|
"cosmiconfig": "^9.0.0",
|
|
49
49
|
"dotenv": "^16.4.1",
|
|
50
|
-
"ai-localize-shared": "
|
|
50
|
+
"ai-localize-shared": "3.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"tsup": "^8.0.1",
|