diff --git a/src/client/includes/loaderQueue.ts b/src/client/includes/loaderQueue.ts index e250ed1..4db9bab 100644 --- a/src/client/includes/loaderQueue.ts +++ b/src/client/includes/loaderQueue.ts @@ -2,7 +2,7 @@ import { MessagesLoader } from '../types' import { hasLocaleDictionary, $dictionary, - addMessagesTo, + addMessages, } from '../stores/dictionary' import { getCurrentLocale } from '../stores/locale' import { $isLoading } from '../stores/loading' @@ -62,7 +62,7 @@ export async function flushQueue(locale: string = getCurrentLocale()) { partials = partials.map(partial => partial.default || partial) removeFromLookupCache(locale) - addMessagesTo(locale, ...partials) + addMessages(locale, ...partials) }) .then(() => { clearTimeout(loadingDelay) diff --git a/src/client/index.ts b/src/client/index.ts index d973e9e..24f88df 100644 --- a/src/client/index.ts +++ b/src/client/index.ts @@ -20,7 +20,7 @@ export { $locale as locale, loadLocale as preloadLocale } from './stores/locale' export { $dictionary as dictionary, $locales as locales, - addMessagesTo, + addMessages, } from './stores/dictionary' export { $isLoading as isLoading } from './stores/loading' export { $format as format, $format as _, $format as t } from './stores/format' diff --git a/src/client/stores/dictionary.ts b/src/client/stores/dictionary.ts index 0a62393..04428b8 100644 --- a/src/client/stores/dictionary.ts +++ b/src/client/stores/dictionary.ts @@ -18,7 +18,7 @@ function hasLocaleDictionary(locale: string) { return locale in dictionary } -function addMessagesTo(locale: string, ...partials: LocaleDictionary[]) { +function addMessages(locale: string, ...partials: LocaleDictionary[]) { $dictionary.update(d => { dictionary[locale] = merge.all([dictionary[locale] || {}].concat(partials)) return d @@ -34,5 +34,5 @@ export { $locales, getDictionary, hasLocaleDictionary, - addMessagesTo, + addMessages, } diff --git a/test/client/index.test.ts b/test/client/index.test.ts index ecae6d0..aa4320f 100644 --- a/test/client/index.test.ts +++ b/test/client/index.test.ts @@ -1,4 +1,4 @@ -// todo this is a mess +// TODO remake this, it's a mess import { Formatter } from '../../src/client/types' import { dictionary,