i18nizer 0.6.0 → 0.6.1

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.md CHANGED
@@ -124,6 +124,21 @@ i18nizer translate <file> --dry-run
124
124
  i18nizer translate <file> --show-json
125
125
  ```
126
126
 
127
+ ### Regenerate Aggregator
128
+
129
+ **Rebuild the auto-generated aggregator file:**
130
+
131
+ ```bash
132
+ i18nizer regenerate
133
+ ```
134
+
135
+ This command regenerates the `i18n/messages.generated.ts` file by scanning all JSON files in your messages directory. Use this when:
136
+ - You manually add or remove translation JSON files
137
+ - You rename JSON files
138
+ - The aggregator becomes out of sync with your messages
139
+
140
+ The aggregator automatically uses valid TypeScript identifiers for imports, converting hyphenated filenames (e.g., `notification-item.json`) to PascalCase identifiers (e.g., `NotificationItem_en`).
141
+
127
142
  ### Legacy Command (Still Supported)
128
143
 
129
144
  ```bash
@@ -175,7 +190,7 @@ export function Login() {
175
190
 
176
191
  ---
177
192
 
178
- ### Generated JSON (`messages/en/Login.json`)
193
+ ### Generated JSON (`messages/en/login.json`)
179
194
 
180
195
  ```json
181
196
  {
@@ -187,6 +202,8 @@ export function Login() {
187
202
  }
188
203
  ```
189
204
 
205
+ **Note:** The filename uses lowercase-hyphen format (`login.json`), while the namespace inside uses PascalCase (`Login`).
206
+
190
207
  ---
191
208
 
192
209
  ## 📂 Project Structure
@@ -200,28 +217,34 @@ your-project/
200
217
  │ ├─ cache/
201
218
  │ │ └─ translations.json # Translation cache
202
219
  │ └─ ...
220
+ ├─ i18n/
221
+ │ └─ messages.generated.ts # Auto-generated aggregator (imports all JSON files)
203
222
  └─ messages/ # Translation files (configurable path)
204
223
  ├─ en/
205
- │ └─ Login.json
224
+ │ └─ login.json # Lowercase-hyphen format for filenames
206
225
  ├─ es/
207
- │ └─ Login.json
226
+ │ └─ login.json
208
227
  └─ fr/
209
- └─ Login.json
228
+ └─ login.json
210
229
  ```
211
230
 
231
+ **Note:** JSON filenames use lowercase-hyphen format (e.g., `notification-item.json`, `user-profile.json`), while the namespace inside the JSON file uses PascalCase (e.g., `NotificationItem`, `UserProfile`). The auto-generated aggregator converts filenames to valid TypeScript identifiers.
232
+
212
233
  Legacy standalone mode (without `i18nizer start`):
213
234
 
214
235
  ```
215
236
  [HOME]/.i18nizer/
216
237
  ├─ api-keys.json
217
238
  ├─ tsconfig.json
239
+ ├─ i18n/
240
+ │ └─ messages.generated.ts # Auto-generated aggregator
218
241
  └─ messages/
219
242
  ├─ en/
220
- │ └─ Login.json
243
+ │ └─ login.json
221
244
  ├─ es/
222
- │ └─ Login.json
245
+ │ └─ login.json
223
246
  └─ fr/
224
- └─ Login.json
247
+ └─ login.json
225
248
  ```
226
249
 
227
250
  ---
@@ -307,5 +307,5 @@
307
307
  ]
308
308
  }
309
309
  },
310
- "version": "0.6.0"
310
+ "version": "0.6.1"
311
311
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "i18nizer",
3
3
  "description": "CLI to extract texts from JSX/TSX and generate i18n JSON with AI translations",
4
- "version": "0.6.0",
4
+ "version": "0.6.1",
5
5
  "author": "Yoannis Sanchez Soto",
6
6
  "bin": "./bin/run.js",
7
7
  "bugs": "https://github.com/yossTheDev/i18nizer/issues",