@sveltekit-i18n/parser-curly 3.0.0-next.2 → 3.0.0-next.3
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 +2 -2
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -107,7 +107,7 @@ i18n.t('welcome', { default: 'Anonymous' })
|
|
|
107
107
|
// → "Welcome, Anonymous!"
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
-
`default` is a reserved payload key: the fallback for every placeholder in the message whose value is absent, and `{{default}}` reads it. A placeholder with no value takes the first of these that yields text — the entry's own `default` (see [Payload](#payload)), the payload's `default`, the inline `default:`, the empty string — so the payload's `default` outranks the inline one. Only an absent value falls back: `0`, `false` and the empty string are values.
|
|
110
|
+
`default` is a reserved payload key: the fallback for every placeholder in the message whose value is absent, and `{{default}}` reads it. A placeholder with no value takes the first of these that yields text — the entry's own `default` (see [Payload](#payload)), the payload's `default`, the inline `default:`, the empty string — so the payload's `default` outranks the inline one. Only an absent value falls back: `0`, `false` and the empty string are values. The chain belongs to the placeholder, not to the message: a key naming no message is nothing to resolve and yields the empty string, and what a missing translation renders as is [`fallbackValue`](https://github.com/sveltekit-i18n/base/blob/master/docs/README.md#fallbackvalue), which base answers before this parser is called.
|
|
111
111
|
|
|
112
112
|
### Modifiers
|
|
113
113
|
|
|
@@ -336,7 +336,7 @@ A `Report` carries:
|
|
|
336
336
|
| `code` | `unknown-modifier`, `failed-modifier`, `missing-options`, `unserializable-value`, `missing-locale`, `pass-limit` or `output-limit` |
|
|
337
337
|
| `origin` | who fixes it: `message` (the message as written), `payload` (what the call passed) or `limit` (a bound this parser set) |
|
|
338
338
|
| `message` | a self-contained English sentence carrying nothing from the payload |
|
|
339
|
-
| `
|
|
339
|
+
| `id` | the message's id, where the call passed one; base passes the translation key |
|
|
340
340
|
| `limit` | the limit reached, for the two limit reports |
|
|
341
341
|
| `text` | the excerpt: the placeholder, or the output that would not settle — cut to 120 code units, with quotes, backslashes and line terminators escaped, so it can be written anywhere |
|
|
342
342
|
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createParser as f}from"@curly-message/parser";import{createExtractor as i}from"@curly-message/parser";var c=i;var m=r=>{let{resolve:e}=f(r);return{parse:(t,[o,a],p,s)=>e(t,{payload:o,props:a,locale:p,
|
|
1
|
+
import{createParser as f}from"@curly-message/parser";import{createExtractor as i}from"@curly-message/parser";var c=i;var m=r=>{let{resolve:e}=f(r);return{parse:(t,[o,a],p,s)=>e(t,{payload:o,props:a,locale:p,id:s})}},n=m;export{n as default,c as extractParamsFactory};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltekit-i18n/parser-curly",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.3",
|
|
4
4
|
"description": "Curly Message Format parser for the sveltekit-i18n library.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"@sveltekit-i18n/base": "^3.0.0-next.0"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@curly-message/parser": "^1.0.
|
|
53
|
+
"@curly-message/parser": "^1.0.1"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@curly-message/conformance": "^1.0.
|
|
56
|
+
"@curly-message/conformance": "^1.0.1",
|
|
57
57
|
"@eslint/js": "^10.0.1",
|
|
58
58
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
59
59
|
"@sveltekit-i18n/base": "^3.0.0-next.0",
|