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
@@ -2,12 +2,25 @@ import { Button } from '../../ui/button';
import { RefreshCw } from 'lucide-react';
import { useConfig } from '../../ConfigContext';
import { View, ViewOptions } from '../../../utils/navigationUtils';
import { defineMessages, useIntl } from '../../../i18n';
const i18n = defineMessages({
resetButton: {
id: 'resetProviderSection.resetButton',
defaultMessage: 'Reset Provider and Model',
},
resetDescription: {
id: 'resetProviderSection.resetDescription',
defaultMessage: "This will clear your selected model and provider settings. If no defaults are available, you'll be taken to the welcome screen to set them up again.",
},
});
interface ResetProviderSectionProps {
setView: (view: View, viewOptions?: ViewOptions) => void;
}
export default function ResetProviderSection(_props: ResetProviderSectionProps) {
const intl = useIntl();
const { remove } = useConfig();
const handleResetProvider = async () => {
@@ -29,11 +42,10 @@ export default function ResetProviderSection(_props: ResetProviderSectionProps)
className="flex items-center justify-center gap-2"
>
<RefreshCw className="h-4 w-4" />
Reset Provider and Model
{intl.formatMessage(i18n.resetButton)}
</Button>
<p className="text-xs text-text-secondary mt-2">
This will clear your selected model and provider settings. If no defaults are available,
you'll be taken to the welcome screen to set them up again.
{intl.formatMessage(i18n.resetDescription)}
</p>
</div>
);