diff --git a/README.md b/README.md index 7270fdd..e314bd6 100644 --- a/README.md +++ b/README.md @@ -179,6 +179,7 @@ error(key: string, error: string, spec: object): string ## TODO +- make the difference between a missing key (dev issue) or a missing translation in the key (translator issue) - tests: - interpolation errors - deserialization errors diff --git a/docs/client.md b/docs/client.md index 9cd5b96..d12924a 100644 --- a/docs/client.md +++ b/docs/client.md @@ -101,7 +101,7 @@ We'll call them for commodity the client-side client (CSC) and server-side clien When the application knows well it enters several zones while doing an action (like login-in if zoned by rights), it might be interesting for the SSC to provide a differential in the loaded dictionary in one packet instead of relying on further requests through the regular `condense` mechanism. -For this, **after** SSR-rendering, `payload = SSC.getPartialLoad(excludedZones: Zone[] = [])` can be called with the list of zones the CSC **already** possess. It will return a completely json-able in a compact format of the loaded dictionary +For this, **after** SSR-rendering, `payload = SSC.getPartialLoad(excludedZones: Zone[] = [])` can be called with the list of zones the CSC **already** possess. It will return a completely json-able differential of the zones the CSC misses. This partial answer can be conveyed in the answer with the action' results (especially useful in a page load action) and given to the CSC with `CSC.usePartial(payload)` diff --git a/docs/interpolation.md b/docs/interpolation.md index 8b74e5c..87c774b 100644 --- a/docs/interpolation.md +++ b/docs/interpolation.md @@ -116,15 +116,17 @@ Its format is the one taken by `Date.toLocaleString()` We of course speak about the ones hard-coded in the Intl javascript core of Node and the browsers. - `relative(n, opt?)` where `n` is number+unit (ex. `1month` or `-2 seconds`) - just forwards to `Intl.RelativeTimeFormat`. Note that there is a `formats.relative` like for dates or number -- `DisplayNames`: relative to `Intl.DisplayNames` +- relative to `Intl.DisplayNames`: - `region(c)` ex: 'HU' -> "Hungary" - `language(c)` ex: 'en-UK' -> "British English" - `script(c)` ex: 'Kana' -> "Katakana" - `currency(c)` ex: 'USD' -> "Us dollars" +- `list(x, y, z, ..., opt?)` where arguments can be array (this will be flattened) allows the "..., ... and ..." auto-formating - cfr. `Intl.ListFormat` +- ### Plurals and ordinals -These two processors use a specific key, respectively `internals.plurals` and `internal.ordinals`. +These two processors use a specific key, respectively `internals.plurals` and `internals.ordinals`. These key contain js-like object who, for english would be: ```