* feat: introduce onMissingMessageHandler
* Update src/runtime/types/index.ts
Co-authored-by: Christian Kaisermann <christian@kaisermann.me>
* Update src/runtime/configs.ts
Co-authored-by: Christian Kaisermann <christian@kaisermann.me>
* Update src/runtime/types/index.ts
Co-authored-by: Christian Kaisermann <christian@kaisermann.me>
* Update src/runtime/stores/formatters.ts
Co-authored-by: Christian Kaisermann <christian@kaisermann.me>
* Update test/runtime/stores/formatters.test.ts
Co-authored-by: Christian Kaisermann <christian@kaisermann.me>
* Update test/runtime/stores/formatters.test.ts
Co-authored-by: Christian Kaisermann <christian@kaisermann.me>
* rename to handleMissingKey and optionally use return as default value
* rename also in the defaultOptions
* test for optional default result from handleMissingKey
Co-authored-by: Christian Kaisermann <christian@kaisermann.me>
* Added test to prove that addMessage is not updating returned messages
* Clear lookupCache for locale when addMessages is called
* Update test/runtime/includes/lookup.test.ts
Co-authored-by: Christian Kaisermann <christian@kaisermann.me>
BREAKING CHANGE: It's now needed to explicitly import the `getClientLocale` method to use
its heuristics when setting the initial locale. This makes the method
and its helpers to be tree-shakeable.
```js
import { init, getClientLocale } from 'svelte-i18n'
init({
initialLocale: getClientLocale({ ... })
})
```
BREAKING CHANGE: Changes completely the API. Now, to format a number, date or time, the
developer must explicitly import the formatter store:
`import { time, date, number } from 'svelte-i18n'`