mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-18 06:17:13 +00:00
feat(i18n): Added support for Chinese language pack
This commit is contained in:
@@ -21,6 +21,7 @@ import {
|
||||
getDeviceCodeProviderDisplayName,
|
||||
getDeviceCodeProviderInstruction,
|
||||
} from '@/lib/provider-config';
|
||||
import i18n from '@/lib/i18n';
|
||||
|
||||
interface DeviceCodeDialogProps {
|
||||
open: boolean;
|
||||
@@ -72,10 +73,10 @@ export function DeviceCodeDialog({
|
||||
try {
|
||||
await navigator.clipboard.writeText(userCode);
|
||||
setHasCopied(true);
|
||||
toast.success('Code copied to clipboard');
|
||||
toast.success(i18n.t('commonToast.codeCopied'));
|
||||
setTimeout(() => setHasCopied(false), 2000);
|
||||
} catch {
|
||||
toast.error('Failed to copy code');
|
||||
toast.error(i18n.t('commonToast.copyCodeFailed'));
|
||||
}
|
||||
}, [userCode]);
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import { MaskedInput } from '@/components/ui/masked-input';
|
||||
import { ConfirmDialog } from './confirm-dialog';
|
||||
import { Save, X, Loader2, Code2 } from 'lucide-react';
|
||||
import { toast } from 'sonner';
|
||||
import i18n from '@/lib/i18n';
|
||||
|
||||
// Lazy load CodeEditor to reduce initial bundle size
|
||||
const CodeEditor = lazy(() => import('./code-editor').then((m) => ({ default: m.CodeEditor })));
|
||||
@@ -154,7 +155,7 @@ function SettingsDialogContent({
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ['settings', profileName] });
|
||||
queryClient.invalidateQueries({ queryKey: ['profiles'] });
|
||||
toast.success('Settings saved');
|
||||
toast.success(i18n.t('commonToast.settingsSaved'));
|
||||
onClose();
|
||||
},
|
||||
onError: (error: Error) => {
|
||||
|
||||
Reference in New Issue
Block a user