feat(desktop): add i18n infrastructure with react-intl (#8105)

This commit is contained in:
jh-block
2026-03-27 19:39:50 +01:00
committed by GitHub
parent d596113e72
commit a6765fbcd9
172 changed files with 13793 additions and 2054 deletions
@@ -1,6 +1,14 @@
import React from 'react';
import { defineMessages, useIntl } from '../i18n';
import { cn } from '../utils';
const i18n = defineMessages({
toolStatus: {
id: 'toolCallStatusIndicator.toolStatus',
defaultMessage: 'Tool status: {status}',
},
});
export type ToolCallStatus = 'pending' | 'loading' | 'success' | 'error';
interface ToolCallStatusIndicatorProps {
@@ -12,6 +20,7 @@ export const ToolCallStatusIndicator: React.FC<ToolCallStatusIndicatorProps> = (
status,
className,
}) => {
const intl = useIntl();
const getStatusStyles = () => {
switch (status) {
case 'success':
@@ -33,7 +42,7 @@ export const ToolCallStatusIndicator: React.FC<ToolCallStatusIndicatorProps> = (
getStatusStyles(),
className
)}
aria-label={`Tool status: ${status}`}
aria-label={intl.formatMessage(i18n.toolStatus, { status })}
/>
);
};