mirror of
https://github.com/umami-software/umami.git
synced 2026-02-18 11:35:37 +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
|
|
@ -14,22 +14,22 @@ export function AdminTeamsTable({
|
|||
data: any[];
|
||||
showActions?: boolean;
|
||||
}) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { t, labels } = useMessages();
|
||||
const [deleteTeam, setDeleteTeam] = useState(null);
|
||||
|
||||
return (
|
||||
<>
|
||||
<DataTable data={data}>
|
||||
<DataColumn id="name" label={formatMessage(labels.name)} width="1fr">
|
||||
<DataColumn id="name" label={t(labels.name)} width="1fr">
|
||||
{(row: any) => <Link href={`/admin/teams/${row.id}`}>{row.name}</Link>}
|
||||
</DataColumn>
|
||||
<DataColumn id="websites" label={formatMessage(labels.members)} width="140px">
|
||||
<DataColumn id="websites" label={t(labels.members)} width="140px">
|
||||
{(row: any) => row?._count?.members}
|
||||
</DataColumn>
|
||||
<DataColumn id="members" label={formatMessage(labels.websites)} width="140px">
|
||||
<DataColumn id="members" label={t(labels.websites)} width="140px">
|
||||
{(row: any) => row?._count?.websites}
|
||||
</DataColumn>
|
||||
<DataColumn id="owner" label={formatMessage(labels.owner)}>
|
||||
<DataColumn id="owner" label={t(labels.owner)}>
|
||||
{(row: any) => {
|
||||
const name = row?.members?.[0]?.user?.username;
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ export function AdminTeamsTable({
|
|||
);
|
||||
}}
|
||||
</DataColumn>
|
||||
<DataColumn id="created" label={formatMessage(labels.created)} width="160px">
|
||||
<DataColumn id="created" label={t(labels.created)} width="160px">
|
||||
{(row: any) => <DateDistance date={new Date(row.createdAt)} />}
|
||||
</DataColumn>
|
||||
{showActions && (
|
||||
|
|
@ -55,7 +55,7 @@ export function AdminTeamsTable({
|
|||
<Icon>
|
||||
<Edit />
|
||||
</Icon>
|
||||
<Text>{formatMessage(labels.edit)}</Text>
|
||||
<Text>{t(labels.edit)}</Text>
|
||||
</Row>
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
|
|
@ -67,7 +67,7 @@ export function AdminTeamsTable({
|
|||
<Icon>
|
||||
<Trash />
|
||||
</Icon>
|
||||
<Text>{formatMessage(labels.delete)}</Text>
|
||||
<Text>{t(labels.delete)}</Text>
|
||||
</Row>
|
||||
</MenuItem>
|
||||
</MenuButton>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue