wuchale 0.3.0 → 0.3.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 +25 -3
- package/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -279,9 +279,10 @@ script rule below.
|
|
|
279
279
|
### Script
|
|
280
280
|
|
|
281
281
|
This includes all JS/TS code that is:
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
282
|
+
|
|
283
|
+
- Inside `<script>` tags
|
|
284
|
+
- Inside dynamic expressions inside the markup or attributes, anything in curly braces like `{call('this guy')}`
|
|
285
|
+
- In `*.svelte.[js|ts]` files.
|
|
285
286
|
|
|
286
287
|
The rule for this is that all strings and template strings that start with
|
|
287
288
|
capital letters are extracted. Additionally, if they are used inside the
|
|
@@ -363,6 +364,27 @@ it here. The function should receive the following arguments:
|
|
|
363
364
|
|
|
364
365
|
And it should return boolean to indicate whether to extract it.
|
|
365
366
|
|
|
367
|
+
## Files management
|
|
368
|
+
|
|
369
|
+
`wuchale` generates two files for each locale.
|
|
370
|
+
|
|
371
|
+
### `.po` file
|
|
372
|
+
|
|
373
|
+
This is a `gettext` file that is used to exchange the text fragments with translators. The workflow is:
|
|
374
|
+
|
|
375
|
+
- You give them the file with empty places for the translated fragments
|
|
376
|
+
- They fill it with the translation, preserving the placeholders, but they can change the orders as the language requires.
|
|
377
|
+
- You get the file back and make it part of your codebase.
|
|
378
|
+
|
|
379
|
+
**Note**: You should commit these files, they are where the translated
|
|
380
|
+
fragments are stored and are the source of truth for the translations.
|
|
381
|
+
|
|
382
|
+
### Compiled `.json` file
|
|
383
|
+
|
|
384
|
+
This is the compiled version of the `.po` file. It is generated at the startup
|
|
385
|
+
of the dev server and at build time. As it has to be generated every time, you
|
|
386
|
+
should consider it as a temp file and therefore you should **not** commit it.
|
|
387
|
+
|
|
366
388
|
## 🧹 Cleaning
|
|
367
389
|
|
|
368
390
|
Unused keys are marked as obsolete during a production build. Obsoletes are
|
package/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import plugin from "./preprocess/index.js"
|
|
2
2
|
|
|
3
|
-
export
|
|
3
|
+
export const wuchale = plugin
|