mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-24 18:26:20 +01:00
Updated messages.
This commit is contained in:
parent
7270d95240
commit
7071f5fba5
@ -1,5 +1,4 @@
|
|||||||
import React from 'react';
|
import { defineMessages } from 'react-intl';
|
||||||
import { defineMessages, FormattedMessage } from 'react-intl';
|
|
||||||
|
|
||||||
export const labels = defineMessages({
|
export const labels = defineMessages({
|
||||||
unknown: { id: 'label.unknown', defaultMessage: 'Unknown' },
|
unknown: { id: 'label.unknown', defaultMessage: 'Unknown' },
|
||||||
@ -13,5 +12,5 @@ export const devices = defineMessages({
|
|||||||
});
|
});
|
||||||
|
|
||||||
export function getDeviceMessage(device) {
|
export function getDeviceMessage(device) {
|
||||||
return <FormattedMessage {...(devices[device] || labels.unknown)} />;
|
return devices[device] || labels.unknown;
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ export default function DevicesTable({ websiteId, ...props }) {
|
|||||||
type="device"
|
type="device"
|
||||||
metric={<FormattedMessage id="metrics.visitors" defaultMessage="Visitors" />}
|
metric={<FormattedMessage id="metrics.visitors" defaultMessage="Visitors" />}
|
||||||
websiteId={websiteId}
|
websiteId={websiteId}
|
||||||
renderLabel={({ x }) => getDeviceMessage(x)}
|
renderLabel={({ x }) => <FormattedMessage {...getDeviceMessage(x)} />}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ import Tag from 'components/common/Tag';
|
|||||||
import Dot from 'components/common/Dot';
|
import Dot from 'components/common/Dot';
|
||||||
import FilterButtons from 'components/common/FilterButtons';
|
import FilterButtons from 'components/common/FilterButtons';
|
||||||
import NoData from 'components/common/NoData';
|
import NoData from 'components/common/NoData';
|
||||||
import { getDeviceMessage } from 'components/messages';
|
import { getDeviceMessage, labels } from 'components/messages';
|
||||||
import useLocale from 'hooks/useLocale';
|
import useLocale from 'hooks/useLocale';
|
||||||
import useCountryNames from 'hooks/useCountryNames';
|
import useCountryNames from 'hooks/useCountryNames';
|
||||||
import { BROWSERS } from 'lib/constants';
|
import { BROWSERS } from 'lib/constants';
|
||||||
@ -129,15 +129,10 @@ export default function RealtimeLog({ data, websites, websiteId }) {
|
|||||||
id="message.log.visitor"
|
id="message.log.visitor"
|
||||||
defaultMessage="Visitor from {country} using {browser} on {os} {device}"
|
defaultMessage="Visitor from {country} using {browser} on {os} {device}"
|
||||||
values={{
|
values={{
|
||||||
country: (
|
country: <b>{countryNames[country] || intl.formatMessage(labels.unknown)}</b>,
|
||||||
<b>
|
|
||||||
{countryNames[country] ||
|
|
||||||
intl.formatMessage({ id: 'label.unknown', defaultMessage: 'Unknown' })}
|
|
||||||
</b>
|
|
||||||
),
|
|
||||||
browser: <b>{BROWSERS[browser]}</b>,
|
browser: <b>{BROWSERS[browser]}</b>,
|
||||||
os: <b>{os}</b>,
|
os: <b>{os}</b>,
|
||||||
device: <b>{getDeviceMessage(device)}</b>,
|
device: <b>{intl.formatMessage(getDeviceMessage(device))}</b>,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user