mirror of
https://github.com/umami-software/umami.git
synced 2026-02-11 16:17:13 +01:00
Updated login and layout pages.
This commit is contained in:
parent
9d967fb0fe
commit
4f15c4f146
18 changed files with 103 additions and 106 deletions
|
|
@ -1,11 +1,10 @@
|
|||
import { useEffect } from 'react';
|
||||
import { useRouter } from 'next/router';
|
||||
import { setItem } from 'next-basics';
|
||||
import { get, setItem } from 'next-basics';
|
||||
import { LOCALE_CONFIG } from 'lib/constants';
|
||||
import { getDateLocale, getTextDirection } from 'lib/lang';
|
||||
import useStore, { setLocale } from 'store/app';
|
||||
import useForceUpdate from 'hooks/useForceUpdate';
|
||||
import useApi from 'hooks/useApi';
|
||||
import enUS from 'public/intl/messages/en-US.json';
|
||||
|
||||
const messages = {
|
||||
|
|
@ -20,12 +19,11 @@ export default function useLocale() {
|
|||
const forceUpdate = useForceUpdate();
|
||||
const dir = getTextDirection(locale);
|
||||
const dateLocale = getDateLocale(locale);
|
||||
const { get } = useApi();
|
||||
|
||||
async function loadMessages(locale) {
|
||||
const data = await get(`${basePath}/intl/messages/${locale}.json`);
|
||||
const { ok, data } = await get(`${basePath}/intl/messages/${locale}.json`);
|
||||
|
||||
if (data) {
|
||||
if (ok) {
|
||||
messages[locale] = data;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue