diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2020-12-26 10:01:32 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2020-12-26 10:01:32 +0900 |
| commit | 9d81d068533aaddf8e8654f9e86374c6531766bb (patch) | |
| tree | 2b6ff1106eff6431a2562e7e1fd8fd2531000045 /src/client/scripts | |
| parent | Showusers order by updateAt NULL considered as max (#7015) (diff) | |
| download | sharkey-9d81d068533aaddf8e8654f9e86374c6531766bb.tar.gz sharkey-9d81d068533aaddf8e8654f9e86374c6531766bb.tar.bz2 sharkey-9d81d068533aaddf8e8654f9e86374c6531766bb.zip | |
wip
Diffstat (limited to 'src/client/scripts')
| -rw-r--r-- | src/client/scripts/set-i18n-contexts.ts | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/src/client/scripts/set-i18n-contexts.ts b/src/client/scripts/set-i18n-contexts.ts deleted file mode 100644 index 6014957361..0000000000 --- a/src/client/scripts/set-i18n-contexts.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { clientDb, clear, bulkSet } from '../db'; -import { deepEntries, delimitEntry } from 'deep-entries'; - -export function setI18nContexts(lang: string, version: string, cleardb = false) { - return Promise.all([ - cleardb ? clear(clientDb.i18n) : Promise.resolve(), - fetch(`/assets/locales/${lang}.${version}.json`) - ]) - .then(([, response]) => response.json()) - .then(locale => { - const flatLocaleEntries = deepEntries(locale, delimitEntry) as [string, string][]; - bulkSet(flatLocaleEntries, clientDb.i18n); - return Object.fromEntries(flatLocaleEntries); - }); -} |