From 233842baa22ec600c6dcb9ec383438d2dfe45701 Mon Sep 17 00:00:00 2001 From: Christian Kaisermann Date: Thu, 21 Nov 2019 23:33:52 -0300 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20remove=20removeFromL?= =?UTF-8?q?ookupCache=20method?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/includes/lookup.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/client/includes/lookup.ts b/src/client/includes/lookup.ts index 130ced2..39d0ec4 100644 --- a/src/client/includes/lookup.ts +++ b/src/client/includes/lookup.ts @@ -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> = {} @@ -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)) ) }