Commit Graph

109 Commits

Author SHA1 Message Date
Christian Kaisermann
4cc2088bef chore: remove unused methods 2021-03-27 17:01:18 -03:00
Christian Kaisermann
5db1dbc3a4 fix: 🐛 support more specific fallback locale (i.e en-GB vs en)
 Closes: #137
2021-03-27 17:01:18 -03:00
Benjamin Buhler
88ad5b2180
fix: clear locale lookup cache when new messages are added (#130)
* 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>
2021-03-17 15:43:23 -03:00
Christian Kaisermann
396e181e00 fix: 🐛 generated types directory 2021-02-25 08:13:48 -03:00
Christian Kaisermann
980bc18f29 fix: 🐛 support deep properties keyed with dots
 Closes: #129
2021-02-21 13:18:50 -03:00
Christian Kaisermann
256b5cd37c chore: fix lint issues 2021-02-21 13:18:48 -03:00
Christian Kaisermann
9b5023edbf test: 💍 add tests for invalid ICU syntax 2021-02-15 13:39:11 -03:00
Ivan Chalyk
0d623f9884
fix: crash if message has syntax error (#128)
* fix crash if message has syntax error

* fix custom number format test & lint require error

Co-authored-by: Ivan Chalyk <boomfly@boomfly-pro.local>
2021-02-15 13:36:28 -03:00
Max Stewart
341ed7f363
fix: expose intl-messageformat option ignoreTag and default to true for backwards compatibility. (#121) 2021-02-10 21:42:23 -03:00
Christian Kaisermann
41d8e4d28b fix: 🐛 default $json type to any 2021-02-10 21:22:48 -03:00
Christian Kaisermann
739d784c16 Refactor type imports to use type modifier 2020-12-03 15:08:34 -03:00
Christian Kaisermann
3add4e66b7 refactor: 💡 warn on deprecated usage instead of error-ing 2020-11-24 10:50:25 -03:00
Christian Kaisermann
8db3ad6b4f refactor: 💡 easier to understand browser entrypoint 2020-11-24 10:50:25 -03:00
Christian Kaisermann
9dd1a19aef feat: 🎸 add $json method to get raw dictionary values
 Closes: #109, #83
2020-11-24 10:50:25 -03:00
Christian Kaisermann
40e6dbe8f7 fix: 🐛 message formatter type
 Closes: #109
2020-11-23 08:04:16 -03:00
Christian Kaisermann
d87caef060 fix: 🐛 regression of flat keys separated by dot 2020-11-08 19:09:45 -03:00
Christian Kaisermann
0caaead478 fix: 🐛 possible interpolation value types 2020-11-07 11:31:11 -03:00
Christian Kaisermann
9b6adb6538 fix: 🐛 prevent extraction of non-deterministic message ids
 Closes: #89
2020-11-06 10:04:16 -03:00
Christian Kaisermann
330f20b7bd fix: 🐛 interpolate values for default values and missing keys
 Closes: #101
2020-11-05 17:52:22 -03:00
Christian Kaisermann
2663893792 refactor: 💡 replace commander with sade 2020-11-05 17:51:26 -03:00
Christian Kaisermann
ff541367f8 feat: 🎸 Support getting deep localized objects/arrays
 Closes: Closes #83
2020-11-05 15:55:42 -03:00
Christian Kaisermann
e659889f43 chore: 🤖 update linter deps and format project 2020-09-20 10:14:26 -03:00
Christian Kaisermann
68e8c51a63 fix: export correct configuration type 2020-09-20 10:12:18 -03:00
Christian Kaisermann
e560514b1d fix: 🐛 also wait for loaders added while loading 2020-05-31 12:50:57 -03:00
Christian Kaisermann
07ef1da6d5 fix: 🐛 prevent server from breaking on locale.set
Closes #55
2020-03-29 16:54:08 -03:00
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