mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 17:55:08 +01:00
14 lines
345 B
JavaScript
14 lines
345 B
JavaScript
import { useDispatch, useSelector } from 'react-redux';
|
|
import { updateApp } from 'redux/actions/app';
|
|
|
|
export default function useLocale() {
|
|
const locale = useSelector(state => state.app.locale);
|
|
const dispatch = useDispatch();
|
|
|
|
function setLocale(value) {
|
|
dispatch(updateApp({ locale: value }));
|
|
}
|
|
|
|
return [locale, setLocale];
|
|
}
|