diff --git a/components/AIAssist.tsx b/components/AIAssist.tsx index 262ff87..a6dceb9 100644 --- a/components/AIAssist.tsx +++ b/components/AIAssist.tsx @@ -51,13 +51,13 @@ class CanvasErrorBoundary extends React.Component<{ children: React.ReactNode }, return (
-

Canvas Crashed

+

{t.canvasCrashed}

{this.state.error}

); @@ -67,13 +67,7 @@ class CanvasErrorBoundary extends React.Component<{ children: React.ReactNode }, } const BuildingArtifact = ({ type }: { type: string }) => { const [progress, setProgress] = useState(0); - const steps = [ - "Initializing neural links...", - "Scaffolding architecture...", - "Writing logic blocks...", - "Injecting dynamic modules...", - "Finalizing interactive layers..." - ]; + const steps = t.thinkingSteps; const [currentStep, setCurrentStep] = useState(0); useEffect(() => { @@ -93,7 +87,7 @@ const BuildingArtifact = ({ type }: { type: string }) => {

- Building {type} + {t.building} {type}

@@ -267,7 +261,7 @@ const LiveCanvas = memo(({ data, type, isStreaming }: { data: string, type: stri {renderError ? (
-

Runtime Execution Error

+

{t.runtimeError}

{renderError}

@@ -277,7 +271,7 @@ const LiveCanvas = memo(({ data, type, isStreaming }: { data: string, type: stri className="mt-6 text-[9px] font-black uppercase tracking-widest text-slate-400 hover:text-white" onClick={() => window.location.reload()} > - Try Refreshing Page + {t.tryRefreshing}
) : ( @@ -307,7 +301,7 @@ const ThinkingIndicator = () => (
- Neural Link Thinking... + {t.neuralLinkThinking}
); @@ -345,7 +339,7 @@ function parseStreamingContent(text: string, currentAgent: string) { }; if (preview.isStreaming) { const isUpdate = text.toLowerCase().includes("update") || text.toLowerCase().includes("fix") || text.toLowerCase().includes("change"); - status = isUpdate ? `Applying surgical edits to ${preview.type}...` : `Generating ${preview.type} artifact...`; + status = isUpdate ? t.applyingEdits(preview.type) : t.generatingArtifact(preview.type); } } @@ -412,7 +406,7 @@ function parseStreamingContent(text: string, currentAgent: string) { } if (!chatDisplay && preview && preview.isStreaming) { - chatDisplay = `Rendering live artifact...`; + chatDisplay = t.renderingLive; } return { chatDisplay, preview, agent, status }; @@ -436,9 +430,9 @@ export default function AIAssist() { } = useStore(); const t = translations[language].aiAssist; - const activeTab = aiAssistTabs?.find(t => t.id === activeTabId) || aiAssistTabs?.[0] || { + const activeTab = aiAssistTabs?.find(tab => tab.id === activeTabId) || aiAssistTabs?.[0] || { id: 'default', - title: 'New Chat', + title: t.newChat, history: [], currentAgent: 'general', previewData: null, @@ -704,7 +698,7 @@ export default function AIAssist() {

{t.title}

- Agent {currentAgent} + {t.agentLabel} {t.agents[currentAgent as keyof typeof t.agents] || currentAgent}

@@ -751,7 +745,13 @@ export default function AIAssist() { )} > - {tab.title} + + {tab.title === "New Chat" + ? t.chatTitle + : tab.title.startsWith("Chat ") + ? `${t.chatPrefix} ${tab.title.split(" ")[1]}` + : tab.title} + {aiAssistTabs.length > 1 && ( @@ -778,12 +778,12 @@ export default function AIAssist() {
{[ - { label: "General", agent: "general", icon: }, - { label: "Code", agent: "code", icon: }, - { label: "Design", agent: "design", icon: }, - { label: "SEO", agent: "seo", icon: }, - { label: "Web", agent: "web", icon: }, - { label: "App", agent: "app", icon: }, + { label: t.agents.general, agent: "general", icon: }, + { label: t.agents.code, agent: "code", icon: }, + { label: t.agents.design, agent: "design", icon: }, + { label: t.agents.seo, agent: "seo", icon: }, + { label: t.agents.web, agent: "web", icon: }, + { label: t.agents.app, agent: "app", icon: }, ].map(({ label, agent, icon }) => (
@@ -908,7 +904,7 @@ export default function AIAssist() { setShowCanvas(true); }} > - Activate Artifact + {t.activateArtifact} )} @@ -927,7 +923,7 @@ export default function AIAssist() {
- {msg.role === "assistant" ? `Agent ${msg.agent || 'core'}` : 'Explorer'} + {msg.role === "assistant" ? `${t.agentLabel} ${t.agents[msg.agent as keyof typeof t.agents] || msg.agent || t.coreAgent}` : t.userLabel}
@@ -975,11 +971,11 @@ export default function AIAssist() {
- Ask for a design, code, or research artifact. + {t.askArtifact} - Canvas {previewData ? "ready" : "idle"} + {t.canvasLabel} {previewData ? t.canvasReady : t.canvasIdle}
@@ -997,19 +993,19 @@ export default function AIAssist() { {viewMode === "preview" ? : }
-

{currentPreviewData?.type || "Live"} Canvas

+

{t.canvasTitle(currentPreviewData?.type || t.live)}

@@ -1059,7 +1055,7 @@ export default function AIAssist() {
- {currentPreviewData?.isStreaming ? "Neural Link Active" : "Sync Complete"} + {currentPreviewData?.isStreaming ? t.neuralLinkActive : t.syncComplete}
diff --git a/components/ActionPlanGenerator.tsx b/components/ActionPlanGenerator.tsx index 8cf7558..53dee97 100644 --- a/components/ActionPlanGenerator.tsx +++ b/components/ActionPlanGenerator.tsx @@ -71,7 +71,7 @@ export default function ActionPlanGenerator() { const handleGenerate = async () => { if (!currentPrompt.trim()) { - setError("Please enter PRD or project requirements"); + setError(t.enterPrdError); return; } @@ -79,7 +79,7 @@ export default function ActionPlanGenerator() { const isQwenOAuth = selectedProvider === "qwen" && modelAdapter.hasQwenAuth(); if (!isQwenOAuth && (!apiKey || !apiKey.trim())) { - setError(`Please configure your ${selectedProvider.toUpperCase()} API key in Settings`); + setError(`${common.error}: ${common.configApiKey}`); return; } @@ -112,11 +112,11 @@ export default function ActionPlanGenerator() { setActionPlan(newPlan); } else { console.error("[ActionPlanGenerator] Generation failed:", result.error); - setError(result.error || "Failed to generate action plan"); + setError(result.error || t.errorGenerate); } } catch (err) { console.error("[ActionPlanGenerator] Generation error:", err); - setError(err instanceof Error ? err.message : "An error occurred"); + setError(err instanceof Error ? err.message : t.errorGenerate); } finally { setProcessing(false); } @@ -176,7 +176,7 @@ export default function ActionPlanGenerator() {
- +