Commit Graph

84 Commits

Author SHA1 Message Date
Christian Kaisermann
9d82a98e8d fix: 🐛 ignore loadingDelay for the initialLocale
Fixes #53

 Closes: Closes #53
2020-03-06 14:11:51 -03:00
Christian Kaisermann
9930c1a7c3 chore: 🤖 remove unused file 2020-02-28 17:57:56 -03:00
Christian Kaisermann
6b0ba2b902 refactor: 💡 split getClientLocale into multiple utilities 2020-02-03 13:33:03 -03:00
Christian Kaisermann
ff088f50e2 chore: 🤖 remove unused file 2020-02-03 11:24:50 -03:00
Christian Kaisermann
25f85c556f chore: 🤖 fix crazy types conflict 2020-02-03 11:24:50 -03:00
Christian Kaisermann
7bf47d8790 feat: 🎸 add runtime typings
 Closes: Closes #43
2020-02-03 11:24:50 -03:00
Christian Kaisermann
31b556bc3f feat: 🎸 make getClientLocale tree-shakeable
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({ ... })
})
```
2020-02-03 11:24:50 -03:00
Christian Kaisermann
0822841140 refactor: 💡 split single utils file into multiple files 2020-02-03 11:24:50 -03:00
Christian Kaisermann
0e0a31fc9e chore: 🤖 remove unused methods 2020-02-03 11:24:50 -03:00
Christian Kaisermann
9f352845e1 refactor: 💡 rename getIn to deepGet 2020-02-03 11:24:50 -03:00
Christian Kaisermann
6526245bf9 feat: 🎸 make date,time and number formatters tree-shakeable
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'`
2020-02-03 11:24:50 -03:00
Christian Kaisermann
e400e62a62 refactor: 💡 add correct typings for formatter getters 2020-01-29 11:46:34 -03:00
Ramiro Rikkert
27871f9775
fix: memoizing of formatters when no locale is given. (#47) 2020-01-29 11:29:32 -03:00
Christian Kaisermann
88f7762e96 fix: 🐛 types from v3 branch leaking to master branch 🤷 2020-01-23 10:41:14 -03:00
Christian Kaisermann
bb6dd01558 chore: 🤖 oops, fix actual build-time types being git ignored 2020-01-23 10:32:56 -03:00
Christian Kaisermann
dadeaa2e7f feat: 🎸 add runtime typings
 Closes: Closes #43
2020-01-23 10:11:04 -03:00
Christian Kaisermann
932847be2d refactor: 💡 remove fast-memoize in favour of simple monadic fn 2020-01-21 10:23:18 -03:00
Christian Kaisermann
e02427de3b test: 💍 add flatObj and getIn tests 2020-01-15 13:59:31 -03:00
Christian Kaisermann
270aefa199 refactor: 💡 remove deepmerge and dlv dependencies
No need for them anymore. We now flat the dicitonary partials on
`addMessages`
2020-01-15 13:59:31 -03:00
Christian Kaisermann
bb8c68f2eb fix: 🐛 lookup message not caching correctly
It was only caching lookups of fallback locales. If a message was found
in the passed locale, it wouldn't be cached.
2020-01-08 11:33:01 -03:00
Christian Kaisermann
0c57b9b568 fix: 🐛 make message formatter default to current locale 2020-01-06 22:36:31 -03:00
Miguel Camba
86cca99251 feat: add low level API to get access to the formatters (#31)
* Add test
* Change approach, export functions to access the formatters instead
2020-01-06 22:36:04 -03:00
Christian Kaisermann
7bef16f344 test: 💍 fix waitLocale tests and add missing formatter tests 2019-11-29 00:25:31 -03:00
Christian Kaisermann
cee3d82b4a chore: 🤖 fix lint issues 2019-11-28 23:40:57 -03:00
Christian Kaisermann
0b7f61c49a fix: 🐛 allow to wait for initial locale load 2019-11-28 23:35:48 -03:00
Christian Kaisermann
e08fa29099 test: 💍 add missing test for component without script 2019-11-28 23:16:15 -03:00
Christian Kaisermann
15ed03185a test: 💍 add some tests for the cli 2019-11-28 22:57:05 -03:00
Christian Kaisermann
60ba73682f test: 💍 add more tests for loaderQueue 2019-11-28 16:17:22 -03:00
Christian Kaisermann
efbe793a0f feat: 🎸 add warnOnMissingMessages 2019-11-28 14:59:52 -03:00
Christian Kaisermann
9d636694b1 refactor: 💡 formatter format/manual options logic 2019-11-27 16:20:21 -03:00
Christian Kaisermann
850fd09f32 test: 💍 add tests for formatters 2019-11-27 13:26:18 -03:00
Christian Kaisermann
300f965a87 refactor: 💡 configure to init 2019-11-27 00:58:53 -03:00
Christian Kaisermann
cf8d32f0a6 test: 💍 add some misisng tests 2019-11-26 22:29:40 -03:00
Christian Kaisermann
b3098ba67b test: 💍 add test for lookup and loader queue 2019-11-26 22:00:23 -03:00
Christian Kaisermann
21afa3d6b1 test: 💍 add tests for getClientLocale precedence 2019-11-26 13:18:07 -03:00
Christian Kaisermann
e56bfbd333 test: 💍 add tests for config and utils 2019-11-26 13:06:26 -03:00
Christian Kaisermann
36bf7f5038 refactor: 💡 shrink configs API contact points 2019-11-25 23:05:17 -03:00
Christian Kaisermann
965c18acc1 test: 💍 add tests for dictionary store and utilities 2019-11-25 21:41:09 -03:00
Christian Kaisermann
07fb37e325 test: 💍 add some tests for locale related methods 2019-11-25 17:16:38 -03:00
Christian Kaisermann
9260b83756 fix: 🐛 fallback locale being looked twice 2019-11-24 20:22:41 -03:00
Christian Kaisermann
1ea650860c chore(release): v2.0.1 🎉 2019-11-24 00:21:17 -03:00
Christian Kaisermann
6e0df2fb25 fix: 🐛 fallback behaviour and simplify API contact points 2019-11-24 00:21:17 -03:00
Christian Kaisermann
233842baa2 refactor: 💡 remove removeFromLookupCache method 2019-11-22 13:51:18 -03:00
Christian Kaisermann
66972d4b15 fix: 🐛 flush use the same promise if it wasn't resolved yet 2019-11-22 13:51:18 -03:00
Christian Kaisermann
5f3595013e chore: 🤖 add warning of existing queue when id is not found 2019-11-22 13:51:18 -03:00
Christian Kaisermann
49e9562890 refactor: 💡 rename fallback locale methods 2019-11-22 13:51:18 -03:00
Christian Kaisermann
64c8e55f80 feat: 🎸 locale change automatically updates the document lang 2019-11-22 13:51:18 -03:00
Christian Kaisermann
06946ee3d1 refactor: 💡 rename addMessagesTo to addMessages 2019-11-22 13:51:18 -03:00
Christian Kaisermann
6ee28e7d27 feat: 🎸 add waitInitialLocale helper 2019-11-22 13:51:18 -03:00
Christian Kaisermann
c9eb746797 style: 💄 fix eslint errors 2019-11-22 13:51:18 -03:00