mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 06:37:18 +01:00
Normalize fetch response.
This commit is contained in:
parent
dcf0da7b14
commit
444b828bc9
5 changed files with 38 additions and 25 deletions
|
|
@ -20,13 +20,7 @@ export function useLocale() {
|
|||
const dateLocale = getDateLocale(locale);
|
||||
|
||||
async function loadMessages(locale: string) {
|
||||
const { ok, data } = await httpGet(
|
||||
`${process.env.basePath || ''}/intl/messages/${locale}.json`,
|
||||
);
|
||||
|
||||
if (ok) {
|
||||
messages[locale] = data;
|
||||
}
|
||||
messages[locale] = await httpGet(`${process.env.basePath || ''}/intl/messages/${locale}.json`);
|
||||
}
|
||||
|
||||
async function saveLocale(value: string) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue