diff --git a/docs/client.md b/docs/client.md index d8d9805..9cd5b96 100644 --- a/docs/client.md +++ b/docs/client.md @@ -32,7 +32,7 @@ Setting the locales can be done with `i18nClient.setLocales([...])`. ### Other locales -The `I18nClient` also have 2 properties: +The `I18nClient` also has 2 properties: - `timeZone`: A timezone used when displaying dates (if none is specified) with [this format](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) - `currency`: A currency to use when displaying a number with `style: currency` (3-uppercase code: USD, EUR, ...) diff --git a/docs/interpolation.md b/docs/interpolation.md index ed7eb28..8b74e5c 100644 --- a/docs/interpolation.md +++ b/docs/interpolation.md @@ -78,11 +78,11 @@ Object.assign(processors, { Where `TContext` contains mostly the `client` (the object containing all the language specification) The arguments will mainly be strings or object when flat named lists are specified -The syntax to use them is `{processor | arg1 | arg2}`. +The syntax to use them is `{processor:: arg1 | arg2}`. -example: `{upper | $1}` will render the first argument in upper-case +example: `{upper :: $1}` will render the first argument in upper-case -> :information_source: `{$2[upper] | $1}` is also possible, in which case the second argument can both specify a text key, a processor or be defaulted to the `upper` processor. +> :information_source: `{$2[upper] :: $1}` is also possible, in which case the second argument can both specify a text key, a processor or be defaulted to the `upper` processor. #### Casing diff --git a/src/client/interpolation.ts b/src/client/interpolation.ts index d52cbcf..b1559c7 100644 --- a/src/client/interpolation.ts +++ b/src/client/interpolation.ts @@ -30,6 +30,7 @@ export const formats: Record<'date' | 'number' | 'relative', Record string> = { + // TODO Interpolation should have access to localeFlagsEngine upper(str: string) { return str.toUpperCase() },