mirror of
https://github.com/cupcakearmy/svelte-i18n.git
synced 2024-11-16 09:59:58 +01:00
refactor: 💡 remove removeFromLookupCache method
This commit is contained in:
parent
66972d4b15
commit
233842baa2
@ -3,7 +3,7 @@ import resolvePath from 'object-resolve-path'
|
||||
|
||||
import { hasLocaleDictionary } from '../stores/dictionary'
|
||||
|
||||
import { getGenericLocaleFrom } from './utils'
|
||||
import { getFallbackLocale } from './utils'
|
||||
|
||||
const lookupCache: Record<string, Record<string, string>> = {}
|
||||
|
||||
@ -14,10 +14,6 @@ const addToCache = (path: string, locale: string, message: string) => {
|
||||
return message
|
||||
}
|
||||
|
||||
export const removeFromLookupCache = (locale: string) => {
|
||||
delete lookupCache[locale]
|
||||
}
|
||||
|
||||
export const lookupMessage = (
|
||||
dictionary: any,
|
||||
path: string,
|
||||
@ -38,6 +34,6 @@ export const lookupMessage = (
|
||||
return addToCache(
|
||||
path,
|
||||
locale,
|
||||
lookupMessage(dictionary, path, getGenericLocaleFrom(locale))
|
||||
lookupMessage(dictionary, path, getFallbackLocale(locale))
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user