diff --git a/.gitignore b/.gitignore index 32d3cbce..1f55fbcc 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ /build /public/umami.js /public/geo +/public/lang /lang-compiled # misc diff --git a/components/common/Calendar.js b/components/common/Calendar.js index 92fd311c..fd28363c 100644 --- a/components/common/Calendar.js +++ b/components/common/Calendar.js @@ -27,7 +27,7 @@ import styles from './Calendar.module.css'; import Icon from './Icon'; export default function Calendar({ date, minDate, maxDate, onChange }) { - const [locale] = useLocale(); + const { locale } = useLocale(); const [selectMonth, setSelectMonth] = useState(false); const [selectYear, setSelectYear] = useState(false); diff --git a/components/common/DateFilter.js b/components/common/DateFilter.js index 7e35a010..ba3417d1 100644 --- a/components/common/DateFilter.js +++ b/components/common/DateFilter.js @@ -55,7 +55,7 @@ const filterOptions = [ ]; function DateFilter({ value, startDate, endDate, onChange, className }) { - const [locale] = useLocale(); + const { locale } = useLocale(); const [showPicker, setShowPicker] = useState(false); const displayValue = value === 'custom' ? ( @@ -102,7 +102,7 @@ function DateFilter({ value, startDate, endDate, onChange, className }) { } const CustomRange = ({ startDate, endDate, onClick }) => { - const [locale] = useLocale(); + const { locale } = useLocale(); function handleClick(e) { e.stopPropagation(); diff --git a/components/common/RefreshButton.js b/components/common/RefreshButton.js index 61f06a3c..91a43ab8 100644 --- a/components/common/RefreshButton.js +++ b/components/common/RefreshButton.js @@ -12,7 +12,7 @@ import useLocale from 'hooks/useLocale'; function RefreshButton({ websiteId }) { const dispatch = useDispatch(); - const [locale] = useLocale(); + const { locale } = useLocale(); const [dateRange] = useDateRange(websiteId); const [loading, setLoading] = useState(false); const completed = useSelector(state => state.queries[`/api/website/${websiteId}/stats`]); diff --git a/components/common/WorldMap.js b/components/common/WorldMap.js index 0fa4c234..6dc8a359 100644 --- a/components/common/WorldMap.js +++ b/components/common/WorldMap.js @@ -24,7 +24,7 @@ function WorldMap({ data, className }) { }), [theme], ); - const [locale] = useLocale(); + const { locale } = useLocale(); const countryNames = useCountryNames(locale); function getFillColor(code) { diff --git a/components/layout/Footer.js b/components/layout/Footer.js index 6b23a8e6..0e1a4cb5 100644 --- a/components/layout/Footer.js +++ b/components/layout/Footer.js @@ -9,7 +9,7 @@ import { rtlLocales } from 'lib/lang'; export default function Footer() { const { current } = useVersion(); - const [locale] = useLocale(); + const { locale } = useLocale(); return (