mirror of
https://github.com/umami-software/umami.git
synced 2026-02-20 12:35:38 +01:00
useLanguageNames
This commit is contained in:
parent
170d1dff7a
commit
e65255794e
3 changed files with 3 additions and 37 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import MetricsTable, { MetricsTableProps } from './MetricsTable';
|
||||
import { percentFilter } from 'lib/filters';
|
||||
import { useLanguageNames } from 'components/hooks';
|
||||
import { useIntl } from 'react-intl';
|
||||
import { useLocale } from 'components/hooks';
|
||||
import { useMessages } from 'components/hooks';
|
||||
|
||||
|
|
@ -10,7 +10,8 @@ export function LanguagesTable({
|
|||
}: { onDataLoad: (data: any) => void } & MetricsTableProps) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { locale } = useLocale();
|
||||
const languageNames = useLanguageNames(locale);
|
||||
const intl = useIntl();
|
||||
const languageNames = intl.formatDisplayName(locale, { type: 'language' });
|
||||
|
||||
const renderLabel = ({ x }) => {
|
||||
return <div className={locale}>{languageNames[x?.split('-')[0]] ?? x}</div>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue