mirror of
https://github.com/umami-software/umami.git
synced 2026-02-16 10:35:35 +01:00
Simplify i18n: remove old react-intl artifacts, rename formatMessage to t, replace FormattedMessage with t.rich().
- Rewrite messages.ts to plain string key maps (remove MessageDescriptor) - Rewrite useMessages hook to expose t from useTranslations() directly - Rename formatMessage → t across 193 consumer files - Replace custom FormattedMessage component with next-intl t.rich() - Update 52 language files to use rich text tags (<b>, <a>) - Remove all direct imports from @/components/messages in favor of useMessages() Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
80cad6ea65
commit
50edb71687
247 changed files with 1660 additions and 2194 deletions
|
|
@ -35,7 +35,7 @@ export function WebsiteExpandedMenu({
|
|||
excludedIds?: string[];
|
||||
onItemClick?: () => void;
|
||||
}) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { t, labels } = useMessages();
|
||||
const {
|
||||
updateParams,
|
||||
query: { view },
|
||||
|
|
@ -49,176 +49,176 @@ export function WebsiteExpandedMenu({
|
|||
items: [
|
||||
{
|
||||
id: 'path',
|
||||
label: formatMessage(labels.path),
|
||||
label: t(labels.path),
|
||||
path: updateParams({ view: 'path' }),
|
||||
icon: <SquareSlash />,
|
||||
},
|
||||
{
|
||||
id: 'entry',
|
||||
label: formatMessage(labels.entry),
|
||||
label: t(labels.entry),
|
||||
path: updateParams({ view: 'entry' }),
|
||||
icon: <LogIn />,
|
||||
},
|
||||
{
|
||||
id: 'exit',
|
||||
label: formatMessage(labels.exit),
|
||||
label: t(labels.exit),
|
||||
path: updateParams({ view: 'exit' }),
|
||||
icon: <LogOut />,
|
||||
},
|
||||
{
|
||||
id: 'title',
|
||||
label: formatMessage(labels.title),
|
||||
label: t(labels.title),
|
||||
path: updateParams({ view: 'title' }),
|
||||
icon: <Type />,
|
||||
},
|
||||
{
|
||||
id: 'query',
|
||||
label: formatMessage(labels.query),
|
||||
label: t(labels.query),
|
||||
path: updateParams({ view: 'query' }),
|
||||
icon: <Search />,
|
||||
},
|
||||
].filter(filterExcluded),
|
||||
},
|
||||
{
|
||||
label: formatMessage(labels.sources),
|
||||
label: t(labels.sources),
|
||||
items: [
|
||||
{
|
||||
id: 'referrer',
|
||||
label: formatMessage(labels.referrer),
|
||||
label: t(labels.referrer),
|
||||
path: updateParams({ view: 'referrer' }),
|
||||
icon: <Share2 />,
|
||||
},
|
||||
{
|
||||
id: 'channel',
|
||||
label: formatMessage(labels.channel),
|
||||
label: t(labels.channel),
|
||||
path: updateParams({ view: 'channel' }),
|
||||
icon: <Megaphone />,
|
||||
},
|
||||
{
|
||||
id: 'domain',
|
||||
label: formatMessage(labels.domain),
|
||||
label: t(labels.domain),
|
||||
path: updateParams({ view: 'domain' }),
|
||||
icon: <Globe />,
|
||||
},
|
||||
].filter(filterExcluded),
|
||||
},
|
||||
{
|
||||
label: formatMessage(labels.location),
|
||||
label: t(labels.location),
|
||||
items: [
|
||||
{
|
||||
id: 'country',
|
||||
label: formatMessage(labels.country),
|
||||
label: t(labels.country),
|
||||
path: updateParams({ view: 'country' }),
|
||||
icon: <Earth />,
|
||||
},
|
||||
{
|
||||
id: 'region',
|
||||
label: formatMessage(labels.region),
|
||||
label: t(labels.region),
|
||||
path: updateParams({ view: 'region' }),
|
||||
icon: <MapPin />,
|
||||
},
|
||||
{
|
||||
id: 'city',
|
||||
label: formatMessage(labels.city),
|
||||
label: t(labels.city),
|
||||
path: updateParams({ view: 'city' }),
|
||||
icon: <Landmark />,
|
||||
},
|
||||
].filter(filterExcluded),
|
||||
},
|
||||
{
|
||||
label: formatMessage(labels.environment),
|
||||
label: t(labels.environment),
|
||||
items: [
|
||||
{
|
||||
id: 'browser',
|
||||
label: formatMessage(labels.browser),
|
||||
label: t(labels.browser),
|
||||
path: updateParams({ view: 'browser' }),
|
||||
icon: <AppWindow />,
|
||||
},
|
||||
{
|
||||
id: 'os',
|
||||
label: formatMessage(labels.os),
|
||||
label: t(labels.os),
|
||||
path: updateParams({ view: 'os' }),
|
||||
icon: <Cpu />,
|
||||
},
|
||||
{
|
||||
id: 'device',
|
||||
label: formatMessage(labels.device),
|
||||
label: t(labels.device),
|
||||
path: updateParams({ view: 'device' }),
|
||||
icon: <Laptop />,
|
||||
},
|
||||
{
|
||||
id: 'language',
|
||||
label: formatMessage(labels.language),
|
||||
label: t(labels.language),
|
||||
path: updateParams({ view: 'language' }),
|
||||
icon: <Languages />,
|
||||
},
|
||||
{
|
||||
id: 'screen',
|
||||
label: formatMessage(labels.screen),
|
||||
label: t(labels.screen),
|
||||
path: updateParams({ view: 'screen' }),
|
||||
icon: <Monitor />,
|
||||
},
|
||||
].filter(filterExcluded),
|
||||
},
|
||||
{
|
||||
label: formatMessage(labels.utm),
|
||||
label: t(labels.utm),
|
||||
items: [
|
||||
{
|
||||
id: 'utmSource',
|
||||
label: formatMessage(labels.source),
|
||||
label: t(labels.source),
|
||||
path: updateParams({ view: 'utmSource' }),
|
||||
icon: <Link2 />,
|
||||
},
|
||||
{
|
||||
id: 'utmMedium',
|
||||
label: formatMessage(labels.medium),
|
||||
label: t(labels.medium),
|
||||
path: updateParams({ view: 'utmMedium' }),
|
||||
icon: <Send />,
|
||||
},
|
||||
{
|
||||
id: 'utmCampaign',
|
||||
label: formatMessage(labels.campaign),
|
||||
label: t(labels.campaign),
|
||||
path: updateParams({ view: 'utmCampaign' }),
|
||||
icon: <Target />,
|
||||
},
|
||||
{
|
||||
id: 'utmContent',
|
||||
label: formatMessage(labels.content),
|
||||
label: t(labels.content),
|
||||
path: updateParams({ view: 'utmContent' }),
|
||||
icon: <Layers />,
|
||||
},
|
||||
{
|
||||
id: 'utmTerm',
|
||||
label: formatMessage(labels.term),
|
||||
label: t(labels.term),
|
||||
path: updateParams({ view: 'utmTerm' }),
|
||||
icon: <KeyRound />,
|
||||
},
|
||||
].filter(filterExcluded),
|
||||
},
|
||||
{
|
||||
label: formatMessage(labels.other),
|
||||
label: t(labels.other),
|
||||
items: [
|
||||
{
|
||||
id: 'event',
|
||||
label: formatMessage(labels.event),
|
||||
label: t(labels.event),
|
||||
path: updateParams({ view: 'event' }),
|
||||
icon: <Lightning />,
|
||||
},
|
||||
{
|
||||
id: 'hostname',
|
||||
label: formatMessage(labels.hostname),
|
||||
label: t(labels.hostname),
|
||||
path: updateParams({ view: 'hostname' }),
|
||||
icon: <Network />,
|
||||
},
|
||||
{
|
||||
id: 'distinctId',
|
||||
label: formatMessage(labels.distinctId),
|
||||
label: t(labels.distinctId),
|
||||
path: updateParams({ view: 'distinctId' }),
|
||||
icon: <Fingerprint />,
|
||||
},
|
||||
{
|
||||
id: 'tag',
|
||||
label: formatMessage(labels.tag),
|
||||
label: t(labels.tag),
|
||||
path: updateParams({ view: 'tag' }),
|
||||
icon: <Tag />,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue