mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Dynamically fetch language bundles at runtime.
This commit is contained in:
parent
73e83ad767
commit
f91cc82c82
20 changed files with 95 additions and 132 deletions
|
|
@ -9,7 +9,7 @@ import styles from './DateRangeSetting.module.css';
|
|||
import useLocale from 'hooks/useLocale';
|
||||
|
||||
export default function DateRangeSetting() {
|
||||
const [locale] = useLocale();
|
||||
const { locale } = useLocale();
|
||||
const [dateRange, setDateRange] = useDateRange();
|
||||
const { startDate, endDate, value } = dateRange;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
import React from 'react';
|
||||
import { menuOptions } from 'lib/lang';
|
||||
import { languages } from 'lib/lang';
|
||||
import useLocale from 'hooks/useLocale';
|
||||
import MenuButton from 'components/common/MenuButton';
|
||||
import Globe from 'assets/globe.svg';
|
||||
import styles from './LanguageButton.module.css';
|
||||
|
||||
export default function LanguageButton() {
|
||||
const [locale, setLocale] = useLocale();
|
||||
const { locale, saveLocale } = useLocale();
|
||||
const menuOptions = Object.keys(languages).map(key => ({ ...languages[key], value: key }));
|
||||
|
||||
function handleSelect(value) {
|
||||
setLocale(value);
|
||||
saveLocale(value);
|
||||
}
|
||||
|
||||
switch (locale) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue