Skip to content

Unrestricted Open-source alternative to AI video platforms — Free AI image & video generation studio with 600+ models (Flux, Midjourney, Kling, Sora, Veo). No content filters. Self-hosted, MIT licensed.

Add Chinese (zh) localization support, extensible to future locales

Anil-matcha4a1d93411806
diff --git a/app/layout.js b/app/layout.js
index 0d9c1a2c..6423b6ca 100644
--- a/app/layout.js
+++ b/app/layout.js
@@ -1,5 +1,7 @@
import './globals.css';
import { Inter } from "next/font/google";
+import { headers } from 'next/headers';
+import { getLocaleConfig } from '@/lib/locales';
const inter = Inter({
variable: "--font-inter",
@@ -11,9 +13,15 @@ export const metadata = {
description: 'Generate AI images and videos using 200+ models — Flux, Midjourney, Kling, Veo, Seedance and more.',
};
-export default function RootLayout({ children }) {
+export default async function RootLayout({ children }) {
+ // Locale is derived from the URL path by middleware.js and passed
+ // through as a plain response header — the root layout is shared by
+ // every locale's route tree, so it can't take a `locale` prop directly.
+ const headerList = await headers();
+ const { htmlLang } = getLocaleConfig(headerList.get('x-locale'));
+
return (
- <html lang="en">
+ <html lang={htmlLang}>
<body className={inter.variable}>{children}</body>
</html>
);
diff --git a/app/zh/assistant/page.js b/app/zh/assistant/page.js
new file mode 100644
index 00000000..1e543e33
--- /dev/null
+++ b/app/zh/assistant/page.js
@@ -0,0 +1,5 @@
+import { redirect } from 'next/navigation';
+
+export default function ZhAssistant() {
+ redirect('/zh/studio');
+}
diff --git a/app/zh/page.js b/app/zh/page.js
new file mode 100644
index 00000000..89000570
--- /dev/null
+++ b/app/zh/page.js
@@ -0,0 +1,5 @@
+import { redirect } from 'next/navigation';
+
+export default function ZhHome() {
+ redirect('/zh/studio');
+}
diff --git a/app/zh/studio/[[...slug]]/page.js b/app/zh/studio/[[...slug]]/page.js
new file mode 100644
index 00000000..00920889
--- /dev/null
+++ b/app/zh/studio/[[...slug]]/page.js
@@ -0,0 +1,12 @@
+import StandaloneShell from '@/components/StandaloneShell';
+
+export const metadata = {
+ title: 'Studio — Open Generative AI',
+};
+
+// Additive locale route wrapper: reuses the exact same shell component as
+// app/studio/[[...slug]]/page.js, only passing `locale="zh"`. A future
+// locale repeats this file under app/<locale>/studio/[[...slug]]/page.js.
+export default function ZhStudioPage() {
+ return <StandaloneShell locale="zh" />;
+}
diff --git a/components/ApiKeyModal.js b/components/ApiKeyModal.js
index f415c31e..cd39803a 100644
--- a/components/ApiKeyModal.js
+++ b/components/ApiKeyModal.js
@@ -1,15 +1,17 @@
'use client';
import { useState } from 'react';
+import { getCommonCopy } from '@/lib/locales';
-export default function ApiKeyModal({ onSave, onClose, overlay = false, title, subtitle }) {
+export default function ApiKeyModal({ onSave, onClose, overlay = false, title, subtitle, locale = 'en' }) {
const [key, setKey] = useState('');
const [error, setError] = useState('');
+ const copy = getCommonCopy(locale).apiKeyModal;
const handleSubmit = (e) => {
e.preventDefault();
const trimmed = key.trim();
- if (!trimmed) { setError('Please enter your API key'); return; }
+ if (!trimmed) { setError(copy.missingKeyError); return; }
onSave(trimmed);
};
@@ -24,7 +26,7 @@ export default function ApiKeyModal({ onSave, onClose, overlay = false, title, s
<button
type="button"
onClick={onClose}
- aria-label="Close"
+ aria-label={copy.close}
className="absolute top-3 right-3 w-8 h-8 rounded-md text-white/40 hover:text-white hover:bg-white/10 transition-colors flex items-center justify-center"
>
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
@@ -39,11 +41,11 @@ export default function ApiKeyModal({ onSave, onClose, overlay = false, title, s
</svg>
</div>
<h1 className="text-xl font-bold text-white tracking-tight mb-2">
- {title || 'Open Generative AI'}
+ {title || copy.title}
</h1>
<p className="text-white/40 text-[13px] leading-relaxed px-4">
{subtitle || (
- <>Enter your <a href="https://muapi.ai/access-keys" target="_blank" rel="noreferrer" className="text-[#22d3ee] hover:text-[#e5ff33] transition-colors">Muapi.ai</a> API key to start creating</>
+ <>{copy.subtitlePrefix} <a href="https://muapi.ai/access-keys" target="_blank" rel="noreferrer" className="text-[#22d3ee] hover:text-[#e5ff33] transition-colors">Muapi.ai</a> {copy.subtitleSuffix}</>
)}
</p>
</div>
@@ -51,13 +53,13 @@ export default function ApiKeyModal({ onSave, onClose, overlay = false, title, s
<form onSubmit={handleSubmit} className="space-y-6">
<div className="space-y-2">
<label className="block text-xs font-bold text-white/30 ml-1">
- API Access Key
+ {copy.label}
</label>
<input
type="password"
value={key}
onChange={(e) => { setKey(e.target.value); setError(''); }}
- placeholder="Paste your key here..."
+ placeholder={copy.placeholder}
className="w-full bg-white/5 border border-white/[0.03] rounded-md px-5 py-3 text-sm text-white placeholder:text-white/10 focus:outline-none focus:ring-1 focus:ring-[#22d3ee]/30 focus:bg-white/[0.07] transition-all"
suppressHydrationWarning
/>
@@ -69,13 +71,13 @@ export default function ApiKeyModal({ onSave, onClose, overlay = false, title, s
className="w-full bg-[#22d3ee] text-black font-medium py-2.5 rounded-md hover:bg-[#e5ff33] hover:scale-[1.02] active:scale-[0.98] transition-all shadow-lg shadow-[#22d3ee]/5"
suppressHydrationWarning
>
- Get Started
+ {copy.submit}
</button>
<p className="text-center text-[12px] text-white/20 pt-2">
- Need a key?{' '}
+ {copy.needKey}{' '}
<a href="https://muapi.ai/access-keys" target="_blank" rel="noreferrer" className="text-white/40 hover:text-[#22d3ee] transition-colors font-medium">
- Get one free →
+ {copy.getOneFree}
</a>
</p>
</form>
diff --git a/components/StandaloneShell.js b/components/StandaloneShell.js
index 701ea5ff..493922a8 100644
--- a/components/StandaloneShell.js
+++ b/components/StandaloneShell.js
@@ -11,7 +11,13 @@ const DesignAgentStudio = dynamic(() => import('studio').then(mod => mod.DesignA
});
import axios from 'axios';
import ApiKeyModal from './ApiKeyModal';
+import { getCommonCopy, getLocaleConfig, localizeStudioPath } from '@/lib/locales';
+// Tab/category ids, icons, and English `label` fallbacks are stable
+// identifiers, not locale copy — the actual rendered label is resolved
+// per-locale from `copy.tabs`/`copy.categories` via tabLabel()/categoryLabel()
+// inside the component below, with these English strings as the fallback
+// when a locale bundle is missing the key.
const TABS = [
{
id: 'image',
@@ -279,13 +285,24 @@ const persistNotifications = (notifications) => {
}
};
-export default function StandaloneShell() {
+export default function StandaloneShell({ locale = 'en' }) {
const params = useParams();
const router = useRouter();
- const slug = params?.slug || [];
+ const slug = params?.slug || [];
const idFromParams = params?.id;
const tabFromParams = params?.tab;
+ const copy = getCommonCopy(locale);
+ const tabLabel = useCallback(
+ (tabId) => copy.tabs?.[tabId] || TABS.find((t) => t.id === tabId)?.label || tabId,
+ [copy],
+ );
+ const categoryLabel = useCallback(
+ (categoryId) => copy.categories?.[categoryId] || NAVIGATION_CATEGORIES.find((c) => c.id === categoryId)?.label || categoryId,
+ [copy],
+ );
+ const studioPath = useCallback((tabId) => localizeStudioPath(locale, tabId), [locale]);
+
// Helper to extract workflow details precisely from either route structure
const getWorkflowInfo = useCallback(() => {
if (idFromParams) {
@@ -473,7 +490,7 @@ export default function StandaloneShell() {
.filter((tab) => generationCounts[tab.id] > 0)
.map((tab) => ({
tabId: tab.id,
- label: tab.label,
+ label: tabLabel(tab.id),
count: generationCounts[tab.id],
}));
@@ -481,7 +498,12 @@ export default function StandaloneShell() {
useEffect(() => {
const handlePopState = () => {
const path = window.location.pathname;
- const segments = path.split('/').filter(Boolean);
+ // Strip the locale root prefix (if any) before reading the
+ // /studio/<tab> segment, so this works for both /studio/<tab> and
+ // /<locale>/studio/<tab>.
+ const { rootPath } = getLocaleConfig(locale);
+ const localeAwarePath = rootPath && path.startsWith(rootPath) ? path.slice(rootPath.length) : path;
+ const segments = localeAwarePath.split('/').filter(Boolean);
const tabId = segments[1] || 'image';
if (TABS.find(t => t.id === tabId)) {
setActiveTab(tabId);
@@ -489,12 +511,12 @@ export default function StandaloneShell() {
};
window.addEventListener('popstate', handlePopState);
return () => window.removeEventListener('popstate', handlePopState);
- }, []);
+ }, [locale]);
const handleTabChange = useCallback((tabId) => {
- window.history.pushState(null, '', `/studio/${tabId}`);
+ window.history.pushState(null, '', studioPath(tabId));
setActiveTab(tabId);
- }, []);
+ }, [studioPath]);
const handleOpenNotification = useCallback((notification) => {
handleTabChange(notification.tabId);
@@ -642,7 +664,7 @@ export default function StandaloneShell() {
);
if (!apiKey) {
- return <ApiKeyModal onSave={handleKeySave} />;
+ return <ApiKeyModal onSave={handleKeySave} locale={locale} />;
}
return (
@@ -663,8 +685,8 @@ export default function StandaloneShell() {
</svg>
</div>
<div className="flex flex-col items-center">
- <span className="text-xl font-bold text-white">Drop your media here</span>
- <span className="text-sm text-white/40">Images, videos, or audio files</span>
+ <span className="text-xl font-bold text-white">{copy.shell.dropHere}</span>
+ <span className="text-sm text-white/40">{copy.shell.dropHereHint}</span>
</div>
</div>
</div>
@@ -679,7 +701,7 @@ export default function StandaloneShell() {
rel="noopener noreferrer"
className="text-[13px] font-bold text-white hover:opacity-80 transition-opacity text-center"
>
- Unrestricted AI Images &amp; Videos → Auto-Publish as YouTube Shorts &amp; TikToks, Earn ↗
+ {copy.shell.vadooPromo}
</a>
<button
onClick={() => {
@@ -687,7 +709,7 @@ export default function StandaloneShell() {
localStorage.setItem('vadoo_banner_dismissed', '1');
}}
className="absolute right-3 text-white/60 hover:text-white transition-colors text-lg leading-none"
- aria-label="Dismiss"
+ aria-label={copy.shell.dismiss}
>
✕
</button>
@@ -703,7 +725,7 @@ export default function StandaloneShell() {
<button
onClick={() => setIsMobileOpen(!isMobileOpen)}
className="md:hidden p-2 rounded-lg bg-white/5 hover:bg-white/10 text-white/70 hover:text-white transition-colors"
- aria-label="Toggle Navigation Menu"
+ aria-label={copy.shell.toggleNavMenu}
>
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<line x1="3" y1="12" x2="21" y2="12" />
@@ -717,7 +739,7 @@ export default function StandaloneShell() {
<button
onClick={toggleSidebar}
className="flex items-center justify-center w-8 h-8 rounded-lg bg-white/5 hover:bg-white/10 text-white/60 hover:text-white transition-colors border border-white/5"
- aria-label={isSidebarCollapsed ? "Expand sidebar" : "Collapse sidebar"}
+ aria-label={isSidebarCollapsed ? copy.shell.expandSidebar : copy.shell.collapseSidebar}
>
<svg
width="18"
@@ -735,7 +757,7 @@ export default function StandaloneShell() {
</button>
{/* Custom Tooltip */}
<div className="absolute left-0 top-full mt-2 px-2.5 py-1 bg-[#121215]/95 backdrop-blur-md text-white text-[11px] font-medium rounded-md shadow-2xl border border-white/15 opacity-0 group-hover:opacity-100 pointer-events-none transition-all duration-200 z-50 whitespace-nowrap">
- {isSidebarCollapsed ? "Expand sidebar" : "Collapse sidebar"}
+ {isSidebarCollapsed ? copy.shell.expandSidebar : copy.shell.collapseSidebar}
</div>
</div>
@@ -747,7 +769,7 @@ export default function StandaloneShell() {
</svg>
</div>
<span className="text-sm font-bold tracking-tight hidden sm:block text-white">
- OpenGenerativeAI
+ {copy.shell.brand}
</span>
</div>
</div>
@@ -756,7 +778,7 @@ export default function StandaloneShell() {
<div className="hidden lg:flex items-center gap-2 px-3 py-1 rounded-full bg-white/[0.03] border border-white/[0.05] text-xs text-white/60">
<span className="w-1.5 h-1.5 rounded-full bg-[#22d3ee]" />
<span className="font-medium text-white/80">
- {TABS.find(t => t.id === activeTab)?.label || 'Studio'}
+ {tabLabel(activeTab) || copy.shell.studioFallback}
</span>
</div>
@@ -772,13 +794,13 @@ export default function StandaloneShell() {
<button
onClick={() => setShowSettings(true)}
className="flex items-center gap-2 px-3 py-1.5 rounded-md border border-white/10 bg-white/5 text-[13px] font-bold text-white/80 hover:text-white hover:bg-white/10 hover:border-white/20 transition-colors"
- aria-label="Settings"
+ aria-label={copy.shell.settings}
>
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<circle cx="12" cy="12" r="3" />
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" />
</svg>
- <span className="hidden sm:inline">Settings</span>
+ <span className="hidden sm:inline">{copy.shell.settings}</span>
</button>
</div>
</header>
@@ -803,23 +825,24 @@ export default function StandaloneShell() {
${isSidebarCollapsed ? 'md:w-16' : 'md:w-52'}
`}
>
- <nav aria-label="Studio navigation" className="flex-1 overflow-y-auto overflow-x-hidden scrollbar-none py-2 px-2">
+ <nav aria-label={copy.shell.studioNavigation} className="flex-1 overflow-y-auto overflow-x-hidden scrollbar-none py-2 px-2">
<div className="space-y-1">
{NAVIGATION_CATEGORIES.map((category) => {
const isCategoryActive = activeCategory?.id === category.id;
const isCollapsed = isSidebarCollapsed && !isMobileOpen;
const isCategoryOpen = !isCollapsed && expandedCategoryId === category.id;
const categoryPanelId = `navigation-category-${category.id}`;
+ const categoryLabelText = categoryLabel(category.id);
return (
<div key={category.id} className="relative">
<button
type="button"
onClick={() => handleCategoryToggle(category.id)}
- aria-label={category.label}
+ aria-label={categoryLabelText}
aria-expanded={isCategoryOpen}
aria-controls={isCollapsed ? undefined : categoryPanelId}
- title={isCollapsed ? category.label : undefined}
+ title={isCollapsed ? categoryLabelText : undefined}
className={`
group relative flex items-center rounded-xl transition-all duration-150 font-semibold
${isCollapsed ? 'h-11 w-11 justify-center mx-auto' : 'px-3 py-2.5 w-full gap-3 text-left'}
@@ -842,7 +865,7 @@ export default function StandaloneShell() {
{!isCollapsed && (
<>
<span className="flex-1 min-w-0 text-[12px] leading-4 tracking-tight">
- {category.label}
+ {categoryLabelText}
</span>
<svg
width="15"
@@ -866,7 +889,7 @@ export default function StandaloneShell() {
<div
id={categoryPanelId}
role="group"
- aria-label={`${category.label} tools`}
+ aria-label={`${categoryLabelText} ${copy.shell.toolsSuffix}`}
className="mt-1 ml-2 pl-2 border-l border-white/[0.08] space-y-1 max-h-64 overflow-y-auto scrollbar-none"
>
{category.tabIds.map((tabId) => {
@@ -877,7 +900,7 @@ export default function StandaloneShell() {
return (
<a
key={tab.id}
- href={`/studio/${tab.id}`}
+ href={studioPath(tab.id)}
onClick={(event) => handleNavigationItemClick(event, tab.id)}
aria-current={isActive ? 'page' : undefined}
className={`
@@ -894,7 +917,7 @@ export default function StandaloneShell() {
<span className={`flex-shrink-0 ${isActive ? 'text-[#22d3ee]' : 'text-white/45 group-hover:text-white/80'}`}>
{tab.icon}
</span>
- <span className="truncate">{tab.label}</span>
+ <span className="truncate">{tabLabel(tab.id)}</span>
</a>
);
})}
@@ -908,11 +931,11 @@ export default function StandaloneShell() {
{EXPLORE_APPS_TAB && (
<div className="mt-3 pt-3 border-t border-white/[0.07]">
<a
- href={`/studio/${EXPLORE_APPS_TAB.id}`}
+ href={studioPath(EXPLORE_APPS_TAB.id)}
onClick={(event) => handleNavigationItemClick(event, EXPLORE_APPS_TAB.id)}
aria-current={activeTab === EXPLORE_APPS_TAB.id ? 'page' : undefined}
- aria-label={EXPLORE_APPS_TAB.label}
- title={isSidebarCollapsed && !isMobileOpen ? EXPLORE_APPS_TAB.label : undefined}
+ aria-label={tabLabel(EXPLORE_APPS_TAB.id)}
+ title={isSidebarCollapsed && !isMobileOpen ? tabLabel(EXPLORE_APPS_TAB.id) : undefined}
className={`
group relative flex items-center rounded-xl transition-all duration-150 text-[13px] font-semibold
${isSidebarCollapsed && !isMobileOpen ? 'h-11 w-11 justify-center mx-auto' : 'px-3 py-2.5 w-full gap-3'}
@@ -929,7 +952,7 @@ export default function StandaloneShell() {
{EXPLORE_APPS_TAB.icon}
</span>
{(!isSidebarCollapsed || isMobileOpen) && (
- <span className="truncate">{EXPLORE_APPS_TAB.label}</span>
+ <span className="truncate">{tabLabel(EXPLORE_APPS_TAB.id)}</span>
)}
</a>
</div>
@@ -941,34 +964,34 @@ export default function StandaloneShell() {
{/* Studio Content */}
<div className="flex-1 min-h-0 h-full relative overflow-hidden bg-[#030303]">
<div className={activeTab === 'image' ? "h-full w-full" : "hidden"}>
- <ImageStudio apiKey={apiKey} droppedFiles={droppedFiles} onFilesHandled={handleFilesHandled} onGenerationStart={makeGenerationStartCallback('image')} onGenerationEnd={makeGenerationEndCallback('image')} onGenerationComplete={makeSuccessCallback('image')} onGenerationError={makeErrorCallback('image')} />
+ <ImageStudio apiKey={apiKey} locale={locale} droppedFiles={droppedFiles} onFilesHandled={handleFilesHandled} onGenerationStart={makeGenerationStartCallback('image')} onGenerationEnd={makeGenerationEndCallback('image')} onGenerationComplete={makeSuccessCallback('image')} onGenerationError={makeErrorCallback('image')} />
</div>
<div className={activeTab === 'layers' ? "h-full w-full" : "hidden"}>
- <LayersStudio apiKey={apiKey} droppedFiles={droppedFiles} onFilesHandled={handleFilesHandled} onGenerationStart={makeGenerationStartCallback('layers')} onGenerationEnd={makeGenerationEndCallback('layers')} onGenerationComplete={makeSuccessCallback('layers')} onGenerationError={makeErrorCallback('layers')} />
+ <LayersStudio apiKey={apiKey} locale={locale} droppedFiles={droppedFiles} onFilesHandled={handleFilesHandled} onGenerationStart={makeGenerationStartCallback('layers')} onGenerationEnd={makeGenerationEndCallback('layers')} onGenerationComplete={makeSuccessCallback('layers')} onGenerationError={makeErrorCallback('layers')} />
</div>
<div className={activeTab === 'video' ? "h-full w-full" : "hidden"}>
- <VideoStudio apiKey={apiKey} droppedFiles={droppedFiles} onFilesHandled={handleFilesHandled} onGenerationStart={makeGenerationStartCallback('video')} onGenerationEnd={makeGenerationEndCallback('video')} onGenerationComplete={makeSuccessCallback('video')} onGenerationError={makeErrorCallback('video')} />
+ <VideoStudio apiKey={apiKey} locale={locale} droppedFiles={droppedFiles} onFilesHandled={handleFilesHandled} onGenerationStart={makeGenerationStartCallback('video')} onGenerationEnd={makeGenerationEndCallback('video')} onGenerationComplete={makeSuccessCallback('video')} onGenerationError={makeErrorCallback('video')} />
</div>
<div className={activeTab === 'clipping' ? "h-full w-full" : "hidden"}>
- <ClippingStudio apiKey={apiKey} droppedFiles={droppedFiles} onFilesHandled={handleFilesHandled} onGenerationStart={makeGenerationStartCallback('clipping')} onGenerationEnd={makeGenerationEndCallback('clipping')} onGenerationComplete={makeSuccessCallback('clipping')} onGenerationError={makeErrorCallback('clipping')} />
+ <ClippingStudio apiKey={apiKey} locale={locale} droppedFiles={droppedFiles} onFilesHandled={handleFilesHandled} onGenerationStart={makeGenerationStartCallback('clipping')} onGenerationEnd={makeGenerationEndCallback('clipping')} onGenerationComplete={makeSuccessCallback('clipping')} onGenerationError={makeErrorCallback('clipping')} />
</div>
<div className={activeTab === 'vibe-motion' ? "h-full w-full" : "hidden"}>
- <VibeMotionStudio apiKey={apiKey} onGenerationStart={makeGenerationStartCallback('vibe-motion')} onGenerationEnd={makeGenerationEndCallback('vibe-motion')} onGenerationComplete={makeSuccessCallback('vibe-motion')} onGenerationError={makeErrorCallback('vibe-motion')} />
+ <VibeMotionStudio apiKey={apiKey} locale={locale} onGenerationStart={makeGenerationStartCallback('vibe-motion')} onGenerationEnd={makeGenerationEndCallback('vibe-motion')} onGenerationComplete={makeSuccessCallback('vibe-motion')} onGenerationError={makeErrorCallback('vibe-motion')} />
</div>
<div className={activeTab === 'lipsync' ? "h-full w-full" : "hidden"}>
- <LipSyncStudio apiKey={apiKey} droppedFiles={droppedFiles} onFilesHandled={handleFilesHandled} onGenerationStart={makeGenerationStartCallback('lipsync')} onGenerationEnd={makeGenerationEndCallback('lipsync')} onGenerationComplete={makeSuccessCallback('lipsync')} onGenerationError={makeErrorCallback('lipsync')} />
+ <LipSyncStudio apiKey={apiKey} locale={locale} droppedFiles={droppedFiles} onFilesHandled={handleFilesHandled} onGenerationStart={makeGenerationStartCallback('lipsync')} onGenerationEnd={makeGenerationEndCallback('lipsync')} onGenerationComplete={makeSuccessCallback('lipsync')} onGenerationError={makeErrorCallback('lipsync')} />
</div>
<div className={activeTab === 'body-swap' ? "h-full w-full" : "hidden"}>
- <RecastStudio apiKey={apiKey} droppedFiles={droppedFiles} onFilesHandled={handleFilesHandled} onGenerationStart={makeGenerationStartCallback('body-swap')} onGenerationEnd={makeGenerationEndCallback('body-swap')} onGenerationComplete={makeSuccessCallback('body-swap')} onGenerationError={makeErrorCallback('body-swap')} />
+ <RecastStudio apiKey={apiKey} locale={locale} droppedFiles={droppedFiles} onFilesHandled={handleFilesHandled} onGenerationStart={makeGenerationStartCallback('body-swap')} onGenerationEnd={makeGenerationEndCallback('body-swap')} onGenerationComplete={makeSuccessCallback('body-swap')} onGenerationError={makeErrorCallback('body-swap')} />
</div>
<div className={activeTab === 'cinema' ? "h-full w-full" : "hidden"}>
- <CinemaStudio apiKey={apiKey} onGenerationStart={makeGenerationStartCallback('cinema')} onGenerationEnd={makeGenerationEndCallback('cinema')} onGenerationComplete={makeSuccessCallback('cinema')} onGenerationError={makeErrorCallback('cinema')} />
+ <CinemaStudio apiKey={apiKey} locale={locale} onGenerationStart={makeGenerationStartCallback('cinema')} onGenerationEnd={makeGenerationEndCallback('cinema')} onGenerationComplete={makeSuccessCallback('cinema')} onGenerationError={makeErrorCallback('cinema')} />
</div>
<div className={activeTab === 'audio' ? "h-full w-full" : "hidden"}>
- <AudioStudio apiKey={apiKey} droppedFiles={droppedFiles} onFilesHandled={handleFilesHandled} onGenerationStart={makeGenerationStartCallback('audio')} onGenerationEnd={makeGenerationEndCallback('audio')} onGenerationComplete={makeSuccessCallback('audio')} onGenerationError={makeErrorCallback('audio')} />
+ <AudioStudio apiKey={apiKey} locale={locale} droppedFiles={droppedFiles} onFilesHandled={handleFilesHandled} onGenerationStart={makeGenerationStartCallback('audio')} onGenerationEnd={makeGenerationEndCallback('audio')} onGenerationComplete={makeSuccessCallback('audio')} onGenerationError={makeErrorCallback('audio')} />
</div>
<div className={activeTab === 'marketing' ? "h-full w-full" : "hidden"}>
- <MarketingStudio apiKey={apiKey} droppedFiles={droppedFiles} onFilesHandled={handleFilesHandled} onGenerationStart={makeGenerationStartCallback('marketing')} onGenerationEnd={makeGenerationEndCallback('marketing')} onGenerationComplete={makeSuccessCallback('marketing')} onGenerationError={makeErrorCallback('marketing')} />
+ <MarketingStudio apiKey={apiKey} locale={locale} droppedFiles={droppedFiles} onFilesHandled={handleFilesHandled} onGenerationStart={makeGenerationStartCallback('marketing')} onGenerationEnd={makeGenerationEndCallback('marketing')} onGenerationComplete={makeSuccessCallback('marketing')} onGenerationError={makeErrorCallback('marketing')} />
</div>
<div className={activeTab === 'workflows' ? "h-full w-full" : "hidden"}>
<WorkflowStudio
@@ -982,7 +1005,7 @@ export default function StandaloneShell() {
/>
</div>
<div className={activeTab === 'agents' ? "h-full w-full" : "hidden"}>
- <AgentStudio apiKey={apiKey} isHeaderVisible={isHeaderVisible} onToggleHeader={setIsHeaderVisible} />
+ <AgentStudio apiKey={apiKey} locale={locale} isHeaderVisible={isHeaderVisible} onToggleHeader={setIsHeaderVisible} />
</div>
<div className={activeTab === 'design-agent' ? "h-full w-full" : "hidden"}>
{activeTab === 'design-agent' && (
@@ -998,11 +1021,12 @@ export default function StandaloneShell() {
)}
</div>
<div className={activeTab === 'apps' ? "h-full w-full" : "hidden"}>
- <AppsStudio apiKey={apiKey} />
+ <AppsStudio apiKey={apiKey} locale={locale} />
</div>
<div className={activeTab === 'ai-influencer' ? "h-full w-full" : "hidden"}>
<AiInfluencerStudio
apiKey={apiKey}
+ locale={locale}
onGenerationStart={makeGenerationStartCallback('ai-influencer')}
onGenerationEnd={makeGenerationEndCallback('ai-influencer')}
onGenerationComplete={makeSuccessCallback('ai-influencer')}
@@ -1016,7 +1040,7 @@ export default function StandaloneShell() {
{(activeGenerations.length > 0 || notifications.length > 0) && (
<div
aria-live="polite"
- aria-label="Generation activity and notifications"
+ aria-label={copy.notifications.ariaLabel}
className="fixed top-16 right-5 z-[200] flex max-h-[calc(100vh-80px)] w-[340px] max-w-[calc(100vw-32px)] flex-col gap-2 overflow-x-hidden overflow-y-auto global-notif-stack pointer-events-none"
data-testid="global-notification-stack"
>
@@ -1035,7 +1059,7 @@ export default function StandaloneShell() {
/>
</span>
<p className="min-w-0 flex-1 font-semibold leading-5 text-zinc-900">
- {generation.label} is generating
+ {generation.label} {copy.notifications.generating}
{generation.count > 1 ? ` (${generation.count})` : ''}
</p>
</div>
@@ -1077,7 +1101,8 @@ export default function StandaloneShell() {
<p className="font-semibold leading-5 text-zinc-900">
{notif.label}
<span className="font-normal text-zinc-500">
- {notif.type === 'success' ? ' - Generation complete' : ' - Generation failed'}
+ {' '}
+ {notif.type === 'success' ? copy.notifications.generationComplete : copy.notifications.generationFailed}
</span>
</p>
{notif.type === 'error' && notif.message && (
@@ -1087,7 +1112,7 @@ export default function StandaloneShell() {
)}
{notif.type === 'success' && (
<p className="mt-0.5 text-[12px] leading-4 text-zinc-500">
- Your result is ready.
+ {copy.notifications.resultReady}
</p>
)}
{notif.type === 'success' && (
@@ -1095,9 +1120,9 @@ export default function StandaloneShell() {
type="button"
onClick={() => handleOpenNotification(notif)}
className="mt-1.5 text-[11px] font-bold text-cyan-600 transition-colors hover:text-cyan-700"
- aria-label={`Open ${notif.label} result`}
+ aria-label={copy.notifications.openResult.replace('{label}', notif.label)}
>
- Open →
+ {copy.notifications.open}
</button>
)}
</div>
@@ -1106,7 +1131,7 @@ export default function StandaloneShell() {
type="button"
onClick={() => dismissNotification(notif.id)}
className="mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-zinc-400 transition-colors hover:bg-zinc-100 hover:text-zinc-700 focus:outline-none focus:ring-1 focus:ring-zinc-300"
- aria-label="Dismiss notification"
+ aria-label={copy.notifications.dismissNotification}
>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" aria-hidden="true">
<path d="M18 6 6 18M6 6l12 12" />
@@ -1136,15 +1161,15 @@ export default function StandaloneShell() {
{showSettings && (
<div className="fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 animate-fade-in-up">
<div className="bg-[#0a0a0a] border border-white/10 rounded-xl p-8 w-full max-w-sm shadow-2xl">
- <h2 className="text-white font-bold text-lg mb-2">Settings</h2>
+ <h2 className="text-white font-bold text-lg mb-2">{copy.settingsModal.title}</h2>
<p className="text-white/40 text-[13px] mb-8">
- Manage your AI studio preferences and authentication.
+ {copy.settingsModal.subtitle}
</p>
-
+
<div className="space-y-4 mb-8">
<div className="bg-white/5 border border-white/[0.03] rounded-md p-4">
<label className="block text-xs font-bold text-white/30 mb-2">
- Active API Key
+ {copy.settingsModal.activeApiKey}
</label>
<div className="text-[13px] font-mono text-white/80">
{apiKey.slice(0, 8)}••••••••••••••••
@@ -1157,13 +1182,13 @@ export default function StandaloneShell() {
onClick={handleKeyChange}
className="flex-1 h-10 rounded-md bg-red-500/10 text-red-400 hover:bg-red-500/20 text-xs font-semibold transition-all"
>
- Change Key
+ {copy.settingsModal.changeKey}
</button>
<button
onClick={() => setShowSettings(false)}
className="flex-1 h-10 rounded-md bg-white/5 text-white/80 hover:bg-white/10 text-xs font-semibold transition-all border border-white/5"
>
- Close
+ {copy.settingsModal.close}
</button>
</div>
</div>
diff --git a/lib/locales.js b/lib/locales.js
new file mode 100644
index 00000000..7d6b0767
--- /dev/null
+++ b/lib/locales.js
@@ -0,0 +1,119 @@
+// Locale registry for the standalone Open Generative AI studio app.
+//
+// This mirrors the additive-route architecture documented in the main
+// muapi client (../../../docs/localization.md): English stays the
+// default, unprefixed route tree; every other locale gets a parallel
+// `/[[locale]]/...` route tree that reuses the same components with
+// translated copy passed as a prop. There is no i18n routing library
+// (no next-intl) — just a registry + plain JSON message bundles + a
+// recursive merge so a partial translation still renders (falls back to
+// English for any missing key).
+//
+// Adding a new locale: register it here with its message imports, then
+// add a matching `app/<locale>/...` route wrapper tree that passes
+// `locale="<locale>"` into the shared components. Do not add
+// `locale === 'zh'`-style branches in shared components — read copy from
+// this registry instead.
+
+import enCommon from '../messages/en/common.json';
+import zhCommon from '../messages/zh/common.json';
+
+export const DEFAULT_LOCALE = 'en';
+
+export const LOCALE_CONFIGS = {
+ en: {
+ code: 'en',
+ nativeName: 'English',
+ htmlLang: 'en',
+ rootPath: '',
+ messages: {
+ common: enCommon,
+ },
+ },
+ zh: {
+ code: 'zh',
+ nativeName: '中文',
+ htmlLang: 'zh-CN',
+ rootPath: '/zh',
+ messages: {
+ common: zhCommon,
+ },
+ },
+};
+
+export const SUPPORTED_LOCALES = Object.keys(LOCALE_CONFIGS);
+
+export function isSupportedLocale(locale) {
+ return Boolean(locale) && Object.prototype.hasOwnProperty.call(LOCALE_CONFIGS, locale);
+}
+
+// Registered locale prefixes, longest first, so `/zh-CN` (if ever added)
+// would not falsely match under a shorter `/zh` prefix check.
+const LOCALE_PREFIXES = Object.values(LOCALE_CONFIGS)
+ .filter((config) => config.rootPath)
+ .map((config) => config.rootPath)
+ .sort((a, b) => b.length - a.length);
+
+// Mirrors client/lib's getLocaleFromPathname pattern: derive the active
+// locale purely from the URL path, no cookies/headers/negotiation.
+export function getLocaleFromPathname(pathname) {
+ if (!pathname) return DEFAULT_LOCALE;
+ for (const prefix of LOCALE_PREFIXES) {
+ if (pathname === prefix || pathname.startsWith(`${prefix}/`)) {
+ const locale = Object.values(LOCALE_CONFIGS).find((c) => c.rootPath === prefix);
+ return locale?.code || DEFAULT_LOCALE;
+ }
+ }
+ return DEFAULT_LOCALE;
+}
+
+export function getLocaleConfig(locale) {
+ return LOCALE_CONFIGS[locale] || LOCALE_CONFIGS[DEFAULT_LOCALE];
+}
+
+function isPlainObject(value) {
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
+}
+
+// Generic recursive merge: translated arrays replace the English array
+// wholesale (locale-owned unit), plain objects merge key-by-key so a
+// partial bundle still falls back to English per-key rather than
+// per-namespace.
+export function mergeCopy(base, override) {
+ if (!override) return base;
+ if (!base) return override;
+ if (!isPlainObject(base) || !isPlainObject(override)) return override;
+
+ const merged = { ...base };
+ for (const key of Object.keys(override)) {
+ merged[key] = isPlainObject(base[key]) && isPlainObject(override[key])
+ ? mergeCopy(base[key], override[key])
+ : override[key];
+ }
+ return merged;
+}
+
+// Returns the `common` namespace for a locale, merged over the English
+// defaults so every key is always present.
+export function getCommonCopy(locale) {
+ const config = getLocaleConfig(locale);
+ if (config.code === DEFAULT_LOCALE) return LOCALE_CONFIGS[DEFAULT_LOCALE].messages.common;
+ return mergeCopy(LOCALE_CONFIGS[DEFAULT_LOCALE].messages.common, config.messages.common);
+}
+
+// Loads and merges a per-studio-tab namespace (messages/{locale}/studio/{tabId}.json)
+// over its English default. Namespaces are loaded lazily by each Studio
+// component (`getStudioCopy('imageStudio', enBundle, zhBundle, locale)`)
+// so this file doesn't need to import every tab's bundle up front.
+export function resolveStudioCopy(enBundle, localeBundle, locale) {
+ if (locale === DEFAULT_LOCALE) return enBundle;
+ return mergeCopy(enBundle, localeBundle);
+}
+
+// Builds the studio path for a given tab under the active locale's root,
+// e.g. localizeStudioPath('zh', 'video') -> '/zh/studio/video'.
+export function localizeStudioPath(locale, tabId) {
+ const config = getLocaleConfig(locale);
+ const suffix = tabId ? `/studio/${tabId}` : '/studio';
+ return `${config.rootPath}${suffix}`;
+}
diff --git a/messages/en/common.json b/messages/en/common.json
new file mode 100644
index 00000000..b03b07d7
--- /dev/null
+++ b/messages/en/common.json
@@ -0,0 +1,68 @@
+{
+ "tabs": {
+ "image": "Image Studio",
+ "layers": "Layers Studio",
+ "video": "Video Studio",
+ "audio": "Audio Studio",
+ "clipping": "AI Clipping",
+ "vibe-motion": "Vibe Motion",
+ "lipsync": "Lip Sync",
+ "body-swap": "Body Swap",
+ "cinema": "Cinema Studio",
+ "marketing": "Marketing Studio",
+ "workflows": "Workflows",
+ "agents": "Agents",
+ "design-agent": "Design Agent",
+ "apps": "Explore Apps",
+ "ai-influencer": "AI Influencer Studio"
+ },
+ "categories": {
+ "images": "Images",
+ "video": "Video",
+ "audio": "Audio",
+ "agents-automation": "Agents & Automation"
+ },
+ "shell": {
+ "brand": "OpenGenerativeAI",
+ "studioFallback": "Studio",
+ "expandSidebar": "Expand sidebar",
+ "collapseSidebar": "Collapse sidebar",
+ "toggleNavMenu": "Toggle Navigation Menu",
+ "studioNavigation": "Studio navigation",
+ "toolsSuffix": "tools",
+ "settings": "Settings",
+ "dropHere": "Drop your media here",
+ "dropHereHint": "Images, videos, or audio files",
+ "vadooPromo": "Unrestricted AI Images & Videos → Auto-Publish as YouTube Shorts & TikToks, Earn ↗",
+ "dismiss": "Dismiss"
+ },
+ "settingsModal": {
+ "title": "Settings",
+ "subtitle": "Manage your AI studio preferences and authentication.",
+ "activeApiKey": "Active API Key",
+ "changeKey": "Change Key",
+ "close": "Close"
+ },
+ "notifications": {
+ "generating": "is generating",
+ "generationComplete": "- Generation complete",
+ "generationFailed": "- Generation failed",
+ "resultReady": "Your result is ready.",
+ "open": "Open →",
+ "openResult": "Open {label} result",
+ "dismissNotification": "Dismiss notification",
+ "ariaLabel": "Generation activity and notifications"
+ },
+ "apiKeyModal": {
+ "title": "Open Generative AI",
+ "subtitlePrefix": "Enter your",
+ "subtitleSuffix": "API key to start creating",
+ "close": "Close",
+ "label": "API Access Key",
+ "placeholder": "Paste your key here...",
+ "missingKeyError": "Please enter your API key",
+ "submit": "Get Started",
+ "needKey": "Need a key?",
+ "getOneFree": "Get one free →"
+ }
+}
diff --git a/messages/zh/common.json b/messages/zh/common.json
new file mode 100644
index 00000000..e5546c52
--- /dev/null
+++ b/messages/zh/common.json
@@ -0,0 +1,68 @@
+{
+ "tabs": {
+ "image": "图像工作室",
+ "layers": "图层工作室",
+ "video": "视频工作室",
+ "audio": "音频工作室",
+ "clipping": "AI 剪辑",
+ "vibe-motion": "动感运镜",
+ "lipsync": "唇形同步",
+ "body-swap": "换体",
+ "cinema": "影院工作室",
+ "marketing": "营销工作室",
+ "workflows": "工作流",
+ "agents": "智能体",
+ "design-agent": "设计智能体",
+ "apps": "探索应用",
+ "ai-influencer": "AI 网红工作室"
+ },
+ "categories": {
+ "images": "图像",
+ "video": "视频",
+ "audio": "音频",
+ "agents-automation": "智能体与自动化"
+ },
+ "shell": {
+ "brand": "OpenGenerativeAI",
+ "studioFallback": "工作室",
+ "expandSidebar": "展开侧边栏",
+ "collapseSidebar": "收起侧边栏",
+ "toggleNavMenu": "切换导航菜单",
+ "studioNavigation": "工作室导航",
+ "toolsSuffix": "工具",
+ "settings": "设置",
+ "dropHere": "将媒体文件拖放到此处",
+ "dropHereHint": "图片、视频或音频文件",
+ "vadooPromo": "无限制 AI 图像与视频 → 自动发布为 YouTube Shorts 和 TikTok,赚取收益 ↗",
+ "dismiss": "关闭"
+ },
+ "settingsModal": {
+ "title": "设置",
+ "subtitle": "管理您的 AI 工作室偏好设置和身份验证。",
+ "activeApiKey": "当前 API 密钥",
+ "changeKey": "更换密钥",
+ "close": "关闭"
+ },
+ "notifications": {
+ "generating": "正在生成",
+ "generationComplete": "- 生成完成",
+ "generationFailed": "- 生成失败",
+ "resultReady": "您的结果已就绪。",
+ "open": "打开 →",
+ "openResult": "打开 {label} 的结果",
+ "dismissNotification": "关闭通知",
+ "ariaLabel": "生成活动与通知"
+ },
+ "apiKeyModal": {
+ "title": "Open Generative AI",
+ "subtitlePrefix": "输入您的",
+ "subtitleSuffix": "API 密钥以开始创作",
+ "close": "关闭",
+ "label": "API 访问密钥",
+ "placeholder": "在此粘贴您的密钥...",
+ "missingKeyError": "请输入您的 API 密钥",
+ "submit": "开始使用",
+ "needKey": "还没有密钥?",
+ "getOneFree": "免费获取 →"
+ }
+}
diff --git a/middleware.js b/middleware.js
index 47313fd4..63ceb577 100644
--- a/middleware.js
+++ b/middleware.js
@@ -1,4 +1,5 @@
import { NextResponse } from 'next/server';
+import { getLocaleFromPathname } from './lib/locales';
function addSecurityHeaders(response) {
// Prevent MIME type sniffing (CWE-693)
@@ -41,8 +42,12 @@ export function middleware(request) {
}
}
- // Add security headers to all responses
- return addSecurityHeaders(NextResponse.next());
+ // Plain response header carrying the locale derived from the URL path
+ // (same "set in middleware, read via headers() in the root layout"
+ // trick the main muapi client uses — see docs/localization.md).
+ const response = NextResponse.next();
+ response.headers.set('x-locale', getLocaleFromPathname(url.pathname));
+ return addSecurityHeaders(response);
}
// Match all paths for security headers. Exclude Next.js internal paths.
diff --git a/packages/studio/src/components/AgentStudio.jsx b/packages/studio/src/components/AgentStudio.jsx
index 345e633c..e59c5acf 100644
--- a/packages/studio/src/components/AgentStudio.jsx
+++ b/packages/studio/src/components/AgentStudio.jsx
@@ -14,22 +14,25 @@ import {
pollAgentChatResult,
createAgent,
} from "../muapi.js";
+import en from "../messages/en/agentStudio.json";
+import zh from "../messages/zh/agentStudio.json";
+import { resolveCopy } from "../i18nUtils";
// ─── Helpers ────────────────────────────────────────────────────────────────
-function timeAgo(dateStr) {
+function timeAgo(dateStr, copy) {
if (!dateStr) return "";
const utcStr =
dateStr.endsWith("Z") || dateStr.includes("+") ? dateStr : dateStr + "Z";
const diff = Math.floor((Date.now() - new Date(utcStr)) / 1000);
- if (diff < 60) return "just now";
- if (diff < 3600) return `${Math.floor(diff / 60)}m ago`;
- if (diff < 86400) return `${Math.floor(diff / 3600)}h ago`;
- if (diff < 604800) return `${Math.floor(diff / 86400)}d ago`;
+ if (diff < 60) return copy.time.justNow;
+ if (diff < 3600) return copy.time.minutesAgo.replace("{n}", Math.floor(diff / 60));
+ if (diff < 86400) return copy.time.hoursAgo.replace("{n}", Math.floor(diff / 3600));
+ if (diff < 604800) return copy.time.daysAgo.replace("{n}", Math.floor(diff / 86400));
return new Date(utcStr).toLocaleDateString();
}
// ─── Agent Card (grid) ───────────────────────────────────────────────────────
-function AgentCard({ agent, onClick, onEdit }) {
+function AgentCard({ agent, onClick, onEdit, copy }) {
return (
<div className="group relative aspect-[4/5] rounded-xl cursor-pointer">
<div
@@ -52,14 +55,14 @@ function AgentCard({ agent, onClick, onEdit }) {
<div className="absolute inset-0 bg-gradient-to-t from-black/90 via-black/20 to-transparent" />
<div className="absolute inset-x-0 bottom-0 p-4">
<div className="text-[10px] font-bold text-[#22d3ee] uppercase tracking-wider mb-1 opacity-80">
- {agent.category || "AI Assistant"}
+ {agent.category || copy.card.defaultCategory}
</div>
<h3 className="text-sm font-bold text-white truncate group-hover:text-[#22d3ee] transition-colors">
- {agent.name || "Unnamed Agent"}
+ {agent.name || copy.card.unnamedAgent}
</h3>
{agent.owner_username && (
<p className="text-[9px] text-white/40 mt-1 uppercase tracking-tighter font-black">
- By {agent.owner_username}
+ {copy.card.byPrefix} {agent.owner_username}
</p>
)}
</div>
@@ -84,8 +87,8 @@ function AgentCard({ agent, onClick, onEdit }) {
}
// ─── Conversation Card (My Chats) ────────────────────────────────────────────
-function ConversationCard({ conv, onClick }) {
- const displayTitle = conv.title || "New Chat";
+function ConversationCard({ conv, onClick, copy }) {
+ const displayTitle = conv.title || copy.card.newChat;
const agentSlug = conv.agent_slug || conv.agent_id;
return (
<div
@@ -106,7 +109,7 @@ function ConversationCard({ conv, onClick }) {
</div>
<div className="flex-1 min-w-0">
<p className="text-[10px] font-black text-[#22d3ee] uppercase tracking-wider truncate">
- {conv.agent_name || "Unknown Agent"}
+ {conv.agent_name || copy.card.unknownAgent}
</p>
<p className="text-sm font-bold text-white truncate" title={displayTitle}>
{displayTitle}
@@ -114,8 +117,8 @@ function ConversationCard({ conv, onClick }) {
</div>
</div>
<div className="flex items-center justify-between pt-2 border-t border-white/5 mt-auto text-[10px] text-white/30 font-medium">
- <span>{timeAgo(conv.updated_at)}</span>
- {conv.message_count != null && <span>{conv.message_count} msgs</span>}
+ <span>{timeAgo(conv.updated_at, copy)}</span>
+ {conv.message_count != null && <span>{conv.message_count} {copy.card.msgsSuffix}</span>}
</div>
</div>
);
@@ -159,9 +162,10 @@ function ChatBubble({ message }) {
// ─── Main Component ──────────────────────────────────────────────────────────
const TABS = ["templates", "my-agents", "my-chats"];
-export default function AgentStudio({ apiKey }) {
+export default function AgentStudio({ apiKey, locale = "en" }) {
const router = useRouter();
const params = useParams();
+ const copy = resolveCopy(en, zh, locale);
const [activeMainTab, setActiveMainTab] = useState("templates");
const [agents, setAgents] = useState([]);
@@ -255,7 +259,7 @@ export default function AgentStudio({ apiKey }) {
}
setView("chat");
} catch (err) {
- if (!cancelled) setChatError(err.message || "Failed to load agent");
+ if (!cancelled) setChatError(err.message || copy.errors.loadAgentFailed);
} finally {
if (!cancelled) setChatLoading(false);
}
@@ -293,7 +297,7 @@ export default function AgentStudio({ apiKey }) {
router.replace(`/agents/${agentSlug}/${result.conversation_id}`, { scroll: false });
}
} catch (err) {
- setChatError(err.message || "Failed to send message");
+ setChatError(err.message || copy.errors.sendFailed);
} finally {
setSending(false);
}
@@ -315,7 +319,7 @@ export default function AgentStudio({ apiKey }) {
});
router.push(`/agents/${created.agent_id}`);
} catch (err) {
- setCreateError(err.message || "Failed to create agent");
+ setCreateError(err.message || copy.errors.createFailed);
} finally {
setCreating(false);
}
@@ -345,7 +349,7 @@ export default function AgentStudio({ apiKey }) {
}
} catch (err) {
console.error("AgentStudio load error:", err);
- if (!cancelled) setError(err.message || "Failed to load.");
+ if (!cancelled) setError(err.message || copy.errors.loadFailed);
} finally {
if (!cancelled) setLoading(false);
}
@@ -368,53 +372,53 @@ export default function AgentStudio({ apiKey }) {
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
<path d="M19 12H5M12 19l-7-7 7-7" />
</svg>
- Agents
+ {copy.buttons.back}
</button>
- <h2 className="text-sm font-black uppercase tracking-[0.2em] text-[#22d3ee]">Create Agent</h2>
+ <h2 className="text-sm font-black uppercase tracking-[0.2em] text-[#22d3ee]">{copy.headings.createAgent}</h2>
</div>
<form onSubmit={handleCreateSubmit} className="max-w-2xl w-full mx-auto p-8 space-y-6">
<div className="space-y-2">
- <label className="block text-[10px] font-black text-white/40 uppercase tracking-widest">Name</label>
+ <label className="block text-[10px] font-black text-white/40 uppercase tracking-widest">{copy.labels.name}</label>
<input
type="text"
required
value={createForm.name}
onChange={(e) => setCreateForm((f) => ({ ...f, name: e.target.value }))}
- placeholder="e.g. Caption Crafter Pro"
+ placeholder={copy.placeholders.name}
className="w-full bg-white/5 border border-white/10 rounded-lg p-3 text-sm text-white focus:outline-none focus:border-[#22d3ee]/50 transition-colors"
/>
</div>
<div className="space-y-2">
- <label className="block text-[10px] font-black text-white/40 uppercase tracking-widest">Description</label>
+ <label className="block text-[10px] font-black text-white/40 uppercase tracking-widest">{copy.labels.description}</label>
<input
type="text"
value={createForm.description}
onChange={(e) => setCreateForm((f) => ({ ...f, description: e.target.value }))}
- placeholder="What does this agent help with?"
+ placeholder={copy.placeholders.description}
className="w-full bg-white/5 border border-white/10 rounded-lg p-3 text-sm text-white focus:outline-none focus:border-[#22d3ee]/50 transition-colors"
/>
</div>
<div className="space-y-2">
- <label className="block text-[10px] font-black text-white/40 uppercase tracking-widest">System Prompt</label>
+ <label className="block text-[10px] font-black text-white/40 uppercase tracking-widest">{copy.labels.systemPrompt}</label>
<textarea
required
value={createForm.system_prompt}
onChange={(e) => setCreateForm((f) => ({ ...f, system_prompt: e.target.value }))}
- placeholder="You are a helpful assistant that..."
+ placeholder={copy.placeholders.systemPrompt}
className="w-full bg-white/5 border border-white/10 rounded-lg p-3 text-sm text-white focus:outline-none focus:border-[#22d3ee]/50 transition-colors min-h-[140px] resize-none"
/>
</div>
<div className="space-y-2">
- <label className="block text-[10px] font-black text-white/40 uppercase tracking-widest">Welcome Message (optional)</label>
+ <label className="block text-[10px] font-black text-white/40 uppercase tracking-widest">{copy.labels.welcomeMessage}</label>
<input
type="text"
value={createForm.welcome_message}
onChange={(e) => setCreateForm((f) => ({ ...f, welcome_message: e.target.value }))}
- placeholder="Hi! How can I help you today?"
+ placeholder={copy.placeholders.welcomeMessage}
className="w-full bg-white/5 border border-white/10 rounded-lg p-3 text-sm text-white focus:outline-none focus:border-[#22d3ee]/50 transition-colors"
/>
</div>
@@ -431,10 +435,10 @@ export default function AgentStudio({ apiKey }) {
{creating ? (
<>
<div className="w-4 h-4 border-2 border-black/20 border-t-black rounded-full animate-spin" />
- <span>Creating...</span>
+ <span>{copy.buttons.creating}</span>
</>
) : (
- <span>Create Agent</span>
+ <span>{copy.buttons.createAgentSubmit}</span>
)}
</button>
</form>
@@ -455,7 +459,7 @@ export default function AgentStudio({ apiKey }) {
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
<path d="M19 12H5M12 19l-7-7 7-7" />
</svg>
- Agents
+ {copy.buttons.back}
</button>
<div className="h-4 w-[1px] bg-white/10" />
{activeAgent && (
@@ -511,7 +515,7 @@ export default function AgentStudio({ apiKey }) {
handleSendMessage();
}
}}
- placeholder="Message this agent..."
+ placeholder={copy.placeholders.chatInput}
rows={1}
className="flex-1 bg-white/5 border border-white/10 rounded-xl p-3 text-sm text-white focus:outline-none focus:border-[#22d3ee]/50 transition-colors resize-none max-h-40"
/>
@@ -520,7 +524,7 @@ export default function AgentStudio({ apiKey }) {
disabled={!chatInput.trim() || sending}
className="px-5 py-3 bg-[#22d3ee] text-black text-xs font-black uppercase tracking-widest rounded-xl hover:bg-white transition-all disabled:opacity-40"
>
- Send
+ {copy.buttons.send}
</button>
</form>
</div>
@@ -535,7 +539,7 @@ export default function AgentStudio({ apiKey }) {
<div className="flex-shrink-0 h-16 border-b border-white/5 flex items-center justify-between px-8 bg-black/40">
<div className="flex items-center gap-8 h-full">
<h2 className="text-sm font-black uppercase tracking-[0.2em] text-[#22d3ee]">
- Agents
+ {copy.headings.agents}
</h2>
<div className="flex gap-1 bg-white/5 p-1 rounded-xl">
{TABS.map((tab) => (
@@ -548,7 +552,7 @@ export default function AgentStudio({ apiKey }) {
: "text-white/40 hover:text-white hover:bg-white/5"
}`}
>
- {tab.replace(/-/g, " ")}
+ {copy.tabs[tab] || tab.replace(/-/g, " ")}
</button>
))}
</div>
@@ -559,7 +563,7 @@ export default function AgentStudio({ apiKey }) {
className="px-6 py-2 bg-[#22d3ee] text-black text-[10px] font-black uppercase tracking-widest rounded-lg hover:bg-[#ebff66] transition-all active:scale-95 flex items-center gap-2"
>
<span className="text-sm">+</span>
- Create
+ {copy.buttons.create}
</button>
</div>
@@ -581,7 +585,7 @@ export default function AgentStudio({ apiKey }) {
onClick={() => setActiveMainTab(activeMainTab)} // retrigger effect
className="text-[10px] text-white/40 hover:text-white border border-white/10 px-4 py-2 rounded-lg transition-colors"
>
- Retry
+ {copy.buttons.retry}
</button>
</div>
) : activeMainTab === "my-chats" ? (
@@ -591,12 +595,12 @@ export default function AgentStudio({ apiKey }) {
<svg width="60" height="60" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="0.5">
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />
</svg>
- <p className="text-[10px] font-black uppercase tracking-[0.3em]">No chats yet</p>
+ <p className="text-[10px] font-black uppercase tracking-[0.3em]">{copy.empty.noChats}</p>
<button
onClick={() => setActiveMainTab("templates")}
className="text-[10px] text-[#22d3ee] hover:text-white border border-[#22d3ee]/20 hover:border-white/20 px-4 py-2 rounded-lg transition-colors"
>
- Browse Templates
+ {copy.buttons.browseTemplates}
</button>
</div>
) : (
@@ -606,6 +610,7 @@ export default function AgentStudio({ apiKey }) {
key={conv.id}
conv={conv}
onClick={handleOpenConversation}
+ copy={copy}
/>
))}
</div>
@@ -617,7 +622,7 @@ export default function AgentStudio({ apiKey }) {
<svg width="60" height="60" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="0.5">
<path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5" />
</svg>
- <p className="text-[10px] font-black uppercase tracking-[0.3em]">No agents found</p>
+ <p className="text-[10px] font-black uppercase tracking-[0.3em]">{copy.empty.noAgents}</p>
</div>
) : (
<div className="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 2xl:grid-cols-6 gap-6 max-w-[1600px] mx-auto">
@@ -626,6 +631,7 @@ export default function AgentStudio({ apiKey }) {
key={agent.agent_id || agent.id}
agent={agent}
onClick={handleSelectAgent}
+ copy={copy}
/>
))}
</div>
diff --git a/packages/studio/src/components/AiInfluencerStudio.jsx b/packages/studio/src/components/AiInfluencerStudio.jsx
index 8010e053..169d1293 100644
--- a/packages/studio/src/components/AiInfluencerStudio.jsx
+++ b/packages/studio/src/components/AiInfluencerStudio.jsx
@@ -7,6 +7,9 @@ import { formatErrorMessage } from "../utils/formatError.js";
import MobileGenerationActions, {
GenerationCopyButtons,
} from "./MobileGenerationActions.jsx";
+import en from "../messages/en/aiInfluencerStudio.json";
+import zh from "../messages/zh/aiInfluencerStudio.json";
+import { resolveCopy } from "../i18nUtils";
const CDN = "https://cdn.muapi.ai/influencer";
@@ -343,7 +346,9 @@ export default function AiInfluencerStudio({
onGenerationComplete,
onGenerationError,
isGenerating: externalIsGenerating,
+ locale = "en",
}) {
+ const copy = resolveCopy(en, zh, locale);
const [activeTab, setActiveTab] = useState("face");
const [selectedOptions, setSelectedOptions] = useState(() => {
@@ -428,7 +433,7 @@ export default function AiInfluencerStudio({
});
}
} catch (err) {
- const message = formatErrorMessage(err, "Generation failed. Please try again.");
+ const message = formatErrorMessage(err, copy.errors.generationFailed);
if (onGenerationError) onGenerationError(message);
else toast.error(message);
} finally {
@@ -483,7 +488,7 @@ export default function AiInfluencerStudio({
{/* Builder header */}
<div className="flex items-center justify-between px-4 py-3 border-b border-white/[0.07] shrink-0">
- <span className="text-[13px] font-bold text-white tracking-tight">Builder</span>
+ <span className="text-[13px] font-bold text-white tracking-tight">{copy.builder.title}</span>
<button
onClick={() => setSelectedOptions((() => {
const init = {};
@@ -496,7 +501,7 @@ export default function AiInfluencerStudio({
})())}
className="text-[11px] text-gray-500 hover:text-white transition-colors font-medium"
>
- Reset
+ {copy.builder.reset}
</button>
</div>
@@ -512,7 +517,7 @@ export default function AiInfluencerStudio({
: "text-gray-500 hover:text-white hover:bg-white/[0.06]"
}`}
>
- {TABS_CONFIG[key].label}
+ {copy.categoryTabs[key] || TABS_CONFIG[key].label}
</button>
))}
</div>
@@ -522,7 +527,7 @@ export default function AiInfluencerStudio({
{TABS_CONFIG[activeTab]?.subcategories?.map((subcat) => (
<div key={subcat.id}>
<p className="text-[10px] font-bold text-gray-500 uppercase tracking-widest mb-2 px-0.5">
- {subcat.label}
+ {copy.subcategories[subcat.id] || subcat.label}
</p>
<div className="grid grid-cols-3 gap-1.5">
{subcat.options?.map((opt) => {
@@ -594,7 +599,7 @@ export default function AiInfluencerStudio({
className="flex items-center gap-1.5 px-3 py-2 rounded-xl bg-white/[0.05] border border-white/[0.08] text-gray-400 hover:text-white hover:bg-white/10 text-[12px] font-semibold transition-all"
>
<ShuffleIcon />
- Shuffle
+ {copy.toolbar.shuffle}
</button>
{/* Generate */}
@@ -613,10 +618,10 @@ export default function AiInfluencerStudio({
<path d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z" strokeOpacity="0.3" />
<path d="M21 12a9 9 0 00-9-9" />
</svg>
- Generating…
+ {copy.toolbar.generating}
</>
) : (
- <><BoltIcon />Generate Character</>
+ <><BoltIcon />{copy.toolbar.generate}</>
)}
</button>
</div>
@@ -631,18 +636,18 @@ export default function AiInfluencerStudio({
{isGenerating ? (
<div className="flex flex-col items-center gap-4 text-center px-8 py-12">
<div className="w-12 h-12 border-[3px] border-violet-500/20 border-t-violet-500 rounded-full animate-spin" />
- <p className="text-sm text-gray-400 font-medium">Generating your AI influencer…</p>
+ <p className="text-sm text-gray-400 font-medium">{copy.preview.generating}</p>
</div>
) : previewUrl ? (
<>
- <img src={previewUrl} alt="Generated AI Character" className="w-full h-full object-cover" />
+ <img src={previewUrl} alt={copy.preview.altGenerated} className="w-full h-full object-cover" />
{/* Download overlay button */}
<button
onClick={() => downloadImg(previewUrl)}
className="absolute bottom-3 right-3 flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-black/60 backdrop-blur-sm border border-white/10 text-white text-[11px] font-semibold hover:bg-black/80 transition-all"
>
<DownloadIcon />
- Save
+ {copy.preview.save}
</button>
</>
) : (
@@ -650,8 +655,8 @@ export default function AiInfluencerStudio({
<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="0.8" className="text-gray-700">
<path d="M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2" /><circle cx="12" cy="7" r="4" />
</svg>
- <p className="text-sm text-gray-600 font-medium">Your AI influencer lives here.</p>
- <p className="text-xs text-gray-700">Design and build your AI influencer<br />from scratch</p>
+ <p className="text-sm text-gray-600 font-medium">{copy.preview.emptyTitle}</p>
+ <p className="text-xs text-gray-700">{copy.preview.emptySubtitleLine1}<br />{copy.preview.emptySubtitleLine2}</p>
</div>
)}
</div>
@@ -681,7 +686,7 @@ export default function AiInfluencerStudio({
onClick={() => setShowAllTags((v) => !v)}
className="h-[22px] px-2 rounded-md bg-white/[0.04] hover:bg-white/[0.09] border border-white/[0.08] text-[11px] text-gray-500 hover:text-gray-300 whitespace-nowrap transition-all"
>
- {showAllTags ? "hide" : `show more`}
+ {showAllTags ? copy.tags.hide : copy.tags.showMore}
</button>
)}
</div>
@@ -701,7 +706,7 @@ export default function AiInfluencerStudio({
type="text"
value={customPrompt}
onChange={(e) => setCustomPrompt(e.target.value)}
- placeholder="Add extra details… e.g. neon cyberpunk lighting, dramatic shadows"
+ placeholder={copy.customPrompt.placeholder}
className="w-full h-9 bg-[#161616] border border-white/[0.07] rounded-xl px-3 text-[12px] text-gray-200 placeholder-gray-600 outline-none focus:border-violet-500/40 transition-colors"
/>
</div>
@@ -714,8 +719,8 @@ export default function AiInfluencerStudio({
{/* Gallery header */}
<div className="px-3 py-3 border-b border-white/[0.07] shrink-0">
- <p className="text-[11px] font-bold text-white tracking-tight">Generated</p>
- <p className="text-[9px] text-gray-600 mt-0.5">{history.length} characters</p>
+ <p className="text-[11px] font-bold text-white tracking-tight">{copy.gallery.title}</p>
+ <p className="text-[9px] text-gray-600 mt-0.5">{history.length} {copy.gallery.countSuffix}</p>
</div>
{/* Gallery scroll */}
@@ -725,7 +730,7 @@ export default function AiInfluencerStudio({
<svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1" className="text-gray-700 mb-2">
<rect x="3" y="3" width="18" height="18" rx="2" ry="2" /><circle cx="8.5" cy="8.5" r="1.5" /><polyline points="21 15 16 10 5 21" />
</svg>
- <p className="text-[9px] text-gray-700 leading-relaxed">Generated characters<br />appear here</p>
+ <p className="text-[9px] text-gray-700 leading-relaxed">{copy.gallery.emptyText.split('\n')[0]}<br />{copy.gallery.emptyText.split('\n')[1]}</p>
</div>
) : (
history.map((item, idx) => (
@@ -741,7 +746,7 @@ export default function AiInfluencerStudio({
: "border-white/[0.08] hover:border-white/20"
}`}
>
- <img src={item.url} alt={`Character ${idx + 1}`} className="w-full h-full object-cover" />
+ <img src={item.url} alt={`${copy.gallery.altPrefix} ${idx + 1}`} className="w-full h-full object-cover" />
{/* Download on hover */}
<div className="absolute inset-0 hidden md:flex bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity items-end justify-center pb-2">
<div className="absolute right-2 top-2 flex flex-col gap-2">
@@ -768,7 +773,7 @@ export default function AiInfluencerStudio({
actions={[
{
kind: "download",
- label: "Download",
+ label: copy.gallery.download,
onSelect: () => downloadImg(item.url),
},
]}
diff --git a/packages/studio/src/components/AppsStudio.jsx b/packages/studio/src/components/AppsStudio.jsx
index 3d2e306c..7358f92e 100644
--- a/packages/studio/src/components/AppsStudio.jsx
+++ b/packages/studio/src/components/AppsStudio.jsx
@@ -9,6 +9,9 @@ import {
} from "react-icons/fa";
import { registerAppInterest, getAppInterests } from '../muapi.js';
import toast, { Toaster } from 'react-hot-toast';
+import en from '../messages/en/appsStudio.json';
+import zh from '../messages/zh/appsStudio.json';
+import { resolveCopy } from '../i18nUtils';
const templateApps = [
{
@@ -129,7 +132,8 @@ const dummyAppsData = [
{ thumbnail: "https://cdn.muapi.ai/apps/Lumea_Residence.webp", name: "Lumea Residence", description: "Smart home property management and tenant portal.", icon: FaHome, category: "Real Estate" }
];
-export default function AppsStudio({ apiKey }) {
+export default function AppsStudio({ apiKey, locale = 'en' }) {
+ const copy = resolveCopy(en, zh, locale);
const [selectedApp, setSelectedApp] = useState(null);
const [isRequesting, setIsRequesting] = useState(false);
const [requestedApps, setRequestedApps] = useState([]);
@@ -149,11 +153,11 @@ export default function AppsStudio({ apiKey }) {
try {
await registerAppInterest(apiKey, selectedApp.name);
setRequestedApps(prev => [...prev, selectedApp.name]);
- toast.success("Got it! We'll send you the template details shortly.");
+ toast.success(copy.toast.requestSuccess);
setTimeout(() => setSelectedApp(null), 1500);
} catch (error) {
console.error(error);
- toast.error("Failed to register interest. Please try again later.");
+ toast.error(copy.toast.requestError);
} finally {
setIsRequesting(false);
}
@@ -200,7 +204,7 @@ export default function AppsStudio({ apiKey }) {
</div>
<div className="flex-1 min-w-0">
<h3 className="text-sm font-bold text-white uppercase tracking-tight truncate">{app.name}</h3>
- <p className="text-[10px] text-white/40 font-bold uppercase tracking-widest">{app.category || 'Template'}</p>
+ <p className="text-[10px] text-white/40 font-bold uppercase tracking-widest">{app.category || copy.card.templateFallback}</p>
</div>
</div>
@@ -215,14 +219,14 @@ export default function AppsStudio({ apiKey }) {
className="flex-1 py-2 bg-white/5 text-white rounded-md text-[11px] font-bold uppercase tracking-wider flex items-center justify-center gap-2 hover:bg-white/10 transition-all border border-white/5 active:scale-95"
>
<FaGithub className="text-xs" />
- Github
+ {copy.card.github}
</button>
<button
onClick={() => setSelectedApp(app)}
className="flex-1 py-2 bg-[#22d3ee]/10 text-[#22d3ee] rounded-md text-[11px] font-bold uppercase tracking-wider flex items-center justify-center gap-2 hover:bg-[#22d3ee]/20 transition-all border border-[#22d3ee]/20 active:scale-95"
>
<FaExternalLinkAlt className="text-[9px]" />
- Demo
+ {copy.card.demo}
</button>
</>
) : (
@@ -234,7 +238,7 @@ export default function AppsStudio({ apiKey }) {
className="flex-1 py-2 bg-white/5 text-white rounded-md text-[11px] font-bold uppercase tracking-wider flex items-center justify-center gap-2 hover:bg-white/10 transition-all border border-white/5 active:scale-95"
>
<FaGithub className="text-xs" />
- Github
+ {copy.card.github}
</a>
<a
href={app.hosted || '#'}
@@ -243,7 +247,7 @@ export default function AppsStudio({ apiKey }) {
className="flex-1 py-2 bg-[#22d3ee]/10 text-[#22d3ee] rounded-md text-[11px] font-bold uppercase tracking-wider flex items-center justify-center gap-2 hover:bg-[#22d3ee]/20 transition-all border border-[#22d3ee]/20 active:scale-95"
>
<FaExternalLinkAlt className="text-[9px]" />
- Demo
+ {copy.card.demo}
</a>
</>
)}
@@ -263,45 +267,29 @@ export default function AppsStudio({ apiKey }) {
<div className="text-center space-y-6 max-w-3xl">
<div className="inline-flex items-center gap-2 px-3 py-1.5 bg-[#22d3ee]/10 border border-[#22d3ee]/20 rounded-full">
<FaDollarSign className="text-[#22d3ee] text-xs" />
- <span className="text-[10px] font-black text-[#22d3ee] uppercase tracking-widest">Revenue-Ready Templates</span>
+ <span className="text-[10px] font-black text-[#22d3ee] uppercase tracking-widest">{copy.hero.badge}</span>
</div>
<h1 className="text-5xl font-black text-white tracking-tighter leading-[0.9]">
- LAUNCH AN AI APP.<br />START EARNING TODAY.
+ {copy.hero.titleLine1}<br />{copy.hero.titleLine2}
</h1>
<p className="text-white/40 text-sm font-medium leading-relaxed max-w-xl mx-auto">
- Each template is a fully-functional, Stripe-integrated AI SaaS you can deploy in minutes.
- Charge your users, keep the revenue — muapi handles the AI infrastructure.
+ {copy.hero.subtitle}
</p>
</div>
{/* Monetization Steps */}
<div className="w-full grid grid-cols-1 sm:grid-cols-3 gap-4">
{[
- {
- icon: FaRocket,
- step: "01",
- title: "Deploy in Minutes",
- body: "Fork the open-source template, add your muapi key, and push to Vercel. No backend setup needed."
- },
- {
- icon: FaCreditCard,
- step: "02",
- title: "Collect Payments",
- body: "Stripe is pre-wired. Set your own pricing — one-time credits, subscriptions, or pay-per-use."
- },
- {
- icon: FaDollarSign,
- step: "03",
- title: "Keep the Revenue",
- body: "Payments go straight to your Stripe account. You own the product, the brand, and the profits."
- }
+ { icon: FaRocket, step: "01", title: copy.steps.deploy.title, body: copy.steps.deploy.body },
+ { icon: FaCreditCard, step: "02", title: copy.steps.collect.title, body: copy.steps.collect.body },
+ { icon: FaDollarSign, step: "03", title: copy.steps.keep.title, body: copy.steps.keep.body },
].map(({ icon: Icon, step, title, body }) => (
<div key={step} className="flex items-start gap-4 bg-[#0a0a0a] border border-white/5 rounded-2xl p-6 hover:border-white/10 transition-colors">
<div className="w-12 h-12 shrink-0 rounded-2xl bg-white/5 flex items-center justify-center text-[#22d3ee] border border-white/5">
<Icon className="text-lg" />
</div>
<div>
- <p className="text-[10px] font-black text-white/30 uppercase tracking-widest mb-1">Step {step}</p>
+ <p className="text-[10px] font-black text-white/30 uppercase tracking-widest mb-1">{copy.steps.stepLabel} {step}</p>
<h3 className="text-sm font-bold text-white mb-1.5">{title}</h3>
<p className="text-xs text-white/40 leading-relaxed font-medium">{body}</p>
</div>
@@ -319,7 +307,7 @@ export default function AppsStudio({ apiKey }) {
<div className="pt-24 pb-12 flex flex-col items-center gap-4">
<div className="inline-flex items-center gap-3 px-4 py-2 bg-white/5 rounded-full border border-white/5">
<span className="block w-1.5 h-1.5 rounded-full bg-[#22d3ee] animate-pulse" />
- <span className="text-[9px] font-black text-white/40 uppercase tracking-widest">Muapi Ecosystem — More templates coming soon</span>
+ <span className="text-[9px] font-black text-white/40 uppercase tracking-widest">{copy.footer.moreComingSoon}</span>
</div>
</div>
</div>
@@ -334,26 +322,31 @@ export default function AppsStudio({ apiKey }) {
<selectedApp.icon />
</div>
<h2 className="text-2xl font-black text-white uppercase tracking-tight">
- Deploy {selectedApp.name}
+ {copy.modal.deployTitle.replace('{appName}', selectedApp.name)}
</h2>
<p className="text-sm font-medium text-white/40 leading-relaxed px-4">
- Enter your details and we&apos;ll send you the <b>{selectedApp.name}</b> template along with setup instructions so you can deploy and start earning immediately.
+ {copy.modal.body.split('{appName}').map((part, i, arr) => (
+ <React.Fragment key={i}>
+ {part}
+ {i < arr.length - 1 && <b>{selectedApp.name}</b>}
+ </React.Fragment>
+ ))}
</p>
</div>
<div className="space-y-3">
- <button
+ <button
onClick={handleRequestAccess}
disabled={isRequesting}
className="w-full py-4 bg-[#22d3ee] text-black rounded-md text-sm font-black uppercase tracking-widest flex items-center justify-center gap-2 hover:bg-[#22d3ee]/90 transition-all shadow-lg active:scale-95 disabled:opacity-50"
>
- {isRequesting ? 'Sending Details...' : 'Get Template'}
+ {isRequesting ? copy.modal.sending : copy.modal.getTemplate}
</button>
- <button
+ <button
onClick={() => setSelectedApp(null)}
className="w-full py-4 bg-white/5 border border-white/10 text-white/60 rounded-md text-sm font-bold uppercase tracking-widest flex items-center justify-center gap-2 hover:bg-white/10 transition-all"
>
- Maybe Later
+ {copy.modal.maybeLater}
</button>
</div>
</div>
diff --git a/packages/studio/src/components/AudioStudio.jsx b/packages/studio/src/components/AudioStudio.jsx
index 14d22309..c777cd87 100644
--- a/packages/studio/src/components/AudioStudio.jsx
+++ b/packages/studio/src/components/AudioStudio.jsx
@@ -6,6 +6,9 @@ import { generateAudio, uploadFile } from "../muapi.js";
import { formatErrorMessage } from "../utils/formatError.js";
import { scopedPersistKey, migrateLegacyPersistKey } from "../persistKey.js";
import { audioModels, getAudioModelById } from "../models.js";
+import en from "../messages/en/audioStudio.json";
+import zh from "../messages/zh/audioStudio.json";
+import { resolveCopy } from "../i18nUtils";
// ---------------------------------------------------------------------------
// Upload button states
@@ -67,7 +70,7 @@ const TrashIcon = () => (
// ---------------------------------------------------------------------------
// Single File Uploader Component
// ---------------------------------------------------------------------------
-function AudioFileUploader({ label, value, onChange, apiKey }) {
+function AudioFileUploader({ label, value, onChange, apiKey, copy = en }) {
const [uploadState, setUploadState] = useState(value ? UPLOAD_STATE.READY : UPLOAD_STATE.IDLE);
const [progress, setProgress] = useState(0);
const [fileName, setFileName] = useState(value ? value.split('/').pop().slice(-30) : "");
@@ -91,7 +94,7 @@ function AudioFileUploader({ label, value, onChange, apiKey }) {
if (!file) return;
if (file.size > 20 * 1024 * 1024) {
- alert("Audio file exceeds 20MB limit.");
+ alert(copy.uploader.sizeLimitError);
return;
}
@@ -107,7 +110,7 @@ function AudioFileUploader({ label, value, onChange, apiKey }) {
onChange(url);
} catch (err) {
setUploadState(UPLOAD_STATE.IDLE);
- alert(`Upload failed: ${err.message}`);
+ alert(copy.uploader.uploadFailedError.replace('{message}', err.message));
} finally {
setProgress(0);
}
@@ -172,7 +175,7 @@ function AudioFileUploader({ label, value, onChange, apiKey }) {
onClick={clearFile}
className="text-xs font-bold text-red-400 hover:text-red-300 transition-colors uppercase tracking-wider flex items-center gap-1.5"
>
- <TrashIcon /> Clear
+ <TrashIcon /> {copy.uploader.clear}
</button>
)}
</div>
@@ -207,8 +210,8 @@ function AudioFileUploader({ label, value, onChange, apiKey }) {
</svg>
</div>
<div className="text-left">
- <div className="text-xs font-bold text-white">Upload audio track</div>
- <div className="text-[11px] text-zinc-300 font-medium mt-0.5">MP3, WAV, M4A up to 20MB</div>
+ <div className="text-xs font-bold text-white">{copy.uploader.uploadPrompt}</div>
+ <div className="text-[11px] text-zinc-300 font-medium mt-0.5">{copy.uploader.uploadHint}</div>
</div>
</>
)}
@@ -217,7 +220,7 @@ function AudioFileUploader({ label, value, onChange, apiKey }) {
<div className="w-full flex items-center gap-4">
<div className="flex-1">
<div className="flex justify-between text-xs text-white/95 mb-1.5 font-bold">
- <span>Uploading...</span>
+ <span>{copy.uploader.uploading}</span>
<span>{progress}%</span>
</div>
<div className="h-1.5 bg-zinc-800 rounded-full overflow-hidden">
@@ -234,7 +237,7 @@ function AudioFileUploader({ label, value, onChange, apiKey }) {
</div>
<div className="text-left flex-1 min-w-0">
<div className="text-xs font-bold text-white truncate">{fileName}</div>
- <div className="text-[11px] text-primary font-bold mt-0.5">Ready to generate</div>
+ <div className="text-[11px] text-primary font-bold mt-0.5">{copy.uploader.ready}</div>
</div>
</>
)}
@@ -246,7 +249,7 @@ function AudioFileUploader({ label, value, onChange, apiKey }) {
// ---------------------------------------------------------------------------
// Multiple File Uploader Component (for array fields like audios_list)
// ---------------------------------------------------------------------------
-function AudioListUploader({ label, value = [], onChange, apiKey, maxItems = 2 }) {
+function AudioListUploader({ label, value = [], onChange, apiKey, maxItems = 2, copy = en }) {
const handleItemChange = (index, url) => {
const newItems = [...value];
if (url) {
@@ -260,16 +263,17 @@ function AudioListUploader({ label, value = [], onChange, apiKey, maxItems = 2 }
return (
<div className="space-y-4">
<label className="block text-xs font-bold text-zinc-200 uppercase tracking-wider">
- {label} (Max {maxItems})
+ {label} {copy.uploader.maxSuffix.replace('{max}', maxItems)}
</label>
<div className="space-y-3">
{Array.from({ length: maxItems }).map((_, i) => (
<AudioFileUploader
key={i}
- label={`Track #${i + 1}`}
+ label={copy.uploader.trackLabel.replace('{index}', i + 1)}
value={value[i] || null}
onChange={(url) => handleItemChange(i, url)}
apiKey={apiKey}
+ copy={copy}
/>
))}
</div>
@@ -280,7 +284,7 @@ function AudioListUploader({ label, value = [], onChange, apiKey, maxItems = 2 }
// ---------------------------------------------------------------------------
// Premium Custom Audio Player with Waveform Animation
// ---------------------------------------------------------------------------
-function PremiumAudioPlayer({ url, title }) {
+function PremiumAudioPlayer({ url, title, copy = en }) {
const [isPlaying, setIsPlaying] = useState(false);
const [currentTime, setCurrentTime] = useState(0);
const [duration, setDuration] = useState(0);
@@ -437,9 +441,9 @@ function PremiumAudioPlayer({ url, title }) {
</div>
<div className="text-center px-4 max-w-full relative z-10">
<span className="text-xs font-black text-primary uppercase tracking-[0.2em] block mb-1">
- Now Playing
+ {copy.player.nowPlaying}
</span>
- <p className="text-white font-bold text-base truncate max-w-xs">{title || "Generated Track"}</p>
+ <p className="text-white font-bold text-base truncate max-w-xs">{title || copy.player.defaultTitle}</p>
</div>
</div>
@@ -478,7 +482,7 @@ function PremiumAudioPlayer({ url, title }) {
<button
onClick={toggleMute}
className="p-2 bg-zinc-800/80 border border-zinc-700 hover:bg-zinc-700 rounded text-zinc-200 hover:text-white transition-all"
- title="Mute/Unmute"
+ title={copy.player.muteUnmute}
type="button"
>
{isMuted ? <VolumeMuteIcon /> : <VolumeIcon />}
@@ -498,7 +502,7 @@ function PremiumAudioPlayer({ url, title }) {
<button
onClick={togglePlay}
className="w-12 h-12 bg-primary hover:bg-white text-black rounded-full flex items-center justify-center hover:scale-105 active:scale-95 transition-all shadow-glow"
- title={isPlaying ? "Pause" : "Play"}
+ title={isPlaying ? copy.player.pause : copy.player.play}
type="button"
>
{isPlaying ? <PauseIcon /> : <PlayIcon />}
@@ -508,13 +512,13 @@ function PremiumAudioPlayer({ url, title }) {
<button
onClick={downloadAudio}
className="px-4 py-2 bg-zinc-800/80 hover:bg-zinc-700 border border-zinc-700 rounded text-xs font-bold text-white flex items-center gap-2 hover:border-primary/45 transition-all"
- title="Download Audio"
+ title={copy.player.download}
type="button"
>
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3" />
</svg>
- <span>Save</span>
+ <span>{copy.player.save}</span>
</button>
</div>
</div>
@@ -534,7 +538,9 @@ export default function AudioStudio({
historyItems,
droppedFiles,
onFilesHandled,
+ locale = "en",
}) {
+ const copy = resolveCopy(en, zh, locale);
const LEGACY_PERSIST_KEY = "hg_audio_studio_persistent";
const PERSIST_KEY = scopedPersistKey(LEGACY_PERSIST_KEY, apiKey);
useEffect(() => {
@@ -648,7 +654,7 @@ export default function AudioStudio({
.then(url => {
setParams(prev => ({ ...prev, [key]: url }));
})
- .catch(err => alert(`Failed to upload dropped file: ${err.message}`));
+ .catch(err => alert(copy.generate.droppedFileUploadError.replace('{message}', err.message)));
} else if (firstAudioListField) {
const [key] = firstAudioListField;
uploadFile(apiKey, audioFiles[0], () => {})
@@ -659,7 +665,7 @@ export default function AudioStudio({
return { ...prev, [key]: currentList };
});
})
- .catch(err => alert(`Failed to upload dropped file: ${err.message}`));
+ .catch(err => alert(copy.generate.droppedFileUploadError.replace('{message}', err.message)));
}
}
onFilesHandled?.();
@@ -673,7 +679,7 @@ export default function AudioStudio({
const handleSelectHistory = (entry, index) => {
setActiveResultUrl(entry.url);
- setActiveResultTitle(entry.title || entry.prompt || "Generated Track");
+ setActiveResultTitle(entry.title || entry.prompt || copy.player.defaultTitle);
setActiveHistoryIdx(index);
setView("result");
};
@@ -685,7 +691,7 @@ export default function AudioStudio({
if (selectedModel.required) {
for (const field of selectedModel.required) {
if (!params[field] || (Array.isArray(params[field]) && params[field].length === 0)) {
- alert(`Please complete the required field: ${selectedModel.inputs?.[field]?.title || field}`);
+ alert(copy.sidebar.requiredFieldError.replace('{field}', selectedModel.inputs?.[field]?.title || field));
return;
}
}
@@ -705,7 +711,7 @@ export default function AudioStudio({
const res = await generateAudio(apiKey, audioParams);
if (!res?.url) {
- throw new Error("No audio URL returned by the API.");
+ throw new Error(copy.generate.noUrlError);
}
const title = params.title || params.prompt || `Generated ${selectedModel.name}`;
@@ -735,7 +741,7 @@ export default function AudioStudio({
}
} catch (e) {
console.error("[AudioStudio]", e);
- const errMsg = formatErrorMessage(e, "Audio generation failed");
+ const errMsg = formatErrorMessage(e, copy.generate.genericError);
if (onGenerationError) onGenerationError(errMsg);
else toast.error(errMsg);
} finally {
@@ -761,7 +767,7 @@ export default function AudioStudio({
{/* Model Selector */}
<div className="space-y-2 relative">
<label className="text-xs font-bold text-zinc-300 uppercase tracking-wider block">
- Audio Model
+ {copy.sidebar.modelLabel}
</label>
<button
ref={modelBtnRef}
@@ -769,7 +775,7 @@ export default function AudioStudio({
onClick={() => setOpenDropdown(!openDropdown)}
className="w-full bg-zinc-900 border border-zinc-700 rounded px-4 py-3.5 text-sm text-left font-bold text-white flex items-center justify-between hover:bg-zinc-850 hover:border-primary/50 transition-all"
>
- <span>{selectedModel?.name ?? "Select Model"}</span>
+ <span>{selectedModel?.name ?? copy.sidebar.selectModel}</span>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" className={`transition-transform duration-200 ${openDropdown ? 'rotate-180' : ''}`}>
<polyline points="6 9 12 15 18 9" />
</svg>
@@ -804,7 +810,7 @@ export default function AudioStudio({
{/* Model Description */}
{selectedModel?.description && (
<div className="">
- <span className="text-[10px] font-bold text-primary uppercase tracking-wider block mb-1.5">Description</span>
+ <span className="text-[10px] font-bold text-primary uppercase tracking-wider block mb-1.5">{copy.sidebar.descriptionLabel}</span>
<p className="text-zinc-400 text-xs leading-relaxed font-semibold">{selectedModel.description}</p>
</div>
)}
@@ -823,6 +829,7 @@ export default function AudioStudio({
value={params[key] || ""}
onChange={(url) => setParams(prev => ({ ...prev, [key]: url }))}
apiKey={apiKey}
+ copy={copy}
/>
);
}
@@ -836,6 +843,7 @@ export default function AudioStudio({
onChange={(urls) => setParams(prev => ({ ...prev, [key]: urls }))}
apiKey={apiKey}
maxItems={schema.maxItems || 2}
+ copy={copy}
/>
);
}
@@ -883,7 +891,7 @@ export default function AudioStudio({
}}
className="w-full bg-zinc-900 border border-zinc-700 hover:border-zinc-600 rounded px-4 py-3.5 text-xs text-left font-bold text-white flex items-center justify-between transition-all cursor-pointer"
>
- <span>{params[key] || "Select option"}</span>
+ <span>{params[key] || copy.sidebar.selectOption}</span>
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" className={`transition-transform duration-200 ${isOpen ? 'rotate-185' : ''}`}>
<polyline points="6 9 12 15 18 9" />
</svg>
@@ -961,13 +969,13 @@ export default function AudioStudio({
return (
<div key={key} className="space-y-2">
<label className="block text-xs font-bold text-zinc-200 uppercase tracking-wider">
- {schema.title || "Lyrics / Prompt"}
+ {schema.title || copy.sidebar.lyricsPromptLabel}
</label>
<textarea
value={params[key] || ""}
onChange={(e) => setParams(prev => ({ ...prev, [key]: e.target.value }))}
className="w-full bg-zinc-900 border border-zinc-700 focus:border-primary/85 rounded p-3 text-xs text-white placeholder:text-zinc-400 focus:outline-none transition-all min-h-[100px] resize-none leading-relaxed shadow-inner"
- placeholder={schema.description || "Enter what you want generated..."}
+ placeholder={schema.description || copy.sidebar.promptPlaceholder}
/>
{schema.examples && Array.isArray(schema.examples) && (
<div className="flex flex-wrap gap-1.5 mt-2">
@@ -996,7 +1004,7 @@ export default function AudioStudio({
<input
type={isNumber ? "number" : "text"}
value={params[key] !== undefined ? params[key] : ""}
- placeholder={schema.placeholder || schema.description || `Enter ${key}...`}
+ placeholder={schema.placeholder || schema.description || copy.sidebar.fieldPlaceholder.replace('{field}', key)}
onChange={(e) => {
const val = isNumber ? (e.target.value === "" ? "" : parseFloat(e.target.value)) : e.target.value;
setParams(prev => ({ ...prev, [key]: val }));
@@ -1026,14 +1034,14 @@ export default function AudioStudio({
{isGenerating ? (
<>
<div className="w-4 h-4 border-2 border-black/20 border-t-black rounded-full animate-spin" />
- <span>Generating Audio...</span>
+ <span>{copy.generate.generating}</span>
</>
) : (
<>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="3">
<path d="M5 3l14 9-14 9V3z" />
</svg>
- <span>Generate Track</span>
+ <span>{copy.generate.cta}</span>
</>
)}
</button>
@@ -1059,7 +1067,7 @@ export default function AudioStudio({
</div>
<div className="text-center">
<span className="text-xs font-black text-red-500 uppercase tracking-widest block mb-1">
- Generation Error
+ {copy.result.errorHeading}
</span>
<p className="text-white font-medium text-sm leading-relaxed">
{generateError}
@@ -1079,10 +1087,10 @@ export default function AudioStudio({
</div>
<div className="text-center space-y-2">
<div className="text-xs font-black text-primary uppercase tracking-[0.3em] animate-pulse">
- Generating Soundtrack
+ {copy.result.loadingHeading}
</div>
<div className="text-sm text-zinc-200 font-bold">
- Rendering audio waveforms and vocals...
+ {copy.result.loadingSubtext}
</div>
</div>
</div>
@@ -1097,9 +1105,9 @@ export default function AudioStudio({
<MusicIcon className="text-primary w-8 h-8 filter drop-shadow-[0_0_8px_rgba(34,211,238,0.3)]" />
</div>
<div className="relative z-10">
- <h3 className="text-white font-black text-xl mb-3 tracking-tight">Audio Studio</h3>
+ <h3 className="text-white font-black text-xl mb-3 tracking-tight">{copy.result.emptyHeading}</h3>
<p className="text-sm text-zinc-200 font-medium leading-relaxed px-4">
- Choose an AI music model, voice cloner, or sound generator. Modify variables on the left and craft your next high-fidelity track.
+ {copy.result.emptyBody}
</p>
</div>
</div>
@@ -1118,13 +1126,13 @@ export default function AudioStudio({
<line x1="19" y1="12" x2="5" y2="12" />
<polyline points="12 19 5 12 12 5" />
</svg>
- <span>New Generation</span>
+ <span>{copy.result.newGeneration}</span>
</button>
<span className="text-[11px] font-bold text-green-400 px-3.5 py-1.5 bg-green-500/10 border border-green-500/20 rounded-full flex items-center gap-2">
- <div className="w-1.5 h-1.5 bg-green-400 rounded-full animate-pulse" /> Success
+ <div className="w-1.5 h-1.5 bg-green-400 rounded-full animate-pulse" /> {copy.result.success}
</span>
</div>
- <PremiumAudioPlayer url={activeResultUrl} title={activeResultTitle} />
+ <PremiumAudioPlayer url={activeResultUrl} title={activeResultTitle} copy={copy} />
</div>
)}
@@ -1134,7 +1142,7 @@ export default function AudioStudio({
{history.length > 0 && (
<div className="border-t border-zinc-900 pt-6 w-full animate-fade-in-up">
<h4 className="text-xs font-bold text-zinc-300 uppercase tracking-wider mb-4 px-1">
- Generation History ({history.length})
+ {copy.history.heading.replace('{count}', history.length)}
</h4>
<div className="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-4">
{history.map((entry, idx) => (
@@ -1156,11 +1164,11 @@ export default function AudioStudio({
</svg>
</div>
<span className="text-[10px] font-bold text-primary uppercase tracking-wider truncate">
- {entry.model ? entry.model.split('-').slice(0, 2).join(' ') : 'Audio'}
+ {entry.model ? entry.model.split('-').slice(0, 2).join(' ') : copy.history.fallbackModel}
</span>
</div>
<p className="text-[11px] font-semibold text-white line-clamp-2 leading-tight">
- {entry.title || entry.prompt || "Untitled Audio"}
+ {entry.title || entry.prompt || copy.history.untitled}
</p>
</div>
))}
diff --git a/packages/studio/src/components/CinemaStudio.jsx b/packages/studio/src/components/CinemaStudio.jsx
index b73c724e..df95cd71 100644
--- a/packages/studio/src/components/CinemaStudio.jsx
+++ b/packages/studio/src/components/CinemaStudio.jsx
@@ -21,6 +21,9 @@ import {
promptControlClassName,
promptMediaButtonClassName,
} from "./prompt/PromptComposer.jsx";
+import en from "../messages/en/cinemaStudio.json";
+import zh from "../messages/zh/cinemaStudio.json";
+import { resolveCopy } from "../i18nUtils";
// ─── Constants (inlined from promptUtils) ───────────────────────────────────
@@ -397,6 +400,7 @@ function CameraControlsOverlay({
onClose,
settings,
onSettingsChange,
+ copy,
}) {
const backdropRef = useRef(null);
@@ -451,27 +455,26 @@ function CameraControlsOverlay({
<path d="M14.5 4H9.5L8 6H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-3Z" />
<circle cx="12" cy="12.5" r="3.5" />
</svg>
- Cinema Studio
+ {copy.cameraOverlay.eyebrow}
</div>
<h2
id="camera-config-title"
className="text-xl font-semibold tracking-tight text-white md:text-2xl"
>
- Camera settings
+ {copy.cameraOverlay.title}
</h2>
<p
id="camera-config-description"
className="mt-1.5 max-w-2xl text-xs leading-relaxed text-white/45 md:text-sm"
>
- Build a consistent cinematic look by choosing the camera, lens,
- focal length, and depth of field.
+ {copy.cameraOverlay.description}
</p>
</div>
<button
type="button"
onClick={onClose}
- aria-label="Close camera settings"
- title="Close"
+ aria-label={copy.cameraOverlay.closeAria}
+ title={copy.cameraOverlay.close}
className="ml-4 flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-white/[0.06] bg-white/[0.03] text-white/40 transition-all hover:border-white/15 hover:bg-white/[0.07] hover:text-white"
>
<svg
@@ -490,28 +493,28 @@ function CameraControlsOverlay({
<div className="overflow-x-auto px-5 py-6 no-scrollbar md:px-7 md:py-7">
<div className="mx-auto flex w-max min-w-full justify-start gap-3 sm:justify-center md:gap-5">
<ScrollColumn
- title="Camera"
+ title={copy.cameraOverlay.columns.camera}
items={CAMERAS}
columnKey="camera"
value={settings.camera}
onChange={updateSetting("camera")}
/>
<ScrollColumn
- title="Lens"
+ title={copy.cameraOverlay.columns.lens}
items={LENSES}
columnKey="lens"
value={settings.lens}
onChange={updateSetting("lens")}
/>
<ScrollColumn
- title="Focal length"
+ title={copy.cameraOverlay.columns.focalLength}
items={FOCAL_LENGTHS}
columnKey="focal"
value={settings.focal}
onChange={updateSetting("focal")}
/>
<ScrollColumn
- title="Aperture"
+ title={copy.cameraOverlay.columns.aperture}
items={APERTURES}
columnKey="aperture"
value={settings.aperture}
@@ -533,7 +536,9 @@ export default function CinemaStudio({
onGenerationComplete,
onGenerationError,
historyItems,
+ locale = "en",
}) {
+ const copy = resolveCopy(en, zh, locale);
const LEGACY_PERSIST_KEY = "hg_cinema_studio_persistent";
const PERSIST_KEY = scopedPersistKey(LEGACY_PERSIST_KEY, apiKey);
useEffect(() => {
@@ -870,7 +875,7 @@ export default function CinemaStudio({
>
<img
src={entry.url}
- alt={`History item ${idx + 1}`}
+ alt={copy.card.historyItemAlt.replace("{index}", idx + 1)}
className="w-full aspect-[4/3] object-cover bg-black/40"
/>
@@ -878,8 +883,8 @@ export default function CinemaStudio({
<div className="absolute top-2 right-2 hidden md:flex flex-col gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
<button
type="button"
- title={copiedPromptIndex === idx ? "Prompt copied" : "Copy prompt"}
- aria-label={copiedPromptIndex === idx ? "Prompt copied" : "Copy prompt"}
+ title={copiedPromptIndex === idx ? copy.actions.promptCopied : copy.actions.copyPrompt}
+ aria-label={copiedPromptIndex === idx ? copy.actions.promptCopied : copy.actions.copyPrompt}
onClick={(event) => {
event.stopPropagation();
handleCopyPrompt(entry.settings?.prompt, idx);
@@ -898,8 +903,8 @@ export default function CinemaStudio({
</button>
<button
type="button"
- title={copiedImageIndex === idx ? "Image copied" : "Copy image"}
- aria-label={copiedImageIndex === idx ? "Image copied" : "Copy image"}
+ title={copiedImageIndex === idx ? copy.actions.imageCopied : copy.actions.copyImage}
+ aria-label={copiedImageIndex === idx ? copy.actions.imageCopied : copy.actions.copyImage}
onClick={(event) => {
event.stopPropagation();
handleCopyImage(entry.url, idx);
@@ -918,7 +923,7 @@ export default function CinemaStudio({
</button>
<button
type="button"
- title="Download"
+ title={copy.actions.download}
onClick={async (e) => {
e.stopPropagation();
try {
@@ -944,10 +949,10 @@ export default function CinemaStudio({
</button>
<button
type="button"
- title="Delete"
+ title={copy.actions.delete}
onClick={(e) => {
e.stopPropagation();
- if (confirm("Are you sure you want to delete this generated item?")) {
+ if (confirm(copy.actions.deleteConfirm)) {
setInternalHistory(prev => prev.filter((_, i) => i !== idx));
}
}}
@@ -965,18 +970,18 @@ export default function CinemaStudio({
actions={[
{
kind: "text",
- label: "Copy prompt",
+ label: copy.actions.copyPrompt,
onSelect: () =>
handleCopyPrompt(entry.settings?.prompt, idx),
},
{
kind: "image",
- label: "Copy image",
+ label: copy.actions.copyImage,
onSelect: () => handleCopyImage(entry.url, idx),
},
{
kind: "download",
- label: "Download",
+ label: copy.actions.download,
onSelect: async () => {
try {
const response = await fetch(entry.url);
@@ -996,10 +1001,10 @@ export default function CinemaStudio({
},
{
kind: "delete",
- label: "Delete",
+ label: copy.actions.delete,
danger: true,
onSelect: () => {
- if (confirm("Are you sure you want to delete this generated item?")) {
+ if (confirm(copy.actions.deleteConfirm)) {
setInternalHistory((prev) => prev.filter((_, i) => i !== idx));
}
},
@@ -1011,21 +1016,21 @@ export default function CinemaStudio({
<div className="p-3 bg-black/80 backdrop-blur-sm border-t border-white/5 flex-1 flex flex-col justify-between gap-2">
<p
className="w-full text-left text-xs line-clamp-3 leading-relaxed text-white/70"
- title={entry.settings?.prompt || "No prompt"}
+ title={entry.settings?.prompt || copy.card.noPrompt}
>
- {entry.settings?.prompt || "No prompt"}
+ {entry.settings?.prompt || copy.card.noPrompt}
</p>
<span className="sr-only" aria-live="polite">
{copiedPromptIndex === idx
- ? "Prompt copied"
+ ? copy.actions.promptCopied
: copiedImageIndex === idx
- ? "Image copied"
+ ? copy.actions.imageCopied
: ""}
</span>
<div className="flex items-center mt-1 flex-wrap gap-1">
<div className="flex items-center gap-2">
<span className="text-[10px] font-bold text-[#22d3ee] px-2 py-0.5 bg-[#22d3ee]/10 rounded border border-[#22d3ee]/20">
- Cinema Studio
+ {copy.card.badge}
</span>
{entry.settings?.camera && (
<span className="text-[10px] text-white/40">{entry.settings.camera}</span>
@@ -1071,13 +1076,13 @@ export default function CinemaStudio({
</div>
<h1 className="text-2xl sm:text-4xl md:text-5xl font-extrabold tracking-tight mb-4 text-center px-4 flex flex-col items-center">
- <span className="text-white font-black uppercase text-xl sm:text-3xl tracking-wide mb-1 opacity-90">START CREATING WITH</span>
+ <span className="text-white font-black uppercase text-xl sm:text-3xl tracking-wide mb-1 opacity-90">{copy.empty.kicker}</span>
<span className="text-[#22d3ee] font-black uppercase text-2xl sm:text-4xl sm:mt-1 tracking-tight">
- CINEMA STUDIO
+ {copy.empty.title}
</span>
</h1>
<p className="text-white/40 text-xs sm:text-sm font-medium tracking-wide text-center max-w-lg leading-relaxed px-4">
- What would you shoot with infinite budget? Control cameras, lighting, lenses, and prompt high-end cinematic scenes.
+ {copy.empty.description}
</p>
</div>
)}
@@ -1149,7 +1154,7 @@ export default function CinemaStudio({
<div className="relative w-full h-full group">
<img
src={uploadedImage}
- alt="Reference"
+ alt={copy.referenceImage.alt}
className="w-full h-full object-cover opacity-80 group-hover:opacity-40 transition-opacity"
/>
<div className="absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity">
@@ -1174,7 +1179,7 @@ export default function CinemaStudio({
onChange={(e) =>
setSettings((prev) => ({ ...prev, prompt: e.target.value }))
}
- placeholder="Describe your cinema scene..."
+ placeholder={copy.prompt.placeholder}
/>
</div>
@@ -1198,7 +1203,7 @@ export default function CinemaStudio({
</button>
{openDropdown === "ar" && (
<Dropdown
- title="Aspect Ratio"
+ title={copy.dropdowns.aspectRatio}
items={ASPECT_RATIOS}
selected={settings.aspect_ratio}
onSelect={(val) =>
@@ -1227,7 +1232,7 @@ export default function CinemaStudio({
</button>
{openDropdown === "res" && (
<Dropdown
- title="Resolution"
+ title={copy.dropdowns.resolution}
items={RESOLUTIONS}
selected={resolution}
onSelect={setResolution}
@@ -1259,11 +1264,11 @@ export default function CinemaStudio({
{isGenerating ? (
<>
<span className="animate-spin inline-block text-black">◌</span>
- <span>Generating...</span>
+ <span>{copy.prompt.generating}</span>
</>
) : (
<>
- <span>Shoot ✦ 10</span>
+ <span>{copy.prompt.generate} ✦ 10</span>
</>
)}
</PromptAction>
@@ -1287,9 +1292,9 @@ export default function CinemaStudio({
<line x1="6" y1="6" x2="18" y2="18" />
</svg>
</button>
- <img
- src={fullscreenUrl}
- alt="Fullscreen Preview"
+ <img
+ src={fullscreenUrl}
+ alt={copy.fullscreen.alt}
className="max-w-[95vw] max-h-[95vh] rounded-2xl shadow-2xl object-contain animate-scale-up"
onClick={(e) => e.stopPropagation()}
/>
@@ -1301,6 +1306,7 @@ export default function CinemaStudio({
onClose={() => setIsOverlayOpen(false)}
settings={settings}
onSettingsChange={setSettings}
+ copy={copy}
/>
</div>
);
diff --git a/packages/studio/src/components/ClippingStudio.jsx b/packages/studio/src/components/ClippingStudio.jsx
index 7c54ad3f..8b1ee678 100644
--- a/packages/studio/src/components/ClippingStudio.jsx
+++ b/packages/studio/src/components/ClippingStudio.jsx
@@ -25,12 +25,13 @@ import {
promptControlClassName,
promptMediaButtonClassName,
} from "./prompt/PromptComposer.jsx";
+import en from "../messages/en/clippingStudio.json";
+import zh from "../messages/zh/clippingStudio.json";
+import { resolveCopy } from "../i18nUtils";
const MAX_VIDEO_SIZE_MB = 100;
const MAX_VIDEO_SIZE_BYTES = MAX_VIDEO_SIZE_MB * 1024 * 1024;
const CLIPPING_TOASTER_ID = "clipping-studio";
-const VIDEO_TOO_LARGE_FOR_MODE_MESSAGE =
- "The file is too large for this mode. Compress or trim the video, then upload a smaller file.";
const MAX_VISIBLE_ERROR_TOASTS = 3;
const ERROR_TOAST_DURATION_MS = 7000;
const activeErrorToastIds = [];
@@ -92,7 +93,7 @@ const CopyIcon = () => (
</svg>
);
-const ErrorToast = ({ toastInstance, message }) => (
+const ErrorToast = ({ toastInstance, message, dismissLabel = "Dismiss notification" }) => (
<div
className={`pointer-events-auto flex w-[340px] max-w-[calc(100vw-32px)] items-start gap-3 rounded-xl border border-red-400/40 bg-white px-3.5 py-3 text-[13px] text-zinc-900 shadow-[0_10px_30px_rgba(0,0,0,0.15)] transition-all duration-200 ${
toastInstance.visible ? "translate-y-0 opacity-100" : "translate-y-2 opacity-0"
@@ -121,7 +122,7 @@ const ErrorToast = ({ toastInstance, message }) => (
type="button"
onClick={() => dismissErrorToast(toastInstance.id)}
className="mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-zinc-400 transition-colors hover:bg-zinc-100 hover:text-zinc-700 focus:outline-none focus:ring-1 focus:ring-zinc-300"
- aria-label="Dismiss notification"
+ aria-label={dismissLabel}
>
<svg
width="14"
@@ -139,7 +140,7 @@ const ErrorToast = ({ toastInstance, message }) => (
</div>
);
-const showErrorToast = (message) => {
+const showErrorToast = (message, copy = en) => {
const options = {
duration: ERROR_TOAST_DURATION_MS,
position: "bottom-right",
@@ -156,6 +157,7 @@ const showErrorToast = (message) => {
<ErrorToast
toastInstance={toastInstance}
message={message}
+ dismissLabel={copy.errors.dismissNotification}
/>
),
options,
@@ -168,8 +170,8 @@ const showErrorToast = (message) => {
);
};
-const showVideoSizeLimitToast = () => {
- showErrorToast(`Video exceeds ${MAX_VIDEO_SIZE_MB}MB limit.`);
+const showVideoSizeLimitToast = (copy = en) => {
+ showErrorToast(copy.errors.videoExceedsLimit.replace("{mb}", MAX_VIDEO_SIZE_MB), copy);
};
const isFileSizeError = (error) => {
@@ -177,17 +179,17 @@ const isFileSizeError = (error) => {
return /(?:\b413\b|payload too large|request entity too large|file(?: size)? (?:is )?too large|file is too heavy|exceeds?.*(?:size|limit)|слишком (?:больш|тяж)|превышает.*(?:размер|лимит))/i.test(message);
};
-const showVideoUploadError = (error) => {
+const showVideoUploadError = (error, copy = en) => {
if (isFileSizeError(error)) {
- showErrorToast(VIDEO_TOO_LARGE_FOR_MODE_MESSAGE);
+ showErrorToast(copy.errors.videoTooLarge, copy);
return;
}
const message = formatErrorMessage(
error,
- "Video upload failed. Please try again.",
+ copy.errors.uploadFailed,
);
- showErrorToast(message);
+ showErrorToast(message, copy);
};
const getAspectClass = (ar) => {
@@ -214,7 +216,9 @@ export default function ClippingStudio({
onGenerationError,
droppedFiles,
onFilesHandled,
+ locale = "en",
}) {
+ const copy = resolveCopy(en, zh, locale);
const LEGACY_PERSIST_KEY = "hg_clipping_studio_persistent";
const PERSIST_KEY = scopedPersistKey(LEGACY_PERSIST_KEY, apiKey);
useEffect(() => {
@@ -257,12 +261,12 @@ export default function ClippingStudio({
const [history, setHistory] = useState([]);
const ASPECT_RATIOS = [
- { label: "9:16 (TikTok / Reels / Shorts)", value: "9:16" },
- { label: "16:9 (YouTube / TV)", value: "16:9" },
- { label: "1:1 (Instagram Square)", value: "1:1" },
- { label: "4:5 (Instagram Portrait)", value: "4:5" },
- { label: "4:3 (Classic Video)", value: "4:3" },
- { label: "3:4 (Portrait)", value: "3:4" },
+ { label: copy.aspectRatioLabels["9:16"], value: "9:16" },
+ { label: copy.aspectRatioLabels["16:9"], value: "16:9" },
+ { label: copy.aspectRatioLabels["1:1"], value: "1:1" },
+ { label: copy.aspectRatioLabels["4:5"], value: "4:5" },
+ { label: copy.aspectRatioLabels["4:3"], value: "4:3" },
+ { label: copy.aspectRatioLabels["3:4"], value: "3:4" },
];
// Close dropdown when clicking outside
@@ -341,7 +345,7 @@ export default function ClippingStudio({
if (videoFiles.length > 0) {
const file = videoFiles[0];
if (file.size > MAX_VIDEO_SIZE_BYTES) {
- showVideoSizeLimitToast();
+ showVideoSizeLimitToast(copy);
onFilesHandled?.();
return;
}
@@ -356,7 +360,7 @@ export default function ClippingStudio({
})
.catch(err => {
setVideoUploading(false);
- showVideoUploadError(err);
+ showVideoUploadError(err, copy);
});
}
onFilesHandled?.();
@@ -383,7 +387,7 @@ export default function ClippingStudio({
// ── Copy Link & Download Helpers ─────────────────────────────────────────
const copyToClipboard = (text) => {
navigator.clipboard.writeText(text);
- alert("URL copied to clipboard!");
+ alert(copy.alerts.urlCopied);
};
const downloadVideo = async (url, title = "clipped_video") => {
@@ -418,7 +422,7 @@ export default function ClippingStudio({
const file = files && files[0];
if (!file) return;
if (file.size > MAX_VIDEO_SIZE_BYTES) {
- showVideoSizeLimitToast();
+ showVideoSizeLimitToast(copy);
if (videoFileInputRef.current) videoFileInputRef.current.value = "";
return;
}
@@ -431,7 +435,7 @@ export default function ClippingStudio({
setVideoUrl(url);
} catch (err) {
console.error("[ClippingStudio] Video upload failed:", err);
- showVideoUploadError(err);
+ showVideoUploadError(err, copy);
} finally {
setVideoUploading(false);
setVideoProgress(0);
@@ -488,7 +492,7 @@ export default function ClippingStudio({
// ── Dispatch Run / Call submitAndPoll ────────────────────────────────────
const handleGenerate = async () => {
if (!videoUrl) {
- alert("Please upload a video or paste a video URL first.");
+ alert(copy.alerts.needVideo);
return;
}
@@ -548,12 +552,12 @@ export default function ClippingStudio({
}
} catch (err) {
console.error("[ClippingStudio] Error generating clips:", err);
- const errMsg = formatErrorMessage(err, "Failed to process AI clipping.");
+ const errMsg = formatErrorMessage(err, copy.errors.generationFailed);
const notificationMessage = isFileSizeError(err)
- ? VIDEO_TOO_LARGE_FOR_MODE_MESSAGE
+ ? copy.errors.videoTooLarge
: errMsg;
if (onGenerationError) onGenerationError(notificationMessage);
- else showErrorToast(notificationMessage);
+ else showErrorToast(notificationMessage, copy);
} finally {
setIsGenerating(false);
onGenerationEnd?.();
@@ -618,13 +622,13 @@ export default function ClippingStudio({
</div>
<h1 className="text-2xl sm:text-4xl md:text-5xl font-extrabold tracking-tight mb-4 text-center px-4 flex flex-col items-center">
- <span className="text-white font-black uppercase text-xl sm:text-3xl tracking-wide mb-1 opacity-90">START CREATING WITH</span>
+ <span className="text-white font-black uppercase text-xl sm:text-3xl tracking-wide mb-1 opacity-90">{copy.headings.startCreatingWith}</span>
<span className="text-[#22d3ee] font-black uppercase text-2xl sm:text-4xl sm:mt-1 tracking-tight">
- AI CLIPPING STUDIO
+ {copy.headings.aiClippingStudio}
</span>
</h1>
<p className="text-white/40 text-xs sm:text-sm font-medium tracking-wide text-center max-w-lg leading-relaxed px-4">
- Extract viral highlights and precise timings from your videos automatically.
+ {copy.headings.emptyStateSubtitle}
</p>
</div>
)}
@@ -635,10 +639,10 @@ export default function ClippingStudio({
<div className="flex items-center justify-between border-b border-white/5 pb-4">
<h2 className="text-sm font-black text-white uppercase tracking-widest flex items-center gap-2">
<ScissorsIcon className="text-primary w-4 h-4" />
- Clipping History Runs
+ {copy.headings.clippingHistoryRuns}
</h2>
<span className="text-xs font-bold text-zinc-400 bg-white/5 border border-white/5 px-2.5 py-1 rounded">
- {history.length} Saved Generations
+ {copy.headings.savedGenerations.replace('{count}', history.length)}
</span>
</div>
@@ -668,7 +672,7 @@ export default function ClippingStudio({
<div className="absolute top-2 right-2 z-10 hidden md:flex flex-col gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
<button
type="button"
- title="Delete from history"
+ title={copy.buttons.deleteFromHistory}
onClick={(e) => {
e.stopPropagation();
setHistory((prev) => prev.filter((h) => h.id !== entry.id));
@@ -682,7 +686,7 @@ export default function ClippingStudio({
actions={[
{
kind: "delete",
- label: "Delete",
+ label: copy.buttons.delete,
danger: true,
onSelect: () =>
setHistory((prev) =>
@@ -695,10 +699,10 @@ export default function ClippingStudio({
<div className="p-3 bg-black/80 backdrop-blur-sm border-t border-white/5 flex-1 flex flex-col justify-between gap-2">
<div className="flex flex-col gap-1">
<h4 className="text-xs font-bold text-white truncate" title={entry.videoUrl.split('/').pop()}>
- {entry.videoUrl.split('/').pop() || "source_video.mp4"}
+ {entry.videoUrl.split('/').pop() || copy.sourceVideoFallback}
</h4>
<p className="text-[9px] text-zinc-500 font-semibold uppercase tracking-wider">
- {entry.returnCoordinatesOnly ? "Timeline Seek Mode" : "Clips Gallery Mode"}
+ {entry.returnCoordinatesOnly ? copy.modes.timelineSeek : copy.modes.clipsGallery}
</p>
</div>
<div className="flex items-center justify-between mt-1">
@@ -706,7 +710,7 @@ export default function ClippingStudio({
{entry.aspectRatio}
</span>
<span className="text-[10px] text-white/40">
- {entry.returnCoordinatesOnly ? `${entry.coordinates?.length || 0} Highlights` : `${entry.clips?.length || 0} Clips`}
+ {entry.returnCoordinatesOnly ? copy.labels.highlights.replace('{count}', entry.coordinates?.length || 0) : copy.labels.clips.replace('{count}', entry.clips?.length || 0)}
</span>
</div>
</div>
@@ -730,11 +734,11 @@ export default function ClippingStudio({
<line x1="19" y1="12" x2="5" y2="12" />
<polyline points="12 19 5 12 12 5" />
</svg>
- Back to History
+ {copy.headings.backToHistory}
</button>
<div className="flex items-center gap-2">
<span className="text-[10px] font-bold text-primary bg-primary/10 border border-primary/20 px-2.5 py-0.5 rounded">
- {result.returnCoordinatesOnly ? "Timeline Seek Mode" : "Clips Gallery Mode"}
+ {result.returnCoordinatesOnly ? copy.modes.timelineSeek : copy.modes.clipsGallery}
</span>
<span className="text-[10px] text-zinc-400 bg-white/5 border border-white/5 px-2.5 py-0.5 rounded">
{result.aspectRatio}
@@ -748,7 +752,7 @@ export default function ClippingStudio({
{/* Left Side: Original Player */}
<div className="flex-1 bg-black border border-zinc-900 rounded-lg overflow-hidden flex flex-col shadow-2xl relative min-h-[300px] lg:min-h-0">
<div className="absolute top-4 left-4 bg-black/60 backdrop-blur-md px-3 py-1.5 rounded-md border border-white/5 z-10 text-[10px] uppercase font-bold tracking-wider text-primary">
- Original Video Player
+ {copy.headings.originalVideoPlayer}
</div>
<video
ref={mainVideoRef}
@@ -763,10 +767,10 @@ export default function ClippingStudio({
<div className="w-full lg:w-[350px] border border-zinc-900 bg-zinc-950/40 backdrop-blur-md rounded-lg p-5 flex flex-col min-h-[350px] lg:min-h-0">
<div className="pb-4 border-b border-zinc-900 flex items-center justify-between">
<h3 className="text-xs font-black text-white uppercase tracking-widest">
- Highlights Timeline
+ {copy.headings.highlightsTimeline}
</h3>
<span className="text-[10px] font-bold text-zinc-400 bg-zinc-900 px-2 py-0.5 rounded border border-zinc-800">
- {result.coordinates?.length || 0} Matches
+ {copy.headings.matches.replace('{count}', result.coordinates?.length || 0)}
</span>
</div>
@@ -793,11 +797,11 @@ export default function ClippingStudio({
>
<div className="flex items-center justify-between w-full">
<span className={`text-xs font-bold transition-colors ${isActive ? "text-primary" : "text-white"}`}>
- {hl.label || `Highlight #${i + 1}`}
+ {hl.label || copy.labels.highlightFallback.replace('{index}', i + 1)}
</span>
{hl.score && (
<span className="text-[9px] font-black text-emerald-400 bg-emerald-400/10 px-1.5 py-0.5 rounded border border-emerald-400/20">
- {(hl.score * 100).toFixed(0)}% Score
+ {(hl.score * 100).toFixed(0)}{copy.labels.scoreSuffix}
</span>
)}
</div>
@@ -805,18 +809,18 @@ export default function ClippingStudio({
<ClockIcon />
<span>{formatSeconds(start)} - {formatSeconds(end)}</span>
<span className="text-zinc-650">•</span>
- <span className="text-primary/80 font-bold">{(end - start).toFixed(0)}s duration</span>
+ <span className="text-primary/80 font-bold">{(end - start).toFixed(0)}{copy.labels.durationSuffix}</span>
</div>
<div className="flex items-center gap-1.5 text-[10px] font-bold text-primary mt-1 opacity-0 group-hover/hl:opacity-100 transition-opacity">
- <PlayIcon /> Seek & Play
+ <PlayIcon /> {copy.labels.seekAndPlay}
</div>
</button>
);
})
) : (
<div className="text-center py-8 text-xs text-zinc-500 font-semibold">
- No highlights extracted.
+ {copy.empty.noHighlights}
</div>
)}
</div>
@@ -827,10 +831,10 @@ export default function ClippingStudio({
<div className="space-y-5">
<div className="flex items-center justify-between border-b border-zinc-900 pb-3.5">
<h3 className="text-xs font-black text-white uppercase tracking-widest">
- Extracted Video Clips
+ {copy.headings.extractedVideoClips}
</h3>
<span className="text-[10px] font-bold text-zinc-400 bg-zinc-900 px-2.5 py-1 rounded border border-zinc-800">
- Aspect Ratio: {result.aspectRatio}
+ {copy.headings.aspectRatioLabel.replace('{ratio}', result.aspectRatio)}
</span>
</div>
@@ -865,7 +869,7 @@ export default function ClippingStudio({
/>
<button
type="button"
- title="Copy Link"
+ title={copy.buttons.copyLink}
onClick={(e) => {
e.stopPropagation();
copyToClipboard(clipUrl);
@@ -876,7 +880,7 @@ export default function ClippingStudio({
</button>
<button
type="button"
- title="Download"
+ title={copy.buttons.download}
onClick={(e) => {
e.stopPropagation();
downloadVideo(clipUrl, `clip-${i + 1}.mp4`);
@@ -892,12 +896,12 @@ export default function ClippingStudio({
actions={[
{
kind: "copy",
- label: "Copy link",
+ label: copy.buttons.copyLinkShort,
onSelect: () => copyToClipboard(clipUrl),
},
{
kind: "download",
- label: "Download",
+ label: copy.buttons.download,
onSelect: () =>
downloadVideo(clipUrl, `clip-${i + 1}.mp4`),
},
@@ -905,7 +909,7 @@ export default function ClippingStudio({
/>
<div className="absolute top-2 left-2 bg-black/60 backdrop-blur-md px-2 py-1 rounded border border-white/5 text-[9px] uppercase font-black tracking-wider text-primary">
- Clip #{i + 1}
+ {copy.labels.clipIndex.replace('{index}', i + 1)}
</div>
</div>
@@ -918,9 +922,9 @@ export default function ClippingStudio({
<div className="flex items-center justify-between mt-1">
<div className="flex items-center gap-2">
<span className="text-[10px] font-bold text-primary px-2 py-0.5 bg-primary/10 rounded border border-primary/20 whitespace-nowrap">
- AI Clipping
+ {copy.labels.aiClipping}
</span>
- <span className="text-[10px] text-white/40">{result.aspectRatio || `Clip #${i + 1}`}</span>
+ <span className="text-[10px] text-white/40">{result.aspectRatio || copy.labels.clipIndex.replace('{index}', i + 1)}</span>
</div>
</div>
</div>
@@ -929,7 +933,7 @@ export default function ClippingStudio({
</div>
) : (
<div className="py-20 text-center text-xs text-zinc-500 font-semibold border border-zinc-900 rounded bg-zinc-950/20">
- No video clips generated. Try re-running.
+ {copy.empty.noClips}
</div>
)}
</div>
@@ -951,7 +955,7 @@ export default function ClippingStudio({
type="button"
onClick={clearVideoUpload}
className="absolute top-0.5 right-0.5 w-4 h-4 bg-black/60 hover:bg-black rounded-full flex items-center justify-center text-white/85 hover:text-white text-[8px] border border-white/5"
- title="Clear video"
+ title={copy.buttons.clearVideo}
>
×
</button>
@@ -974,7 +978,7 @@ export default function ClippingStudio({
{!videoUrl && (
<button
type="button"
- title="Upload source video"
+ title={copy.buttons.uploadSourceVideo}
onClick={() => videoFileInputRef.current?.click()}
onDragEnter={handleVideoDragEnter}
onDragLeave={handleVideoDragLeave}
@@ -1018,7 +1022,7 @@ export default function ClippingStudio({
<PromptTextarea
value={prompt}
onChange={handlePromptInput}
- placeholder="Describe prompt / highlights to extract"
+ placeholder={copy.placeholders.promptOrUrl}
/>
</div>
</div>
@@ -1033,7 +1037,7 @@ export default function ClippingStudio({
<span className="text-[9px] font-bold text-black uppercase">C</span>
</div>
<span className={PROMPT_CONTROL_LABEL_CLASS}>
- AI Clipping
+ {copy.labels.aiClipping}
</span>
</div>
@@ -1054,7 +1058,7 @@ export default function ClippingStudio({
{aspectDropdownOpen && (
<PromptPopover>
<PromptPopoverHeader>
- Aspect Ratio
+ {copy.popovers.aspectRatio}
</PromptPopoverHeader>
<PromptMenuList>
{ASPECT_RATIOS.map((r) => (
@@ -1085,17 +1089,17 @@ export default function ClippingStudio({
>
<PromptDurationIcon />
<span className={PROMPT_CONTROL_LABEL_CLASS}>
- {numHighlights} Highlights
+ {copy.labels.highlights.replace('{count}', numHighlights)}
</span>
</button>
{highlightsDropdownOpen && (
<PromptPopover className="min-w-[180px] overflow-visible">
<PromptPopoverHeader className="mb-3">
- Max Highlights
+ {copy.popovers.maxHighlights}
</PromptPopoverHeader>
<div className="space-y-3">
<div className="flex items-center justify-between">
- <span className="text-xs text-white/60">Limit:</span>
+ <span className="text-xs text-white/60">{copy.popovers.limit}</span>
<span className="text-xs font-black text-primary bg-primary/10 px-2.5 py-0.5 rounded">
{numHighlights}
</span>
@@ -1127,7 +1131,7 @@ export default function ClippingStudio({
>
<ScissorsIcon className="w-4 h-4 text-current" />
<span className="text-xs font-semibold">
- Coordinates Only
+ {copy.buttons.coordinatesOnly}
</span>
</button>
@@ -1141,11 +1145,11 @@ export default function ClippingStudio({
{isGenerating ? (
<>
<span className="animate-spin inline-block text-black">◌</span>
- <span>Generating...</span>
+ <span>{copy.buttons.generating}</span>
</>
) : (
<>
- <span>Generate ✦ 5</span>
+ <span>{copy.buttons.generate}</span>
</>
)}
</PromptAction>
diff --git a/packages/studio/src/components/ImageStudio.jsx b/packages/studio/src/components/ImageStudio.jsx
index b02d2aaf..71f53b65 100644
--- a/packages/studio/src/components/ImageStudio.jsx
+++ b/packages/studio/src/components/ImageStudio.jsx
@@ -57,6 +57,9 @@ import {
promptControlClassName,
promptMediaButtonClassName,
} from "./prompt/PromptComposer.jsx";
+import en from "../messages/en/imageStudio.json";
+import zh from "../messages/zh/imageStudio.json";
+import { resolveCopy } from "../i18nUtils";
// ─── helpers ────────────────────────────────────────────────────────────────
@@ -79,7 +82,8 @@ async function downloadImage(url, filename) {
// ─── UploadButton (inline picker) ───────────────────────────────────────────
-function UploadButton({ apiKey, maxImages, onSelect, onClear, initialUrls = [], label = null, persistedHistory = null, onHistoryChange = null }) {
+function UploadButton({ apiKey, maxImages, onSelect, onClear, initialUrls = [], label = null, persistedHistory = null, onHistoryChange = null, copy }) {
+ const t = copy.uploadButton;
const [panelOpen, setPanelOpen] = useState(false);
const [uploading, setUploading] = useState(false);
const [selectedEntries, setSelectedEntries] = useState([]); // [{url, thumbnail}]
@@ -191,7 +195,7 @@ function UploadButton({ apiKey, maxImages, onSelect, onClear, initialUrls = [],
const tooLarge = files.filter((f) => f.size > MAX_IMAGE_SIZE);
if (tooLarge.length > 0) {
alert(
- `The following images are too large (max 10MB): ${tooLarge.map((f) => f.name).join(", ")}`,
+ t.tooLargeAlert.replace("{names}", tooLarge.map((f) => f.name).join(", ")),
);
return;
}
@@ -247,7 +251,7 @@ function UploadButton({ apiKey, maxImages, onSelect, onClear, initialUrls = [],
}),
);
} catch (err) {
- alert(`Image upload failed: ${err.message}`);
+ alert(t.uploadFailedAlert.replace("{message}", err.message));
} finally {
setUploading(false);
setLastUploadProgress(0);
@@ -377,11 +381,11 @@ function UploadButton({ apiKey, maxImages, onSelect, onClear, initialUrls = [],
{lastUploadProgress}%
</span>
</div>
- ) : label === "Swap Face" ? (
+ ) : label === copy.promptBar.swapFaceLabel ? (
hasSelection ? (
<img src={selectedEntries[0].url} alt="" className="w-full h-full object-cover" />
) : (
- <span className="text-[10px] font-bold text-white/50">Face</span>
+ <span className="text-[10px] font-bold text-white/50">{t.faceLabel}</span>
)
) : (
<svg
@@ -398,13 +402,13 @@ function UploadButton({ apiKey, maxImages, onSelect, onClear, initialUrls = [],
</svg>
);
- const defaultLabel = isMulti ? `Add up to ${maxImages} images` : "Reference image";
+ const defaultLabel = isMulti ? t.addUpToImages.replace("{max}", maxImages) : t.referenceImageLabel;
const triggerTitle = hasSelection
? count > 1
- ? `${count} of ${maxImages} images selected — click to manage`
+ ? t.multiSelectedTitle.replace("{count}", count).replace("{max}", maxImages)
: isMulti
- ? `1 image selected — click to add more (up to ${maxImages})`
- : label || "Reference image"
+ ? t.singleSelectedTitle.replace("{max}", maxImages)
+ : label || t.referenceImageLabel
: label || defaultLabel;
return (
@@ -450,11 +454,11 @@ function UploadButton({ apiKey, maxImages, onSelect, onClear, initialUrls = [],
<div className="flex items-center justify-between px-1 pb-3 mb-2 border-b border-white/5">
<div className="flex flex-col gap-0.5">
<span className="text-xs font-bold text-secondary">
- Reference Images
+ {t.headerTitle}
</span>
{isMulti && (
<span className="text-[9px] text-muted">
- Select up to {maxImages} images
+ {t.selectUpTo.replace("{max}", maxImages)}
</span>
)}
</div>
@@ -465,7 +469,7 @@ function UploadButton({ apiKey, maxImages, onSelect, onClear, initialUrls = [],
onClick={handleDone}
className="flex items-center gap-1 px-3 py-1.5 bg-primary text-black rounded-xl text-xs font-black transition-all hover:scale-105"
>
- ✓ Done ({count})
+ {t.doneButton.replace("{count}", count)}
</button>
)}
<button
@@ -489,7 +493,7 @@ function UploadButton({ apiKey, maxImages, onSelect, onClear, initialUrls = [],
<polyline points="17 8 12 3 7 8" />
<line x1="12" y1="3" x2="12" y2="15" />
</svg>
- {isMulti ? "Upload files" : "Upload new"}
+ {isMulti ? t.uploadFilesButton : t.uploadNewButton}
</button>
</div>
</div>
@@ -510,7 +514,7 @@ function UploadButton({ apiKey, maxImages, onSelect, onClear, initialUrls = [],
<polyline points="17 8 12 3 7 8" />
<line x1="12" y1="3" x2="12" y2="15" />
</svg>
- <span className="text-xs text-secondary">No uploads yet</span>
+ <span className="text-xs text-secondary">{t.emptyState}</span>
</div>
) : (
<div className="grid grid-cols-3 gap-2 max-h-56 overflow-y-auto custom-scrollbar pr-0.5">
@@ -553,7 +557,7 @@ function UploadButton({ apiKey, maxImages, onSelect, onClear, initialUrls = [],
<div className="absolute inset-0 bg-black/60 opacity-0 group-hover/cell:opacity-100 transition-opacity flex items-end justify-end p-1">
<button
type="button"
- title="Remove from history"
+ title={t.removeFromHistory}
onClick={(e) => handleRemoveFromHistory(e, entry)}
className="w-5 h-5 bg-red-500/80 hover:bg-red-500 rounded-md flex items-center justify-center transition-colors"
>
@@ -603,14 +607,14 @@ function UploadButton({ apiKey, maxImages, onSelect, onClear, initialUrls = [],
{isMulti && hasSelection && (
<div className="mt-3 pt-3 border-t border-white/5 flex items-center justify-between">
<span className="text-xs text-secondary">
- {count} of {maxImages} selected
+ {t.selectedCount.replace("{count}", count).replace("{max}", maxImages)}
</span>
<button
type="button"
onClick={handleDone}
className="px-4 py-1.5 bg-primary text-black rounded-xl text-xs font-black transition-all hover:scale-105"
>
- Use Selected
+ {t.useSelected}
</button>
</div>
)}
@@ -652,23 +656,24 @@ const PROVIDER_LOGOS = {
const invertLogos = ['openai', 'blackforest', 'runway', 'ideogram', 'lightricks', 'grok'];
-function ModelDropdown({ selectedModel, onSelect, onClose }) {
+function ModelDropdown({ selectedModel, onSelect, onClose, copy }) {
+ const t = copy.modelDropdown;
const [search, setSearch] = useState("");
const selectedEntry = imageModelPickerEntryByVariantId.get(selectedModel);
const modelCategories = [
{
id: "all",
- label: "All",
+ label: t.categoryAll,
entries: imageModelPickerEntries,
},
{
id: "t2i",
- label: "Text to Image",
+ label: t.categoryT2I,
entries: imageModelPickerEntries.filter((entry) => entry.variantsByMode.t2i),
},
{
id: "i2i",
- label: "Image to Image",
+ label: t.categoryI2I,
entries: imageModelPickerEntries.filter((entry) => entry.variantsByMode.i2i),
},
];
@@ -759,7 +764,7 @@ function ModelDropdown({ selectedModel, onSelect, onClose }) {
? "bg-white/10 text-yellow-400 border-yellow-500/30 shadow-md scale-105"
: "bg-white/[0.02] text-white/50 border-white/[0.03] hover:bg-white/5 hover:text-white"
}`}
- title="All Providers"
+ title={t.allProviders}
>
<svg width="15" height="15" viewBox="0 0 24 24" fill={selectedProvider === "all" ? "currentColor" : "none"} stroke="currentColor" strokeWidth="2">
<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" />
@@ -833,7 +838,7 @@ function ModelDropdown({ selectedModel, onSelect, onClose }) {
</svg>
<input
type="text"
- placeholder="Search models..."
+ placeholder={t.searchPlaceholder}
value={search}
onClick={(e) => e.stopPropagation()}
onChange={(e) => {
@@ -847,7 +852,7 @@ function ModelDropdown({ selectedModel, onSelect, onClose }) {
</div>
<div className="text-xs font-semibold text-secondary py-1 shrink-0 flex items-center justify-between">
- <span>{activeCategory.label} models</span>
+ <span>{activeCategory.label} {t.modelsSuffix}</span>
{selectedProvider !== "all" && (
<span className="text-[10px] bg-white/5 px-2 py-0.5 rounded text-white/60">
{availableProviders.find(p => p.id === selectedProvider)?.name || selectedProvider}
@@ -858,7 +863,7 @@ function ModelDropdown({ selectedModel, onSelect, onClose }) {
<div className="flex flex-col gap-1.5 overflow-y-auto custom-scrollbar pr-1 pb-2 flex-1">
{filtered.length === 0 ? (
<div className="text-xs text-white/30 text-center py-6">
- No models found
+ {t.noModelsFound}
</div>
) : (
filtered.map((entry) => {
@@ -971,7 +976,9 @@ export default function ImageStudio({
onDeleteHistoryItem,
droppedFiles,
onFilesHandled,
+ locale = "en",
}) {
+ const copy = resolveCopy(en, zh, locale);
const LEGACY_PERSIST_KEY = "hg_image_studio_persistent";
const PERSIST_KEY = scopedPersistKey(LEGACY_PERSIST_KEY, apiKey);
useEffect(() => {
@@ -1129,7 +1136,7 @@ export default function ImageStudio({
const tooLarge = files.filter((f) => f.size > MAX_IMAGE_SIZE);
if (tooLarge.length > 0) {
alert(
- `The following images are too large (max 10MB): ${tooLarge.map((f) => f.name).join(", ")}`
+ copy.uploadButton.tooLargeAlert.replace("{names}", tooLarge.map((f) => f.name).join(", "))
);
return;
}
@@ -1142,7 +1149,7 @@ export default function ImageStudio({
selectedModelId,
);
if (!editor) {
- toast.error(`${family.name} does not support image references.`);
+ toast.error(copy.errors.noImageReferenceSupport.replace("{name}", family.name));
return;
}
@@ -1170,7 +1177,7 @@ export default function ImageStudio({
handleUploadSelect({ urls });
} catch (err) {
- alert(`Image upload failed: ${err.message}`);
+ alert(copy.uploadButton.uploadFailedAlert.replace("{message}", err.message));
} finally {
setGenerating(false);
}
@@ -1275,7 +1282,7 @@ export default function ImageStudio({
selection.selectedModelId,
);
if (!target) {
- toast.error(`${family.name} does not support image references.`);
+ toast.error(copy.errors.noImageReferenceSupport.replace("{name}", family.name));
return;
}
@@ -1352,22 +1359,22 @@ export default function ImageStudio({
if (imageMode) {
if (uploadedImageUrls.length === 0) {
- alert("Please upload a reference image first.");
+ alert(copy.errors.uploadReferenceFirst);
return;
}
const modelInfo = getI2IModelById(selectedModelId);
if (modelInfo?.swapField && !swapImageUrl) {
- alert("Please upload a swap face image.");
+ alert(copy.errors.uploadSwapFaceFirst);
return;
}
} else {
const imageCapability = getModelMediaCapabilities(selectedVariant?.model).image;
if (uploadedImageUrls.length > 0 && imageCapability.maxItems === 0) {
- alert(`${selectedModelDisplayName} does not support image references.`);
+ alert(copy.errors.noImageReferenceSupport.replace("{name}", selectedModelDisplayName));
return;
}
if (!prompt.trim()) {
- alert("Please enter a prompt to generate an image.");
+ alert(copy.errors.enterPromptFirst);
return;
}
}
@@ -1440,7 +1447,7 @@ export default function ImageStudio({
});
} catch (e) {
console.error("[ImageStudio] Generation failed:", e);
- const errMsg = formatErrorMessage(e, "Image generation failed");
+ const errMsg = formatErrorMessage(e, copy.errors.generationFailed);
if (onGenerationError) onGenerationError(errMsg);
else toast.error(errMsg);
} finally {
@@ -1451,10 +1458,10 @@ export default function ImageStudio({
const placeholderText =
uploadedImageUrls.length > 1
- ? `${uploadedImageUrls.length} images selected — describe the transformation (optional)`
+ ? copy.promptBar.placeholderMultiImage.replace("{count}", uploadedImageUrls.length)
: imageMode
- ? "Describe how to transform this image (optional)"
- : "Describe the image you want to create";
+ ? copy.promptBar.placeholderI2I
+ : copy.promptBar.placeholderT2I;
// ── Render ───────────────────────────────────────────────────────────────
return (
@@ -1472,10 +1479,10 @@ export default function ImageStudio({
>
<img
src={entry.url}
- alt={entry.prompt?.substring(0, 30) || "Generated image"}
+ alt={entry.prompt?.substring(0, 30) || copy.gallery.generatedImageAlt}
className="w-full aspect-square object-cover bg-black/40 hover:opacity-80 transition-opacity"
/>
-
+
{/* Overlay actions */}
<div className="absolute top-2 right-2 hidden md:flex flex-col gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
<GenerationCopyButtons
@@ -1485,7 +1492,7 @@ export default function ImageStudio({
/>
<button
type="button"
- title="Download"
+ title={copy.gallery.download}
onClick={(e) => {
e.stopPropagation();
downloadImage(entry.url, `muapi-${entry.id || idx}.jpg`);
@@ -1498,12 +1505,12 @@ export default function ImageStudio({
</button>
<button
type="button"
- title="Delete"
+ title={copy.gallery.delete}
onClick={(e) => {
e.stopPropagation();
- if (confirm("Are you sure you want to delete this generated item?")) {
+ if (confirm(copy.gallery.deleteConfirm)) {
handleDeleteEntry(entry, idx).catch((err) => {
- onGenerationError?.(err.message || "Failed to delete item");
+ onGenerationError?.(err.message || copy.gallery.deleteFailed);
});
}
}}
@@ -1524,18 +1531,18 @@ export default function ImageStudio({
actions={[
{
kind: "download",
- label: "Download",
+ label: copy.gallery.download,
onSelect: () =>
downloadImage(entry.url, `muapi-${entry.id || idx}.jpg`),
},
{
kind: "delete",
- label: "Delete",
+ label: copy.gallery.delete,
danger: true,
onSelect: () => {
- if (confirm("Are you sure you want to delete this generated item?")) {
+ if (confirm(copy.gallery.deleteConfirm)) {
handleDeleteEntry(entry, idx).catch((err) => {
- onGenerationError?.(err.message || "Failed to delete item");
+ onGenerationError?.(err.message || copy.gallery.deleteFailed);
});
}
},
@@ -1546,12 +1553,12 @@ export default function ImageStudio({
{/* Prompt & Details */}
<div className="p-3 bg-black/80 backdrop-blur-sm border-t border-white/5 flex-1 flex flex-col justify-between gap-2">
<p className="text-white/70 text-xs line-clamp-3 leading-relaxed" title={entry.prompt}>
- {entry.prompt || "No prompt provided"}
+ {entry.prompt || copy.gallery.noPrompt}
</p>
<div className="flex items-center justify-between mt-1">
<div className="flex items-center gap-2">
<span className="text-[10px] font-bold text-primary px-2 py-0.5 bg-primary/10 rounded border border-primary/20 capitalize">
- {entry.model?.replace("-", " ") || "Image Studio"}
+ {entry.model?.replace("-", " ") || copy.gallery.modelFallback}
</span>
<span className="text-[10px] text-white/40">{entry.aspect_ratio}</span>
</div>
@@ -1595,13 +1602,13 @@ export default function ImageStudio({
</div>
<h1 className="text-2xl sm:text-4xl md:text-5xl font-extrabold tracking-tight mb-4 text-center px-4 flex flex-col items-center">
- <span className="text-white font-black uppercase text-xl sm:text-3xl tracking-wide mb-1 opacity-90">START CREATING WITH</span>
+ <span className="text-white font-black uppercase text-xl sm:text-3xl tracking-wide mb-1 opacity-90">{copy.emptyState.heading}</span>
<span className="text-[#22d3ee] font-black uppercase text-2xl sm:text-4xl sm:mt-1 tracking-tight">
{selectedModelDisplayName}
</span>
</h1>
<p className="text-white/40 text-xs sm:text-sm font-medium tracking-wide text-center max-w-lg leading-relaxed px-4">
- Describe a scene, character, mood, or style — and watch it come to life
+ {copy.emptyState.subtitle}
</p>
</div>
)}
@@ -1640,6 +1647,7 @@ export default function ImageStudio({
initialUrls={uploadedImageUrls}
persistedHistory={uploadHistory}
onHistoryChange={setUploadHistory}
+ copy={copy}
/>
)}
@@ -1651,7 +1659,8 @@ export default function ImageStudio({
onSelect={({ urls }) => setSwapImageUrl(urls[0] || null)}
onClear={() => setSwapImageUrl(null)}
initialUrls={swapImageUrl ? [swapImageUrl] : []}
- label="Swap Face"
+ label={copy.promptBar.swapFaceLabel}
+ copy={copy}
/>
)}
</div>
@@ -1706,11 +1715,12 @@ export default function ImageStudio({
onClick={(e) => e.stopPropagation()}
className="w-[calc(100vw-2rem)] md:w-[480px] max-w-md md:max-w-none max-h-[70vh]"
>
- <PromptPopoverHeader>Model</PromptPopoverHeader>
+ <PromptPopoverHeader>{copy.popovers.model}</PromptPopoverHeader>
<ModelDropdown
selectedModel={selectedModelId}
onSelect={handleModelSelect}
onClose={() => setDropdownOpen(null)}
+ copy={copy}
/>
</PromptPopover>
)}
@@ -1754,7 +1764,7 @@ export default function ImageStudio({
onClick={(e) => e.stopPropagation()}
>
<SimpleDropdown
- title="Aspect Ratio"
+ title={copy.popovers.aspectRatio}
options={currentAspectRatios}
selected={selectedAr}
onSelect={(val) => setSelectedAr(val)}
@@ -1788,7 +1798,7 @@ export default function ImageStudio({
onClick={(e) => e.stopPropagation()}
>
<SimpleDropdown
- title="Resolution"
+ title={copy.popovers.resolution}
options={currentResolutions}
selected={selectedQuality}
onSelect={(val) => setSelectedQuality(val)}
@@ -1816,7 +1826,7 @@ export default function ImageStudio({
<path d="M5 3l14 9-14 9V3z" />
</svg>
<span className={`${PROMPT_CONTROL_LABEL_CLASS} max-w-[140px] truncate`}>
- {selectedEffect || "Effect"}
+ {selectedEffect || copy.promptBar.effectFallback}
</span>
</button>
@@ -1826,7 +1836,7 @@ export default function ImageStudio({
className="min-w-[200px]"
>
<SimpleDropdown
- title="Effect Type"
+ title={copy.popovers.effectType}
options={currentEffects}
selected={selectedEffect}
onSelect={(val) => setSelectedEffect(val)}
@@ -1869,7 +1879,7 @@ export default function ImageStudio({
<path d="M16.5 3.5a2.121 2.121 0 013 3L7 19l-4 1 1-4L16.5 3.5z" />
</svg>
<span className={PROMPT_CONTROL_LABEL_CLASS}>
- Draw
+ {copy.promptBar.drawButton}
</span>
</button>
</PromptControls>
@@ -1882,11 +1892,11 @@ export default function ImageStudio({
{generating ? (
<>
<span className="animate-spin inline-block text-black">◌</span>
- Generating...
+ {copy.promptBar.generating}
</>
) : (
<>
- <span>Generate ✦</span>
+ <span>{copy.promptBar.generateButton}</span>
</>
)}
</PromptAction>
@@ -1912,9 +1922,9 @@ export default function ImageStudio({
<line x1="6" y1="6" x2="18" y2="18" />
</svg>
</button>
- <img
- src={fullscreenUrl}
- alt="Fullscreen Preview"
+ <img
+ src={fullscreenUrl}
+ alt={copy.fullscreen.previewAlt}
className="max-w-[95vw] max-h-[95vh] rounded-2xl shadow-2xl object-contain animate-scale-up"
onClick={(e) => e.stopPropagation()}
/>
diff --git a/packages/studio/src/components/LayersStudio.jsx b/packages/studio/src/components/LayersStudio.jsx
index ea73f96b..79d7f6bd 100644
--- a/packages/studio/src/components/LayersStudio.jsx
+++ b/packages/studio/src/components/LayersStudio.jsx
@@ -11,6 +11,9 @@ import {
expandImage,
} from "../muapi.js";
import { formatErrorMessage } from "../utils/formatError.js";
+import en from "../messages/en/layersStudio.json";
+import zh from "../messages/zh/layersStudio.json";
+import { resolveCopy } from "../i18nUtils";
// Upscale Models Definition from schema_data.json
const UPSCALE_MODELS = [
@@ -87,7 +90,10 @@ export default function LayersStudio({
onGenerationEnd,
onGenerationComplete,
onGenerationError,
+ locale = "en",
}) {
+ const copy = resolveCopy(en, zh, locale);
+
// Main canvas & image state
const [currentImageUrl, setCurrentImageUrl] = useState(DEFAULT_SAMPLE_IMAGE);
const [prompt, setPrompt] = useState("");
@@ -273,7 +279,7 @@ export default function LayersStudio({
// Upload File Helper
const handleUploadFile = async (file) => {
if (!apiKey) {
- toast.error("Please enter your API Key to upload images.");
+ toast.error(copy.toasts.enterApiKeyUpload);
return;
}
setUploading(true);
@@ -288,9 +294,9 @@ export default function LayersStudio({
setCarouselIndex(0);
setLassoPoints([]);
clearDrawingCanvas();
- toast.success("Image uploaded successfully!");
+ toast.success(copy.toasts.imageUploaded);
} catch (err) {
- toast.error(`Upload failed: ${formatErrorMessage(err)}`);
+ toast.error(copy.toasts.uploadFailed.replace('{error}', formatErrorMessage(err)));
} finally {
setUploading(false);
}
@@ -306,11 +312,11 @@ export default function LayersStudio({
if (!file) return;
if (!file.type.startsWith("image/")) {
- toast.error("Please upload an image file.");
+ toast.error(copy.toasts.uploadImageFileOnly);
return;
}
if (file.size > MAX_IMAGE_SIZE) {
- toast.error(`File too large (max 20MB): ${file.name}`);
+ toast.error(copy.toasts.fileTooLarge.replace('{name}', file.name));
return;
}
@@ -706,17 +712,17 @@ export default function LayersStudio({
const resetView = () => {
setZoomLevel(100);
setPanOffset({ x: 0, y: 0 });
- toast("View reset");
+ toast(copy.toasts.viewReset);
};
// --- REGIONAL & LASSO EDIT AI SUBMIT WITH <bbox> BBOX TAGS ---
const handleRunRegionalEdit = async () => {
if (!apiKey) {
- toast.error("Please enter your API key.");
+ toast.error(copy.toasts.enterApiKey);
return;
}
if (!regionalPrompt) {
- toast.error("Please enter a prompt for the selected region.");
+ toast.error(copy.toasts.enterRegionPrompt);
return;
}
@@ -776,7 +782,7 @@ export default function LayersStudio({
}
} catch (err) {
const errorMsg = formatErrorMessage(err);
- toast.error(`Edit failed: ${errorMsg}`);
+ toast.error(copy.toasts.editFailed.replace('{error}', errorMsg));
onGenerationError?.(errorMsg);
} finally {
setIsProcessing(false);
@@ -821,11 +827,11 @@ export default function LayersStudio({
const finalSeedreamPrompt = buildSeedreamLayerPrompt(rawPrompt);
if (!apiKey) {
- toast.error("API key is missing. Please set your API key.");
+ toast.error(copy.toasts.apiKeyMissingSet);
return;
}
if (!currentImageUrl) {
- toast.error("Please upload or select an image to decompose into layers.");
+ toast.error(copy.toasts.uploadOrSelectDecompose);
return;
}
@@ -864,11 +870,11 @@ export default function LayersStudio({
});
setVisibleLayers(initialVis);
- toast.success(`Decomposed into ${layerUrls.length} layer(s)!`);
+ toast.success(copy.toasts.decomposedInto.replace('{count}', layerUrls.length));
onGenerationComplete?.(result);
} catch (err) {
const errorMsg = formatErrorMessage(err);
- toast.error(`Decomposition failed: ${errorMsg}`);
+ toast.error(copy.toasts.decompositionFailed.replace('{error}', errorMsg));
onGenerationError?.(errorMsg);
} finally {
setIsProcessing(false);
@@ -879,11 +885,11 @@ export default function LayersStudio({
// --- API CALL: UPSCALE IMAGE (seedvr2-image-upscale, topaz-image-upscale, ai-image-upscaler) ---
const handleRunUpscale = async () => {
if (!apiKey) {
- toast.error("Please enter your API key.");
+ toast.error(copy.toasts.enterApiKey);
return;
}
if (!currentImageUrl) {
- toast.error("Please select or upload an image to upscale.");
+ toast.error(copy.toasts.uploadOrSelectUpscale);
return;
}
@@ -919,15 +925,15 @@ export default function LayersStudio({
(m) => m.id === upscaleModel,
);
toast.success(
- `Image upscaled successfully with ${selectedModelObj?.name || "AI Upscaler"}!`,
+ copy.toasts.upscaleSuccess.replace('{model}', selectedModelObj?.name || "AI Upscaler"),
);
onGenerationComplete?.(result);
} else {
- toast.error("Upscale completed but no output URL was returned.");
+ toast.error(copy.toasts.upscaleNoOutput);
}
} catch (err) {
const errorMsg = formatErrorMessage(err);
- toast.error(`Upscale failed: ${errorMsg}`);
+ toast.error(copy.toasts.upscaleFailed.replace('{error}', errorMsg));
onGenerationError?.(errorMsg);
} finally {
setIsProcessing(false);
@@ -938,11 +944,11 @@ export default function LayersStudio({
// --- API CALL: REMOVE BACKGROUND (ai-background-remover) ---
const handleRunRemoveBg = async () => {
if (!apiKey) {
- toast.error("Please enter your API key.");
+ toast.error(copy.toasts.enterApiKey);
return;
}
if (!currentImageUrl) {
- toast.error("Please upload or select an image to remove background.");
+ toast.error(copy.toasts.uploadOrSelectRemoveBg);
return;
}
@@ -976,16 +982,14 @@ export default function LayersStudio({
...prev.filter((u) => u !== outputUrl),
]);
setCarouselIndex(0);
- toast.success("Background removed cleanly with AI Background Remover!");
+ toast.success(copy.toasts.removeBgSuccess);
onGenerationComplete?.(result);
} else {
- toast.error(
- "Background removal completed but no output URL was returned.",
- );
+ toast.error(copy.toasts.removeBgNoOutput);
}
} catch (err) {
const errorMsg = formatErrorMessage(err);
- toast.error(`Background removal failed: ${errorMsg}`);
+ toast.error(copy.toasts.removeBgFailed.replace('{error}', errorMsg));
onGenerationError?.(errorMsg);
} finally {
setIsProcessing(false);
@@ -996,11 +1000,11 @@ export default function LayersStudio({
// --- API CALL: EXPAND / OUTPAINT IMAGE (ai-image-extension) ---
const handleRunExpand = async () => {
if (!apiKey) {
- toast.error("Please enter your API key.");
+ toast.error(copy.toasts.enterApiKey);
return;
}
if (!currentImageUrl) {
- toast.error("Please upload or select an image to expand.");
+ toast.error(copy.toasts.uploadOrSelectExpand);
return;
}
@@ -1029,16 +1033,14 @@ export default function LayersStudio({
if (outputUrl) {
setCurrentImageUrl(outputUrl);
- toast.success("Image expanded cleanly with AI Image Extension!");
+ toast.success(copy.toasts.expandSuccess);
onGenerationComplete?.(result);
} else {
- toast.error(
- "Image expansion completed but no output URL was returned.",
- );
+ toast.error(copy.toasts.expandNoOutput);
}
} catch (err) {
const errorMsg = formatErrorMessage(err);
- toast.error(`Image expansion failed: ${errorMsg}`);
+ toast.error(copy.toasts.expandFailed.replace('{error}', errorMsg));
onGenerationError?.(errorMsg);
} finally {
setIsProcessing(false);
@@ -1051,7 +1053,7 @@ export default function LayersStudio({
setUpscaleModel("topaz-image-upscale");
setTopazFactor(1);
setSeedvrResolution("4k");
- toast("Upscale settings reset to default");
+ toast(copy.toasts.upscaleSettingsReset);
};
// Reset individual Color Grading category
@@ -1060,13 +1062,13 @@ export default function LayersStudio({
...prev,
[catKey]: { ...DEFAULT_COLOR_GRADING[catKey] },
}));
- toast(`Reset ${catKey}`);
+ toast(copy.toasts.resetCategory.replace('{category}', catKey));
};
// Reset all Color Grading parameters
const handleResetAllColorGrading = () => {
setColorGrading(DEFAULT_COLOR_GRADING);
- toast("Color grading reset to default");
+ toast(copy.toasts.colorGradingReset);
};
// Download Color Graded Image (Includes live filters, vignette, halation, and film grain)
@@ -1145,7 +1147,7 @@ export default function LayersStudio({
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
- toast.success("Downloaded color graded image!");
+ toast.success(copy.toasts.downloadedGraded);
} catch {
handleDownloadSingle(currentImageUrl, "color_graded_image.png");
}
@@ -1165,17 +1167,17 @@ export default function LayersStudio({
setVisibleLayers(initialVis);
clearDrawingCanvas();
setMarkedRegions([]);
- toast.success("Loaded Seedream 5-layer sample!");
+ toast.success(copy.toasts.loadedSample);
};
// Explicit Side Tool Execution Handler
const handleExecuteSideTool = async (toolId) => {
if (!apiKey) {
- toast.error("API key is missing.");
+ toast.error(copy.toasts.apiKeyMissing);
return;
}
if (!currentImageUrl) {
- toast.error("Please upload an image first.");
+ toast.error(copy.toasts.uploadImageFirst);
return;
}
@@ -1220,12 +1222,12 @@ export default function LayersStudio({
setProgress(100);
if (result?.url) {
setCurrentImageUrl(result.url);
- toast.success(`${toolId} completed successfully!`);
+ toast.success(copy.toasts.toolCompleted.replace('{tool}', toolId));
onGenerationComplete?.(result);
}
} catch (err) {
const errorMsg = formatErrorMessage(err);
- toast.error(`Operation failed: ${errorMsg}`);
+ toast.error(copy.toasts.operationFailed.replace('{error}', errorMsg));
onGenerationError?.(errorMsg);
} finally {
setIsProcessing(false);
@@ -1269,19 +1271,19 @@ export default function LayersStudio({
handleDownloadSingle(url, `layer_${i + 1}.${outputFormat}`);
}, i * 300);
});
- toast.success("Downloading all layers...");
+ toast.success(copy.toasts.downloadingAll);
};
const sideMenuItems = [
- { id: "layer-decomposition", label: "Layer Decomposition", isNew: true },
- { id: "upscale", label: "Upscale", isNew: true },
- { id: "color-grading", label: "Color Grading", isNew: true },
- { id: "remove-bg", label: "Remove background", isNew: true },
- { id: "expand-crop", label: "Expand & Outpaint", isNew: true },
- { id: "edit-text", label: "Edit text", isNew: false },
- { id: "enhancer", label: "Enhancer", isNew: false },
- { id: "relight", label: "Relight", isNew: false },
- { id: "angles", label: "Angles", isNew: false },
+ { id: "layer-decomposition", label: copy.menuItems["layer-decomposition"], isNew: true },
+ { id: "upscale", label: copy.menuItems.upscale, isNew: true },
+ { id: "color-grading", label: copy.menuItems["color-grading"], isNew: true },
+ { id: "remove-bg", label: copy.menuItems["remove-bg"], isNew: true },
+ { id: "expand-crop", label: copy.menuItems["expand-crop"], isNew: true },
+ { id: "edit-text", label: copy.menuItems["edit-text"], isNew: false },
+ { id: "enhancer", label: copy.menuItems.enhancer, isNew: false },
+ { id: "relight", label: copy.menuItems.relight, isNew: false },
+ { id: "angles", label: copy.menuItems.angles, isNew: false },
];
const getLassoPathString = () => {
@@ -1322,7 +1324,7 @@ export default function LayersStudio({
<div className="absolute left-6 top-1/2 -translate-y-1/2 z-30 flex flex-col items-center gap-3">
<button
onClick={() => fileInputRef.current?.click()}
- title="Upload or Change Image"
+ title={copy.tools.uploadOrChangeImage}
className="group relative w-12 h-14 rounded-2xl overflow-hidden bg-[#1a1c23] border border-white/10 flex items-center justify-center transition-all duration-200 hover:scale-105 shadow-[0_0_20px_rgba(0,0,0,0.5)] ring-2 ring-[#84cc16]/80"
>
{currentImageUrl ? (
@@ -1353,7 +1355,7 @@ export default function LayersStudio({
<button
onClick={() => setMarkedRegions([])}
className="px-2 py-1 bg-red-500/20 hover:bg-red-500/40 text-red-300 text-[10px] font-black rounded-lg border border-red-500/40 shadow-sm"
- title="Clear Marked Regions"
+ title={copy.tools.clearMarkedRegions}
>
Clear ({markedRegions.length})
</button>
@@ -1511,14 +1513,14 @@ export default function LayersStudio({
onKeyDown={(e) =>
e.key === "Enter" && handleRunRegionalEdit()
}
- placeholder="Type your prompt here..."
+ placeholder={copy.tools.regionalPromptPlaceholder}
className="flex-1 bg-transparent text-xs text-white placeholder-white/40 focus:outline-none min-w-0 font-medium"
/>
<button
onClick={handleRunRegionalEdit}
disabled={isProcessing}
className="w-7 h-7 rounded-full bg-[#84cc16] hover:bg-[#a3e635] text-black flex items-center justify-center shadow-[0_0_12px_rgba(132,204,22,0.6)] transition-all hover:scale-105 active:scale-95 flex-shrink-0"
- title="Run Selection Edit"
+ title={copy.tools.runSelectionEdit}
>
<svg
width="14"
@@ -1653,7 +1655,7 @@ export default function LayersStudio({
? "bg-[#84cc16] text-black border-[#84cc16]"
: "text-white/70 hover:text-white border-transparent"
}`}
- title="Line"
+ title={copy.tools.line}
>
<svg
width="15"
@@ -1674,7 +1676,7 @@ export default function LayersStudio({
? "bg-[#84cc16] text-black border-[#84cc16]"
: "text-white/70 hover:text-white border-transparent"
}`}
- title="Arrow"
+ title={copy.tools.arrow}
>
<svg
width="15"
@@ -1696,7 +1698,7 @@ export default function LayersStudio({
? "bg-[#84cc16] text-black border-[#84cc16]"
: "text-white/70 hover:text-white border-transparent"
}`}
- title="Rectangle"
+ title={copy.tools.rectangle}
>
<svg
width="15"
@@ -1717,7 +1719,7 @@ export default function LayersStudio({
? "bg-[#84cc16] text-black border-[#84cc16]"
: "text-white/70 hover:text-white border-transparent"
}`}
- title="Circle"
+ title={copy.tools.circle}
>
<svg
width="15"
@@ -1777,7 +1779,7 @@ export default function LayersStudio({
value={brushColor}
onChange={(e) => setBrushColor(e.target.value)}
className="w-5 h-5 rounded-full border-0 cursor-pointer bg-transparent"
- title="Custom Color"
+ title={copy.tools.customColor}
/>
</div>
)}
@@ -1804,7 +1806,7 @@ export default function LayersStudio({
onClick={handleUndo}
disabled={historyIndex < 0}
className="p-1.5 text-white/70 hover:text-white disabled:opacity-30 rounded-lg hover:bg-white/5"
- title="Undo Stroke"
+ title={copy.tools.undoStroke}
>
↶
</button>
@@ -1812,14 +1814,14 @@ export default function LayersStudio({
onClick={handleRedo}
disabled={historyIndex >= historyStack.length - 1}
className="p-1.5 text-white/70 hover:text-white disabled:opacity-30 rounded-lg hover:bg-white/5"
- title="Redo Stroke"
+ title={copy.tools.redoStroke}
>
↷
</button>
<button
onClick={clearDrawingCanvas}
className="p-1.5 text-rose-400 hover:text-rose-300 rounded-lg hover:bg-white/5 text-xs font-bold"
- title="Clear Drawings"
+ title={copy.tools.clearDrawings}
>
Clear
</button>
@@ -1836,7 +1838,7 @@ export default function LayersStudio({
? "bg-[#84cc16] text-black shadow-[0_0_12px_rgba(132,204,22,0.4)]"
: "text-white/60 hover:text-white hover:bg-white/5"
}`}
- title="Select Pointer Tool"
+ title={copy.tools.selectPointerTool}
>
<svg
width="17"
@@ -1855,7 +1857,7 @@ export default function LayersStudio({
? "bg-[#84cc16] text-black shadow-[0_0_12px_rgba(132,204,22,0.4)]"
: "text-white/60 hover:text-white hover:bg-white/5"
}`}
- title="Pan Tool"
+ title={copy.tools.panTool}
>
<svg
width="17"
@@ -1881,7 +1883,7 @@ export default function LayersStudio({
? "bg-[#84cc16] text-black shadow-[0_0_12px_rgba(132,204,22,0.4)]"
: "text-white/60 hover:text-white hover:bg-white/5"
}`}
- title="Lasso Edit"
+ title={copy.tools.lassoEdit}
>
<svg
width="17"
@@ -1913,7 +1915,7 @@ export default function LayersStudio({
? "bg-[#84cc16] text-black shadow-[0_0_12px_rgba(132,204,22,0.4)]"
: "text-white/60 hover:text-white hover:bg-white/5"
}`}
- title="Regional Edit"
+ title={copy.tools.regionalEdit}
>
<svg
width="17"
@@ -1947,7 +1949,7 @@ export default function LayersStudio({
? "bg-[#84cc16] text-black shadow-[0_0_12px_rgba(132,204,22,0.4)]"
: "text-white/60 hover:text-white hover:bg-white/5"
}`}
- title="Highlight Marker Pen"
+ title={copy.tools.highlightMarkerPen}
>
<svg
width="17"
@@ -1971,7 +1973,7 @@ export default function LayersStudio({
? "bg-[#84cc16] text-black shadow-[0_0_12px_rgba(132,204,22,0.4)]"
: "text-white/60 hover:text-white hover:bg-white/5"
}`}
- title="Eraser Tool"
+ title={copy.tools.eraserTool}
>
<svg
width="17"
@@ -1994,7 +1996,7 @@ export default function LayersStudio({
? "bg-[#84cc16] text-black shadow-[0_0_12px_rgba(132,204,22,0.4)]"
: "text-white/60 hover:text-white hover:bg-white/5"
}`}
- title="Shapes (R)"
+ title={copy.tools.shapes}
>
<svg
width="17"
@@ -2023,7 +2025,7 @@ export default function LayersStudio({
<button
onClick={resetView}
className="text-xs font-semibold text-white/80 min-w-[36px] text-center hover:text-white"
- title="Reset Zoom & Pan"
+ title={copy.tools.resetZoomPan}
>
{zoomLevel}%
</button>
@@ -2040,7 +2042,7 @@ export default function LayersStudio({
<button
onClick={() => fileInputRef.current?.click()}
className="w-8 h-8 rounded-full bg-white/5 hover:bg-white/10 flex items-center justify-center text-white/70 hover:text-white transition-all mr-2 flex-shrink-0"
- title="Add Image"
+ title={copy.tools.addImage}
>
<svg
width="16"
@@ -2072,7 +2074,7 @@ export default function LayersStudio({
onClick={() => handleDecompose()}
disabled={isProcessing}
className="w-10 h-10 rounded-full bg-[#84cc16] hover:bg-[#a3e635] text-black flex items-center justify-center shadow-[0_0_20px_rgba(132,204,22,0.5)] transition-all hover:scale-105 active:scale-95 disabled:opacity-50 ml-2 flex-shrink-0"
- title="Run Layer Decomposition"
+ title={copy.tools.runLayerDecomposition}
>
<svg
width="18"
@@ -2100,7 +2102,7 @@ export default function LayersStudio({
<button
onClick={() => setActiveSideTab("menu")}
className="w-8 h-8 rounded-full bg-white/5 hover:bg-white/10 text-white/70 hover:text-white flex items-center justify-center transition-colors"
- title="Back to Tools"
+ title={copy.tools.backToTools}
>
<svg
width="18"
@@ -2192,17 +2194,7 @@ export default function LayersStudio({
)}
</div>
<h3 className="text-sm font-extrabold text-white tracking-tight">
- {activeSideTab === "upscale"
- ? "Upscale"
- : activeSideTab === "color-grading"
- ? "Color Grading"
- : activeSideTab === "remove-bg"
- ? "Remove Background"
- : activeSideTab === "expand-crop"
- ? "Expand Image"
- : activeSideTab === "layer-decomposition"
- ? "Layer Decomposition"
- : "Tools"}
+ {copy.panels[activeSideTab] || copy.panels.tools}
</h3>
</div>
</div>
@@ -2210,7 +2202,7 @@ export default function LayersStudio({
<button
onClick={() => setIsSidebarOpen(false)}
className="w-8 h-8 rounded-full bg-white/5 hover:bg-white/10 text-white/40 hover:text-white flex items-center justify-center transition-colors"
- title="Close Panel"
+ title={copy.tools.closePanel}
>
<svg
width="16"
@@ -2233,7 +2225,7 @@ export default function LayersStudio({
<div
onClick={handleLoadSampleLayers}
className="group w-full bg-[#f4f4f7] hover:bg-white rounded-3xl p-3 shadow-lg overflow-hidden border border-white/20 cursor-pointer transition-all duration-200 hover:scale-[1.01]"
- title="Click to load this layer decomposition example"
+ title={copy.sample.clickToLoad}
>
<div className="flex items-center gap-2.5">
<div className="relative w-28 h-36 rounded-2xl overflow-hidden bg-zinc-900 flex-shrink-0 shadow-md">
@@ -2244,17 +2236,17 @@ export default function LayersStudio({
/>
<div className="absolute inset-y-0 left-1/2 w-5 -translate-x-1/2 bg-gradient-to-r from-transparent via-[#d8ff00]/90 to-transparent blur-[3px] animate-pulse" />
<div className="absolute bottom-1 left-1 px-1.5 py-0.5 rounded-md bg-black/75 text-[8px] font-black text-white backdrop-blur-sm">
- Original
+ {copy.sample.original}
</div>
</div>
<div className="flex-1 bg-[#13151d] rounded-2xl p-2.5 flex flex-col justify-between h-36 shadow-inner overflow-hidden">
<div className="flex items-center justify-between px-1">
<span className="text-[10px] font-black text-[#a3e635] uppercase tracking-wider">
- 5 Layers
+ {copy.sample.layersCount}
</span>
<span className="text-[9px] font-bold text-white/50 group-hover:text-white transition-colors">
- Try →
+ {copy.sample.try}
</span>
</div>
@@ -2282,7 +2274,7 @@ export default function LayersStudio({
</div>
<div className="text-[9px] text-center text-white/40 font-semibold group-hover:text-[#84cc16] transition-colors">
- Click to explore sample
+ {copy.sample.clickToExplore}
</div>
</div>
</div>
@@ -2291,12 +2283,12 @@ export default function LayersStudio({
{/* Settings Section */}
<div className="bg-[#2d313d] rounded-3xl p-5 border border-white/5 space-y-4 shadow-sm">
<h4 className="text-sm font-bold text-white tracking-tight">
- Settings
+ {copy.settings.heading}
</h4>
<div>
<label className="block text-[11px] font-bold uppercase tracking-wider text-white/40 mb-2">
- Resolution
+ {copy.settings.resolution}
</label>
<div className="grid grid-cols-3 gap-1.5 bg-[#1a1c24] p-1 rounded-2xl border border-white/5">
{["1K", "1.5K", "2K"].map((res) => (
@@ -2318,7 +2310,7 @@ export default function LayersStudio({
<div>
<div className="flex items-center justify-between mb-2">
<label className="block text-[11px] font-bold uppercase tracking-wider text-white/40">
- Layers
+ {copy.settings.layers}
</label>
<span className="px-2.5 py-0.5 rounded-lg bg-[#1a1c24] border border-white/10 text-xs font-black text-white shadow-sm">
{layerCount}
@@ -2349,7 +2341,7 @@ export default function LayersStudio({
<div className="flex items-center justify-between">
<div className="flex items-center gap-2">
<span className="text-xs font-bold uppercase text-white/80">
- Layer Carousel
+ {copy.carousel.heading}
</span>
<span className="px-2 py-0.5 rounded-full bg-[#84cc16]/20 text-[#a3e635] text-[10px] font-black">
{carouselIndex + 1} / {decomposedLayers.length}
@@ -2364,15 +2356,15 @@ export default function LayersStudio({
? "bg-[#84cc16] text-black border-[#84cc16]"
: "bg-white/5 text-white/60 hover:text-white border-white/10"
}`}
- title="View only active layer"
+ title={copy.carousel.viewOnlyActive}
>
- {isSoloMode ? "Solo Active" : "Stack Mode"}
+ {isSoloMode ? copy.carousel.soloActive : copy.carousel.stackMode}
</button>
<button
onClick={handleDownloadAll}
className="text-xs text-[#a3e635] hover:underline font-semibold"
>
- Download All
+ {copy.carousel.downloadAll}
</button>
</div>
</div>
@@ -2399,7 +2391,7 @@ export default function LayersStudio({
)
}
className="absolute left-2 top-1/2 -translate-y-1/2 w-8 h-8 rounded-full bg-black/60 hover:bg-[#84cc16] text-white hover:text-black flex items-center justify-center backdrop-blur-md border border-white/10 transition-all shadow-md"
- title="Previous Layer"
+ title={copy.carousel.previousLayer}
>
‹
</button>
@@ -2411,7 +2403,7 @@ export default function LayersStudio({
)
}
className="absolute right-2 top-1/2 -translate-y-1/2 w-8 h-8 rounded-full bg-black/60 hover:bg-[#84cc16] text-white hover:text-black flex items-center justify-center backdrop-blur-md border border-white/10 transition-all shadow-md"
- title="Next Layer"
+ title={copy.carousel.nextLayer}
>
›
</button>
@@ -2420,10 +2412,10 @@ export default function LayersStudio({
<div className="w-full flex items-center justify-between mt-3 px-1 text-xs">
<div>
<span className="font-extrabold text-white text-sm">
- Layer {carouselIndex + 1}
+ {copy.carousel.layerLabel.replace('{n}', carouselIndex + 1)}
</span>
<span className="text-[11px] text-white/40 ml-2">
- Seedream Decomposed
+ {copy.carousel.seedreamDecomposed}
</span>
</div>
@@ -2435,7 +2427,7 @@ export default function LayersStudio({
? "bg-white/10 text-[#a3e635] border-white/10"
: "text-white/30 border-transparent"
}`}
- title="Toggle Visibility"
+ title={copy.carousel.toggleVisibility}
>
👁
</button>
@@ -2448,10 +2440,10 @@ export default function LayersStudio({
)
}
className="px-2.5 py-1 rounded-lg bg-[#84cc16] hover:bg-[#a3e635] text-black font-extrabold text-xs flex items-center gap-1 shadow-md"
- title="Download this layer"
+ title={copy.carousel.downloadThisLayer}
>
<span>⬇</span>
- <span>Save</span>
+ <span>{copy.carousel.save}</span>
</button>
</div>
</div>
@@ -2490,12 +2482,12 @@ export default function LayersStudio({
<div className="space-y-2">
<div className="flex items-center justify-between px-1">
<span className="text-[11px] font-extrabold uppercase tracking-wider text-white/40">
- Model
+ {copy.common.model}
</span>
<button
onClick={handleResetUpscale}
className="flex items-center gap-1 text-[11px] font-bold text-white/50 hover:text-white transition-colors"
- title="Reset to default"
+ title={copy.colorGrading.resetToDefault}
>
<svg
width="12"
@@ -2508,7 +2500,7 @@ export default function LayersStudio({
<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" />
<path d="M3 3v5h5" />
</svg>
- <span>Reset</span>
+ <span>{copy.common.reset}</span>
</button>
</div>
@@ -2624,7 +2616,7 @@ export default function LayersStudio({
<div className="bg-[#2d313d] rounded-2xl p-3 border border-white/5 space-y-2 shadow-sm">
<div className="flex items-center justify-between px-1">
<span className="text-[11px] font-bold text-white/40 uppercase tracking-wider">
- Resolution
+ {copy.settings.resolution}
</span>
<span className="bg-[#181a22] text-white text-[10px] font-black px-2 py-0.5 rounded-lg border border-white/10">
{seedvrResolution.toUpperCase()} UHD
@@ -2705,7 +2697,7 @@ export default function LayersStudio({
</span>
<span
className="w-3.5 h-3.5 rounded-full border border-white/20 text-[9px] flex items-center justify-center text-white/40 cursor-help"
- title="Temperature, hue, saturation, contrast and split-tone"
+ title={copy.colorGrading.colorCorrect.info}
>
ℹ
</span>
@@ -2714,7 +2706,7 @@ export default function LayersStudio({
<button
onClick={() => resetCategory("colorCorrect")}
className="flex items-center gap-1 text-[11px] font-bold text-white/40 hover:text-white transition-colors px-2 py-0.5 rounded-lg hover:bg-white/5"
- title="Reset Color Correct"
+ title={copy.colorGrading.colorCorrect.reset}
>
<svg
width="11"
@@ -2727,7 +2719,7 @@ export default function LayersStudio({
<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" />
<path d="M3 3v5h5" />
</svg>
- <span>Reset</span>
+ <span>{copy.common.reset}</span>
</button>
</div>
@@ -2906,7 +2898,7 @@ export default function LayersStudio({
</span>
<span
className="w-3.5 h-3.5 rounded-full border border-white/20 text-[9px] flex items-center justify-center text-white/40 cursor-help"
- title="Radius and detail softening"
+ title={copy.colorGrading.softenDetails.info}
>
ℹ
</span>
@@ -2915,7 +2907,7 @@ export default function LayersStudio({
<button
onClick={() => resetCategory("softenDetails")}
className="flex items-center gap-1 text-[11px] font-bold text-white/40 hover:text-white transition-colors px-2 py-0.5 rounded-lg hover:bg-white/5"
- title="Reset Soften Details"
+ title={copy.colorGrading.softenDetails.reset}
>
<svg
width="11"
@@ -2928,7 +2920,7 @@ export default function LayersStudio({
<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" />
<path d="M3 3v5h5" />
</svg>
- <span>Reset</span>
+ <span>{copy.common.reset}</span>
</button>
</div>
@@ -3020,7 +3012,7 @@ export default function LayersStudio({
</span>
<span
className="w-3.5 h-3.5 rounded-full border border-white/20 text-[9px] flex items-center justify-center text-white/40 cursor-help"
- title="Luminescence diffusion and blend mode"
+ title={copy.colorGrading.bloom.info}
>
ℹ
</span>
@@ -3029,7 +3021,7 @@ export default function LayersStudio({
<button
onClick={() => resetCategory("bloom")}
className="flex items-center gap-1 text-[11px] font-bold text-white/40 hover:text-white transition-colors px-2 py-0.5 rounded-lg hover:bg-white/5"
- title="Reset Bloom"
+ title={copy.colorGrading.bloom.reset}
>
<svg
width="11"
@@ -3042,7 +3034,7 @@ export default function LayersStudio({
<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" />
<path d="M3 3v5h5" />
</svg>
- <span>Reset</span>
+ <span>{copy.common.reset}</span>
</button>
</div>
@@ -3188,7 +3180,7 @@ export default function LayersStudio({
</span>
<span
className="w-3.5 h-3.5 rounded-full border border-white/20 text-[9px] flex items-center justify-center text-white/40 cursor-help"
- title="Film red glow around intense highlights"
+ title={copy.colorGrading.halation.info}
>
ℹ
</span>
@@ -3197,7 +3189,7 @@ export default function LayersStudio({
<button
onClick={() => resetCategory("halation")}
className="flex items-center gap-1 text-[11px] font-bold text-white/40 hover:text-white transition-colors px-2 py-0.5 rounded-lg hover:bg-white/5"
- title="Reset Halation"
+ title={copy.colorGrading.halation.reset}
>
<svg
width="11"
@@ -3210,7 +3202,7 @@ export default function LayersStudio({
<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" />
<path d="M3 3v5h5" />
</svg>
- <span>Reset</span>
+ <span>{copy.common.reset}</span>
</button>
</div>
@@ -3330,7 +3322,7 @@ export default function LayersStudio({
</span>
<span
className="w-3.5 h-3.5 rounded-full border border-white/20 text-[9px] flex items-center justify-center text-white/40 cursor-help"
- title="Vignette and optical lens distortion"
+ title={copy.colorGrading.lensInstructions.info}
>
ℹ
</span>
@@ -3339,7 +3331,7 @@ export default function LayersStudio({
<button
onClick={() => resetCategory("lensInstructions")}
className="flex items-center gap-1 text-[11px] font-bold text-white/40 hover:text-white transition-colors px-2 py-0.5 rounded-lg hover:bg-white/5"
- title="Reset Lens Instructions"
+ title={copy.colorGrading.lensInstructions.reset}
>
<svg
width="11"
@@ -3352,7 +3344,7 @@ export default function LayersStudio({
<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" />
<path d="M3 3v5h5" />
</svg>
- <span>Reset</span>
+ <span>{copy.common.reset}</span>
</button>
</div>
@@ -3502,7 +3494,7 @@ export default function LayersStudio({
</span>
<span
className="w-3.5 h-3.5 rounded-full border border-white/20 text-[9px] flex items-center justify-center text-white/40 cursor-help"
- title="Exposure stops adjustment"
+ title={copy.colorGrading.exposure.info}
>
ℹ
</span>
@@ -3511,7 +3503,7 @@ export default function LayersStudio({
<button
onClick={() => resetCategory("exposure")}
className="flex items-center gap-1 text-[11px] font-bold text-white/40 hover:text-white transition-colors px-2 py-0.5 rounded-lg hover:bg-white/5"
- title="Reset Exposure"
+ title={copy.colorGrading.exposure.reset}
>
<svg
width="11"
@@ -3524,7 +3516,7 @@ export default function LayersStudio({
<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" />
<path d="M3 3v5h5" />
</svg>
- <span>Reset</span>
+ <span>{copy.common.reset}</span>
</button>
</div>
@@ -3589,7 +3581,7 @@ export default function LayersStudio({
</span>
<span
className="w-3.5 h-3.5 rounded-full border border-white/20 text-[9px] flex items-center justify-center text-white/40 cursor-help"
- title="Analog film stock grain simulation"
+ title={copy.colorGrading.filmGrain.info}
>
ℹ
</span>
@@ -3598,7 +3590,7 @@ export default function LayersStudio({
<button
onClick={() => resetCategory("filmGrain")}
className="flex items-center gap-1 text-[11px] font-bold text-white/40 hover:text-white transition-colors px-2 py-0.5 rounded-lg hover:bg-white/5"
- title="Reset Film Grain"
+ title={copy.colorGrading.filmGrain.reset}
>
<svg
width="11"
@@ -3611,7 +3603,7 @@ export default function LayersStudio({
<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" />
<path d="M3 3v5h5" />
</svg>
- <span>Reset</span>
+ <span>{copy.common.reset}</span>
</button>
</div>
@@ -3711,10 +3703,10 @@ export default function LayersStudio({
<div className="space-y-2">
<div className="flex items-center justify-between px-1">
<span className="text-[11px] font-extrabold uppercase tracking-wider text-white/40">
- Model
+ {copy.common.model}
</span>
<span className="text-[10px] font-bold text-[#a3e635] bg-[#84cc16]/15 px-2 py-0.5 rounded-md">
- 1.0 credit
+ {copy.removeBg.credit}
</span>
</div>
@@ -3731,7 +3723,7 @@ export default function LayersStudio({
</div>
<div>
<h4 className="text-sm font-bold text-white leading-tight">
- AI Background Remover
+ {copy.removeBg.modelName}
</h4>
<p className="text-[11px] text-white/50">
ai-background-remover
@@ -3744,10 +3736,10 @@ export default function LayersStudio({
<div className="bg-[#2d313d] rounded-3xl p-4 border border-white/5 space-y-3 shadow-sm">
<div className="flex items-center justify-between">
<span className="text-xs font-bold text-white">
- Target Preview
+ {copy.removeBg.targetPreview}
</span>
<span className="text-[10px] text-white/40">
- Alpha Matte Cutout
+ {copy.removeBg.alphaMatte}
</span>
</div>
@@ -3772,12 +3764,12 @@ export default function LayersStudio({
<div className="flex items-center gap-2 text-xs text-white/70">
<span className="text-[#a3e635] font-bold">✓</span>
<span>
- Precision edge extraction (hair, fur, fine contours)
+ {copy.removeBg.feature1}
</span>
</div>
<div className="flex items-center gap-2 text-xs text-white/70">
<span className="text-[#a3e635] font-bold">✓</span>
- <span>High-resolution transparent PNG output</span>
+ <span>{copy.removeBg.feature2}</span>
</div>
</div>
</div>
@@ -3791,10 +3783,10 @@ export default function LayersStudio({
<div className="space-y-2">
<div className="flex items-center justify-between px-1">
<span className="text-[11px] font-extrabold uppercase tracking-wider text-white/40">
- Model
+ {copy.common.model}
</span>
<span className="text-[10px] font-bold text-[#a3e635] bg-[#84cc16]/15 px-2 py-0.5 rounded-md">
- 0.03 credits
+ {copy.expandCrop.credit}
</span>
</div>
@@ -3816,7 +3808,7 @@ export default function LayersStudio({
</div>
<div>
<h4 className="text-sm font-bold text-white leading-tight">
- AI Image Extension
+ {copy.expandCrop.modelName}
</h4>
<p className="text-[11px] text-white/50">
ai-image-extension
@@ -3829,26 +3821,26 @@ export default function LayersStudio({
<div className="bg-[#2d313d] rounded-3xl p-4 border border-white/5 space-y-3 shadow-sm">
<div className="flex items-center justify-between">
<span className="text-xs font-bold text-white">
- Canvas Preview
+ {copy.expandCrop.canvasPreview}
</span>
<span className="text-[10px] text-white/40">
- Boundary Outpainting
+ {copy.expandCrop.boundaryOutpainting}
</span>
</div>
<div className="w-full h-44 rounded-2xl overflow-hidden relative flex items-center justify-center border border-dashed border-[#84cc16]/50 bg-[#161822] p-4">
{/* Corner Guides */}
<div className="absolute top-2 left-2 text-[#84cc16] text-[10px] font-mono">
- ↖ Expand
+ {'↖ ' + copy.expandCrop.expand}
</div>
<div className="absolute top-2 right-2 text-[#84cc16] text-[10px] font-mono">
- ↗ Expand
+ {'↗ ' + copy.expandCrop.expand}
</div>
<div className="absolute bottom-2 left-2 text-[#84cc16] text-[10px] font-mono">
- ↙ Expand
+ {'↙ ' + copy.expandCrop.expand}
</div>
<div className="absolute bottom-2 right-2 text-[#84cc16] text-[10px] font-mono">
- ↘ Expand
+ {'↘ ' + copy.expandCrop.expand}
</div>
{currentImageUrl && (
@@ -3867,13 +3859,13 @@ export default function LayersStudio({
<div className="flex items-center gap-2 text-xs text-white/70">
<span className="text-[#a3e635] font-bold">✓</span>
<span>
- Expands borders while matching lighting, style & textures
+ {copy.expandCrop.feature1}
</span>
</div>
<div className="flex items-center gap-2 text-xs text-white/70">
<span className="text-[#a3e635] font-bold">✓</span>
<span>
- Automatic intelligent edge outpainting & continuation
+ {copy.expandCrop.feature2}
</span>
</div>
</div>
@@ -3895,7 +3887,7 @@ export default function LayersStudio({
</div>
{item.isNew && (
<span className="px-2 py-0.5 text-[10px] font-black uppercase bg-[#84cc16] text-black rounded-md tracking-wider">
- New
+ {copy.menuItems.new}
</span>
)}
</button>
@@ -3907,13 +3899,13 @@ export default function LayersStudio({
{activeSideTab === "edit-text" && (
<div className="p-4 bg-[#2d313d] border border-white/10 rounded-2xl space-y-3">
<h4 className="text-xs font-bold uppercase tracking-wider text-[#a3e635]">
- Edit Text Tool
+ {copy.editText.heading}
</h4>
<input
type="text"
value={textEditPrompt}
onChange={(e) => setTextEditPrompt(e.target.value)}
- placeholder="Enter text modification prompt..."
+ placeholder={copy.editText.placeholder}
className="w-full bg-black/40 border border-white/10 rounded-xl p-2.5 text-xs text-white placeholder-white/40 focus:outline-none focus:border-[#84cc16]"
/>
<button
@@ -3921,7 +3913,7 @@ export default function LayersStudio({
disabled={isProcessing}
className="w-full py-2 bg-[#84cc16] hover:bg-[#a3e635] text-black font-bold text-xs uppercase rounded-xl shadow-md"
>
- {isProcessing ? "Processing..." : "Run Text Edit"}
+ {isProcessing ? copy.editText.processing : copy.editText.run}
</button>
</div>
)}
@@ -3929,17 +3921,17 @@ export default function LayersStudio({
{activeSideTab === "enhancer" && (
<div className="p-4 bg-[#2d313d] border border-white/10 rounded-2xl space-y-3">
<h4 className="text-xs font-bold uppercase tracking-wider text-[#a3e635]">
- AI Enhancer
+ {copy.enhancer.heading}
</h4>
<p className="text-xs text-white/60">
- Automatically optimize lighting, sharpness, and color balance.
+ {copy.enhancer.description}
</p>
<button
onClick={() => handleExecuteSideTool("enhancer")}
disabled={isProcessing}
className="w-full py-2 bg-[#84cc16] hover:bg-[#a3e635] text-black font-bold text-xs uppercase rounded-xl shadow-md"
>
- {isProcessing ? "Enhancing..." : "Enhance Image"}
+ {isProcessing ? copy.enhancer.processing : copy.enhancer.run}
</button>
</div>
)}
@@ -3947,17 +3939,17 @@ export default function LayersStudio({
{activeSideTab === "relight" && (
<div className="p-4 bg-[#2d313d] border border-white/10 rounded-2xl space-y-3">
<h4 className="text-xs font-bold uppercase tracking-wider text-[#a3e635]">
- AI Relight
+ {copy.relight.heading}
</h4>
<p className="text-xs text-white/60">
- Adjust illumination, ambient studio light, and shadows.
+ {copy.relight.description}
</p>
<button
onClick={() => handleExecuteSideTool("relight")}
disabled={isProcessing}
className="w-full py-2 bg-[#84cc16] hover:bg-[#a3e635] text-black font-bold text-xs uppercase rounded-xl shadow-md"
>
- {isProcessing ? "Relighting..." : "Apply Relight"}
+ {isProcessing ? copy.relight.processing : copy.relight.run}
</button>
</div>
)}
@@ -3965,17 +3957,17 @@ export default function LayersStudio({
{activeSideTab === "angles" && (
<div className="p-4 bg-[#2d313d] border border-white/10 rounded-2xl space-y-3">
<h4 className="text-xs font-bold uppercase tracking-wider text-[#a3e635]">
- 3D Angle Perspective
+ {copy.angles.heading}
</h4>
<p className="text-xs text-white/60">
- Adjust perspective tilt and camera angle alignment.
+ {copy.angles.description}
</p>
<button
onClick={() => handleExecuteSideTool("angles")}
disabled={isProcessing}
className="w-full py-2 bg-[#84cc16] hover:bg-[#a3e635] text-black font-bold text-xs uppercase rounded-xl shadow-md"
>
- {isProcessing ? "Transforming..." : "Apply Perspective Angle"}
+ {isProcessing ? copy.angles.processing : copy.angles.run}
</button>
</div>
)}
@@ -3990,7 +3982,7 @@ export default function LayersStudio({
className="w-full py-3.5 bg-[#e2f924] hover:bg-[#d4ed1b] active:scale-[0.98] text-black font-extrabold text-sm rounded-2xl shadow-[0_4px_25px_rgba(226,249,36,0.35)] transition-all flex items-center justify-center gap-2 tracking-tight disabled:opacity-50"
>
{isProcessing ? (
- <span>Decomposing ({progress}%)...</span>
+ <span>{copy.footer.decomposing.replace('{progress}', progress)}</span>
) : (
<>
<svg
@@ -4001,7 +3993,7 @@ export default function LayersStudio({
>
<path d="M12 2L14.4 7.6L20 10L14.4 12.4L12 18L9.6 12.4L4 10L9.6 7.6L12 2Z" />
</svg>
- <span>Separate layers {layerCount > 4 ? 12 : 8}</span>
+ <span>{copy.footer.separateLayers.replace('{count}', layerCount > 4 ? 12 : 8)}</span>
</>
)}
</button>
@@ -4012,7 +4004,7 @@ export default function LayersStudio({
className="w-full py-3.5 bg-[#e2f924] hover:bg-[#d4ed1b] active:scale-[0.98] text-black font-extrabold text-sm rounded-2xl shadow-[0_4px_25px_rgba(226,249,36,0.35)] transition-all flex items-center justify-center gap-2 tracking-tight disabled:opacity-50"
>
{isProcessing ? (
- <span>Upscaling ({progress}%)...</span>
+ <span>{copy.footer.upscaling.replace('{progress}', progress)}</span>
) : (
<>
<svg
@@ -4024,10 +4016,10 @@ export default function LayersStudio({
<path d="M12 2L14.4 7.6L20 10L14.4 12.4L12 18L9.6 12.4L4 10L9.6 7.6L12 2Z" />
</svg>
<span>
- Upscale{" "}
- {upscaleModel === "seedvr2-image-upscale"
- ? "0.02"
- : "1.0"}
+ {copy.footer.upscaleCost.replace(
+ '{cost}',
+ upscaleModel === "seedvr2-image-upscale" ? "0.02" : "1.0",
+ )}
</span>
</>
)}
@@ -4037,7 +4029,7 @@ export default function LayersStudio({
<button
onClick={handleResetAllColorGrading}
className="w-12 h-12 rounded-2xl bg-white/10 hover:bg-white/15 text-white flex items-center justify-center transition-all border border-white/10 hover:border-white/20 flex-shrink-0"
- title="Reset All Color Grading"
+ title={copy.colorGrading.resetAll}
>
<svg
width="18"
@@ -4078,7 +4070,7 @@ export default function LayersStudio({
className="w-full py-3.5 bg-[#e2f924] hover:bg-[#d4ed1b] active:scale-[0.98] text-black font-extrabold text-sm rounded-2xl shadow-[0_4px_25px_rgba(226,249,36,0.35)] transition-all flex items-center justify-center gap-2 tracking-tight disabled:opacity-50"
>
{isProcessing ? (
- <span>Removing background ({progress}%)...</span>
+ <span>{copy.footer.removingBackground.replace('{progress}', progress)}</span>
) : (
<>
<svg
@@ -4089,7 +4081,7 @@ export default function LayersStudio({
>
<path d="M12 2L14.4 7.6L20 10L14.4 12.4L12 18L9.6 12.4L4 10L9.6 7.6L12 2Z" />
</svg>
- <span>Remove Background 1.0</span>
+ <span>{copy.footer.removeBackgroundCost}</span>
</>
)}
</button>
@@ -4100,7 +4092,7 @@ export default function LayersStudio({
className="w-full py-3.5 bg-[#e2f924] hover:bg-[#d4ed1b] active:scale-[0.98] text-black font-extrabold text-sm rounded-2xl shadow-[0_4px_25px_rgba(226,249,36,0.35)] transition-all flex items-center justify-center gap-2 tracking-tight disabled:opacity-50"
>
{isProcessing ? (
- <span>Expanding borders ({progress}%)...</span>
+ <span>{copy.footer.expandingBorders.replace('{progress}', progress)}</span>
) : (
<>
<svg
@@ -4111,7 +4103,7 @@ export default function LayersStudio({
>
<path d="M12 2L14.4 7.6L20 10L14.4 12.4L12 18L9.6 12.4L4 10L9.6 7.6L12 2Z" />
</svg>
- <span>Expand Image 0.03</span>
+ <span>{copy.footer.expandImageCost}</span>
</>
)}
</button>
diff --git a/packages/studio/src/components/LipSyncStudio.jsx b/packages/studio/src/components/LipSyncStudio.jsx
index cc65cdd0..bcd933fb 100644
--- a/packages/studio/src/components/LipSyncStudio.jsx
+++ b/packages/studio/src/components/LipSyncStudio.jsx
@@ -33,6 +33,9 @@ import {
promptControlClassName,
promptMediaButtonClassName,
} from "./prompt/PromptComposer.jsx";
+import en from "../messages/en/lipSyncStudio.json";
+import zh from "../messages/zh/lipSyncStudio.json";
+import { resolveCopy } from "../i18nUtils";
// ---------------------------------------------------------------------------
// Upload button states
@@ -55,6 +58,7 @@ function MediaPickerButton({
previewUrl,
isVideo,
apiKey,
+ mediaCopy = en.media,
}) {
const inputRef = useRef(null);
const [isDragging, setIsDragging] = useState(false);
@@ -121,8 +125,8 @@ function MediaPickerButton({
type="button"
title={
uploadState === UPLOAD_STATE.READY
- ? `${fileName} — click to clear`
- : `Upload ${label.toLowerCase()} file`
+ ? `${fileName} — ${mediaCopy.clickToClear}`
+ : `${mediaCopy.uploadFilePrefix} ${label} ${mediaCopy.uploadFileSuffix}`
}
onClick={handleClick}
onDragEnter={handleDragEnter}
@@ -375,7 +379,9 @@ export default function LipSyncStudio({
historyItems,
droppedFiles,
onFilesHandled,
+ locale = "en",
}) {
+ const copy = resolveCopy(en, zh, locale);
const LEGACY_PERSIST_KEY = "hg_lipsync_studio_persistent";
const PERSIST_KEY = scopedPersistKey(LEGACY_PERSIST_KEY, apiKey);
useEffect(() => {
@@ -532,7 +538,7 @@ export default function LipSyncStudio({
const file = Array.isArray(files) ? files[0] : files;
if (!file) return;
if (file.size > 10 * 1024 * 1024) {
- alert("Image exceeds 10MB limit.");
+ alert(copy.errors.imageTooLarge);
return;
}
setImageState(UPLOAD_STATE.UPLOADING);
@@ -546,7 +552,7 @@ export default function LipSyncStudio({
setImageState(UPLOAD_STATE.READY);
} catch (err) {
setImageState(UPLOAD_STATE.IDLE);
- alert(`Image upload failed: ${err.message}`);
+ alert(copy.errors.imageUploadFailed.replace("{message}", err.message));
} finally {
setImageProgress(0);
}
@@ -559,7 +565,7 @@ export default function LipSyncStudio({
const file = Array.isArray(files) ? files[0] : files;
if (!file) return;
if (file.size > 50 * 1024 * 1024) {
- alert("Video exceeds 50MB limit.");
+ alert(copy.errors.videoTooLarge);
return;
}
setVideoState(UPLOAD_STATE.UPLOADING);
@@ -573,7 +579,7 @@ export default function LipSyncStudio({
setVideoState(UPLOAD_STATE.READY);
} catch (err) {
setVideoState(UPLOAD_STATE.IDLE);
- alert(`Video upload failed: ${err.message}`);
+ alert(copy.errors.videoUploadFailed.replace("{message}", err.message));
} finally {
setVideoProgress(0);
}
@@ -590,7 +596,7 @@ export default function LipSyncStudio({
const file = Array.isArray(files) ? files[0] : files;
if (!file) return;
if (file.size > 10 * 1024 * 1024) {
- alert("Audio file exceeds 10MB limit.");
+ alert(copy.errors.audioTooLarge);
return;
}
setAudioState(UPLOAD_STATE.UPLOADING);
@@ -604,7 +610,7 @@ export default function LipSyncStudio({
setAudioState(UPLOAD_STATE.READY);
} catch (err) {
setAudioState(UPLOAD_STATE.IDLE);
- alert(`Audio upload failed: ${err.message}`);
+ alert(copy.errors.audioUploadFailed.replace("{message}", err.message));
} finally {
setAudioProgress(0);
}
@@ -695,15 +701,15 @@ export default function LipSyncStudio({
// ── Generation ──────────────────────────────────────────────────────────
const handleGenerate = async () => {
if (!audioUrl) {
- alert("Please upload an audio file first.");
+ alert(copy.errors.needAudio);
return;
}
if (inputMode === "image" && !imageUrl) {
- alert("Please upload a portrait image first.");
+ alert(copy.errors.needImage);
return;
}
if (inputMode === "video" && !videoUrl) {
- alert("Please upload a source video first.");
+ alert(copy.errors.needVideo);
return;
}
@@ -751,7 +757,7 @@ export default function LipSyncStudio({
}
} catch (e) {
console.error("[LipSyncStudio]", e);
- const errMsg = formatErrorMessage(e, "Lip sync generation failed");
+ const errMsg = formatErrorMessage(e, copy.errors.generationFailed);
if (onGenerationError) onGenerationError(errMsg);
else toast.error(errMsg);
} finally {
@@ -781,17 +787,17 @@ export default function LipSyncStudio({
inputMode === "image"
? imageState === UPLOAD_STATE.READY
? `✓ ${imageName}`
- : "No image"
+ : copy.media.noImage
: videoState === UPLOAD_STATE.READY
? `✓ ${videoName}`
- : "No video";
+ : copy.media.noVideo;
const mediaStatusClass =
(inputMode === "image" ? imageState : videoState) === UPLOAD_STATE.READY
? "text-primary"
: "text-muted";
const audioStatusText =
- audioState === UPLOAD_STATE.READY ? `✓ ${audioName}` : "No audio";
+ audioState === UPLOAD_STATE.READY ? `✓ ${audioName}` : copy.media.noAudio;
const audioStatusClass =
audioState === UPLOAD_STATE.READY ? "text-primary" : "text-muted";
@@ -840,7 +846,7 @@ export default function LipSyncStudio({
/>
<button
type="button"
- title="Download"
+ title={copy.actions.download}
onClick={(e) => {
e.stopPropagation();
downloadFile(entry.url, `lipsync-${entry.id || idx}.mp4`);
@@ -853,10 +859,10 @@ export default function LipSyncStudio({
</button>
<button
type="button"
- title="Delete"
+ title={copy.actions.delete}
onClick={(e) => {
e.stopPropagation();
- if (confirm("Are you sure you want to delete this generated item?")) {
+ if (confirm(copy.confirm.deleteItem)) {
setInternalHistory(prev => prev.filter((_, i) => i !== idx));
}
}}
@@ -876,16 +882,16 @@ export default function LipSyncStudio({
actions={[
{
kind: "download",
- label: "Download",
+ label: copy.actions.download,
onSelect: () =>
downloadFile(entry.url, `lipsync-${entry.id || idx}.mp4`),
},
{
kind: "delete",
- label: "Delete",
+ label: copy.actions.delete,
danger: true,
onSelect: () => {
- if (confirm("Are you sure you want to delete this generated item?")) {
+ if (confirm(copy.confirm.deleteItem)) {
setInternalHistory((prev) => prev.filter((_, i) => i !== idx));
}
},
@@ -903,7 +909,7 @@ export default function LipSyncStudio({
<div className="flex items-center justify-between flex-wrap gap-1 mt-1">
<div className="flex items-center gap-2">
<span className="text-[10px] font-bold text-primary px-2 py-0.5 bg-primary/10 rounded border border-primary/20 whitespace-nowrap">
- Lip Sync
+ {copy.badges.lipSync}
</span>
{entry.resolution && (
<span className="text-[10px] text-white/40">{entry.resolution}</span>
@@ -949,13 +955,13 @@ export default function LipSyncStudio({
</div>
<h1 className="text-2xl sm:text-4xl md:text-5xl font-extrabold tracking-tight mb-4 text-center px-4 flex flex-col items-center">
- <span className="text-white font-black uppercase text-xl sm:text-3xl tracking-wide mb-1 opacity-90">START CREATING WITH</span>
+ <span className="text-white font-black uppercase text-xl sm:text-3xl tracking-wide mb-1 opacity-90">{copy.hero.titleLine1}</span>
<span className="text-[#22d3ee] font-black uppercase text-2xl sm:text-4xl sm:mt-1 tracking-tight">
- LIP SYNC STUDIO
+ {copy.hero.titleLine2}
</span>
</h1>
<p className="text-white/40 text-xs sm:text-sm font-medium tracking-wide text-center max-w-lg leading-relaxed px-4">
- Sync any voice with any face video to create premium talking avatars and videos.
+ {copy.hero.subtitle}
</p>
</div>
)}
@@ -976,7 +982,7 @@ export default function LipSyncStudio({
<circle cx="8.5" cy="8.5" r="1.5" />
<path d="m21 15-5-5L5 21" />
</svg>
- Portrait Image
+ {copy.modes.portraitImage}
</PromptSegmentOption>
<PromptSegmentOption
type="button"
@@ -987,7 +993,7 @@ export default function LipSyncStudio({
<rect x="2" y="5" width="15" height="14" rx="2" />
<path d="m17 10 5-3v10l-5-3" />
</svg>
- Video
+ {copy.modes.video}
</PromptSegmentOption>
</PromptSegmentedControl>
</div>
@@ -999,7 +1005,8 @@ export default function LipSyncStudio({
{inputMode === "image" && (
<MediaPickerButton
accept="image/*"
- label="Image"
+ label={copy.media.imageLabel}
+ mediaCopy={copy.media}
icon={
<svg
width="16"
@@ -1034,7 +1041,8 @@ export default function LipSyncStudio({
{inputMode === "video" && (
<MediaPickerButton
accept="video/*"
- label="Video"
+ label={copy.media.videoLabel}
+ mediaCopy={copy.media}
icon={
<VideoIcon className="text-white/40 group-hover:text-[#22d3ee] transition-colors" />
}
@@ -1056,7 +1064,8 @@ export default function LipSyncStudio({
{/* Audio picker — always visible */}
<MediaPickerButton
accept="audio/*"
- label="Audio"
+ label={copy.media.audioLabel}
+ mediaCopy={copy.media}
icon={
<MicIcon className="text-white/40 group-hover:text-[#22d3ee] transition-colors" />
}
@@ -1081,7 +1090,7 @@ export default function LipSyncStudio({
ref={textareaRef}
value={prompt}
onChange={handlePromptInput}
- placeholder="Describe speech style..."
+ placeholder={copy.prompt.placeholder}
/>
</div>
</div>
@@ -1110,13 +1119,13 @@ export default function LipSyncStudio({
</span>
</div>
<span className={PROMPT_CONTROL_LABEL_CLASS}>
- {selectedModel?.name ?? "Select model"}
+ {selectedModel?.name ?? copy.model.selectModel}
</span>
<PromptChevronIcon />
</button>
<Dropdown
isOpen={openDropdown === "model"}
- title="Model"
+ title={copy.model.dropdownTitle}
items={modelDropdownItems}
selectedId={selectedModelId}
onSelect={handleModelSelect}
@@ -1149,7 +1158,7 @@ export default function LipSyncStudio({
</button>
<Dropdown
isOpen={openDropdown === "resolution"}
- title="Resolution"
+ title={copy.model.resolutionDropdownTitle}
items={resolutionDropdownItems}
selectedId={selectedResolution}
onSelect={(item) => setSelectedResolution(item.id)}
@@ -1170,11 +1179,11 @@ export default function LipSyncStudio({
<span className="animate-spin inline-block text-black">
◌
</span>{" "}
- Generating...
+ {copy.actions.generating}
</>
) : (
<>
- <span>Sync Lip</span>
+ <span>{copy.actions.generate}</span>
</>
)}
</PromptAction>
diff --git a/packages/studio/src/components/MarketingStudio.jsx b/packages/studio/src/components/MarketingStudio.jsx
index 67ed9eb2..13613974 100644
--- a/packages/studio/src/components/MarketingStudio.jsx
+++ b/packages/studio/src/components/MarketingStudio.jsx
@@ -24,6 +24,9 @@ import {
promptControlClassName,
promptMediaButtonClassName,
} from "./prompt/PromptComposer.jsx";
+import en from "../messages/en/marketingStudio.json";
+import zh from "../messages/zh/marketingStudio.json";
+import { resolveCopy } from "../i18nUtils";
const SCROLLBAR_STYLE = `
.custom-scrollbar-thin::-webkit-scrollbar {
@@ -117,7 +120,7 @@ const OPTIONS = {
// ── Components ───────────────────────────────────────────────────────────────
-function UploadSlot({ icon, url, progress, label, onUpload, onClear, multiple = false, images = [] }) {
+function UploadSlot({ icon, url, progress, label, title, onUpload, onClear, multiple = false, images = [] }) {
const inputRef = useRef(null);
const [isDraggingSlot, setIsDraggingSlot] = useState(false);
const dragCounterRef = useRef(0);
@@ -165,7 +168,7 @@ function UploadSlot({ icon, url, progress, label, onUpload, onClear, multiple =
onDragLeave={handleSlotDragLeave}
onDragOver={handleSlotDragOver}
onDrop={handleSlotDrop}
- title={`Upload ${label}`}
+ title={title}
className={promptMediaButtonClassName({
active: Boolean(url) || isDraggingSlot,
className: `cursor-pointer${isDraggingSlot ? " ring-2 ring-primary ring-offset-1 ring-offset-black/40" : ""}`,
@@ -240,7 +243,7 @@ function Dropdown({ isOpen, title, items, selectedId, onSelect, onClose, isVideo
{onPreview && !isVideo && (
<button
type="button"
- title="Enlarge preview"
+ title={copy.buttons.enlargePreview}
onClick={(e) => {
e.stopPropagation();
onPreview(item);
@@ -321,7 +324,9 @@ export default function MarketingStudio({
onGenerationComplete,
onGenerationError,
historyItems,
+ locale = "en",
}) {
+ const copy = resolveCopy(en, zh, locale);
const LEGACY_PERSIST_KEY = "hg_marketing_studio_persistent";
const PERSIST_KEY = scopedPersistKey(LEGACY_PERSIST_KEY, apiKey);
useEffect(() => {
@@ -421,8 +426,8 @@ export default function MarketingStudio({
};
const handleGenerate = async () => {
- if (!prompt.trim()) return alert("Please enter an ad script.");
- if (!productImage) return alert("Please upload a product image.");
+ if (!prompt.trim()) return alert(copy.errors.missingScript);
+ if (!productImage) return alert(copy.errors.missingProductImage);
onGenerationStart?.();
setIsGenerating(true);
@@ -451,7 +456,7 @@ export default function MarketingStudio({
onGenerationComplete?.({ url: result.url, type: "video" });
}
} catch (err) {
- onGenerationError?.(err.message?.slice(0, 120) || "Marketing generation failed");
+ onGenerationError?.(err.message?.slice(0, 120) || copy.errors.generationFailed);
} finally {
setIsGenerating(false);
onGenerationEnd?.();
@@ -489,7 +494,7 @@ export default function MarketingStudio({
<button
onClick={(e) => { e.stopPropagation(); downloadFile(entry.url, `marketing-ad-${entry.id}.mp4`); }}
className="p-2 bg-black/60 backdrop-blur-md rounded-full text-white hover:bg-primary hover:text-black transition-all border border-white/10"
- title="Download"
+ title={copy.buttons.download}
>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
<path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3" />
@@ -497,10 +502,10 @@ export default function MarketingStudio({
</button>
<button
type="button"
- title="Delete"
+ title={copy.buttons.delete}
onClick={(e) => {
e.stopPropagation();
- if (confirm("Are you sure you want to delete this generated item?")) {
+ if (confirm(copy.confirm.deleteItem)) {
if (!historyItems) {
setLocalHistory(prev => prev.filter(h => h.id !== entry.id));
}
@@ -522,16 +527,16 @@ export default function MarketingStudio({
actions={[
{
kind: "download",
- label: "Download",
+ label: copy.buttons.download,
onSelect: () =>
downloadFile(entry.url, `marketing-ad-${entry.id}.mp4`),
},
{
kind: "delete",
- label: "Delete",
+ label: copy.buttons.delete,
danger: true,
onSelect: () => {
- if (confirm("Are you sure you want to delete this generated item?")) {
+ if (confirm(copy.confirm.deleteItem)) {
if (!historyItems) {
setLocalHistory((prev) =>
prev.filter((item) => item.id !== entry.id),
@@ -546,7 +551,7 @@ export default function MarketingStudio({
<div className="p-3 bg-black/80 backdrop-blur-sm border-t border-white/5 flex items-center justify-between gap-2">
<div className="flex items-center gap-2">
<span className="text-[9px] font-black text-primary px-2 py-0.5 bg-primary/10 rounded border border-primary/20 uppercase tracking-tighter">
- Marketing Studio
+ {copy.history.badge}
</span>
{entry.format && (
<span className="text-[9px] text-white/40 font-bold">{entry.format}</span>
@@ -563,41 +568,41 @@ export default function MarketingStudio({
<div className="w-18 h-22 sm:w-24 sm:h-28 rounded-2xl border border-white/10 shadow-2xl -rotate-[12deg] transform hover:rotate-0 hover:scale-110 hover:z-20 transition-all duration-300 overflow-hidden bg-white/[0.01] flex-shrink-0">
<img
src="https://d3adwkbyhxyrtq.cloudfront.net/webassets/videomodels/sdxl-image.avif"
- alt="Creative asset 1"
+ alt={copy.alt.creativeAsset.replace("{index}", "1")}
className="w-full h-full object-cover"
/>
</div>
<div className="w-18 h-22 sm:w-24 sm:h-28 rounded-2xl border border-white/10 shadow-2xl -rotate-[4deg] transform hover:rotate-0 hover:scale-110 hover:z-20 transition-all duration-300 overflow-hidden bg-white/[0.01] -ml-3 sm:-ml-4 flex-shrink-0">
<img
src="https://d3adwkbyhxyrtq.cloudfront.net/webassets/videomodels/chroma-image.avif"
- alt="Creative asset 2"
+ alt={copy.alt.creativeAsset.replace("{index}", "2")}
className="w-full h-full object-cover"
/>
</div>
<div className="w-18 h-18 sm:w-24 sm:h-24 rounded-full border border-white/10 shadow-2xl rotate-[6deg] transform hover:rotate-0 hover:scale-110 hover:z-20 transition-all duration-300 overflow-hidden bg-white/[0.01] -ml-3 sm:-ml-4 flex-shrink-0">
<img
src="https://d3adwkbyhxyrtq.cloudfront.net/webassets/videomodels/neta-lumina.avif"
- alt="Creative asset 3"
+ alt={copy.alt.creativeAsset.replace("{index}", "3")}
className="w-full h-full object-cover"
/>
</div>
<div className="w-18 h-22 sm:w-24 sm:h-28 rounded-2xl border border-white/10 shadow-2xl rotate-[12deg] transform hover:rotate-0 hover:scale-110 hover:z-20 transition-all duration-300 overflow-hidden bg-white/[0.01] -ml-3 sm:-ml-4 flex-shrink-0">
<img
src="https://d3adwkbyhxyrtq.cloudfront.net/webassets/videomodels/perfect-pony-xl.avif"
- alt="Creative asset 4"
+ alt={copy.alt.creativeAsset.replace("{index}", "4")}
className="w-full h-full object-cover"
/>
</div>
</div>
<h1 className="text-2xl sm:text-4xl md:text-5xl font-extrabold tracking-tight mb-4 text-center px-4 flex flex-col items-center">
- <span className="text-white font-black uppercase text-xl sm:text-3xl tracking-wide mb-1 opacity-90">START CREATING WITH</span>
+ <span className="text-white font-black uppercase text-xl sm:text-3xl tracking-wide mb-1 opacity-90">{copy.empty.titleLine1}</span>
<span className="text-[#22d3ee] font-black uppercase text-2xl sm:text-4xl sm:mt-1 tracking-tight">
- MARKETING STUDIO
+ {copy.empty.titleLine2}
</span>
</h1>
<p className="text-white/40 text-xs sm:text-sm font-medium tracking-wide text-center max-w-lg leading-relaxed px-4">
- Describe your scene, upload your product, and watch high-converting AI video ads come to life.
+ {copy.empty.subtitle}
</p>
</div>
)}
@@ -626,7 +631,7 @@ export default function MarketingStudio({
ref={textareaRef}
value={prompt}
onChange={(e) => setPrompt(e.target.value)}
- placeholder="Describe your ad script... Use @image1 for product, @image2 for avatar."
+ placeholder={copy.prompt.placeholder}
/>
</div>
@@ -637,7 +642,8 @@ export default function MarketingStudio({
{/* Asset Uploads Group */}
<div className="flex items-center gap-1.5 pr-3 border-r border-white/10">
<UploadSlot
- label="Product"
+ label={copy.uploadSlots.product}
+ title={`${copy.uploadSlots.uploadPrefix} ${copy.uploadSlots.product}`}
icon={<ProductIcon />}
url={productImage}
progress={uploadProgress.product}
@@ -645,7 +651,8 @@ export default function MarketingStudio({
onClear={() => setProductImage(null)}
/>
<UploadSlot
- label="Avatar"
+ label={copy.uploadSlots.avatar}
+ title={`${copy.uploadSlots.uploadPrefix} ${copy.uploadSlots.avatar}`}
icon={<AvatarIcon />}
url={avatarImage}
progress={uploadProgress.avatar}
@@ -653,7 +660,8 @@ export default function MarketingStudio({
onClear={() => setAvatarImage(null)}
/>
<UploadSlot
- label="References"
+ label={copy.uploadSlots.references}
+ title={`${copy.uploadSlots.uploadPrefix} ${copy.uploadSlots.references}`}
icon={<RefIcon />}
url={additionalImages[0]}
progress={uploadProgress.additional}
@@ -686,7 +694,7 @@ export default function MarketingStudio({
</button>
<Dropdown
isOpen={dropdown === 'format'}
- title="Video Format Presets"
+ title={copy.dropdowns.videoFormatPresets}
items={ASSETS.ugc}
selectedId={params.format}
onSelect={(item) => setParams({ ...params, format: item.name, videoUrl: item.url })}
@@ -707,7 +715,7 @@ export default function MarketingStudio({
<img src={avatarImage || ASSETS.avatar[0].url} className="w-full h-full object-cover" />
</div>
<span className={PROMPT_CONTROL_LABEL_CLASS}>
- {ASSETS.avatar.find(a => a.url === avatarImage)?.name || "Select Avatar"}
+ {ASSETS.avatar.find(a => a.url === avatarImage)?.name || copy.dropdowns.selectAvatarFallback}
</span>
<PromptChevronIcon />
</button>
@@ -715,7 +723,7 @@ export default function MarketingStudio({
{avatarImage && (
<button
type="button"
- title="Enlarge selected avatar"
+ title={copy.buttons.enlargeSelectedAvatar}
onClick={(e) => {
e.stopPropagation();
const currentAvatar = ASSETS.avatar.find(a => a.url === avatarImage);
@@ -741,7 +749,7 @@ export default function MarketingStudio({
<Dropdown
isOpen={dropdown === 'avatar'}
- title="Avatar Presets"
+ title={copy.dropdowns.avatarPresets}
items={ASSETS.avatar}
selectedId={avatarImage}
onSelect={(item) => setAvatarImage(item.url)}
@@ -778,10 +786,10 @@ export default function MarketingStudio({
isOpen={dropdown === key}
title={
key === "ratio"
- ? "Aspect Ratio"
+ ? copy.dropdowns.aspectRatio
: key === "res"
- ? "Resolution"
- : "Duration"
+ ? copy.dropdowns.resolution
+ : copy.dropdowns.duration
}
options={OPTIONS[key]}
selected={params[key]}
@@ -799,10 +807,10 @@ export default function MarketingStudio({
{isGenerating ? (
<>
<span className="animate-spin inline-block text-black">◌</span>
- Generating...
+ {copy.buttons.generating}
</>
) : (
- <span>Launch</span>
+ <span>{copy.buttons.launch}</span>
)}
</PromptAction>
</PromptFooter>
@@ -928,7 +936,7 @@ export default function MarketingStudio({
>
<img
src={ASSETS.avatar[(ASSETS.avatar.findIndex(a => a.id === previewAvatar.id) - 1 + ASSETS.avatar.length) % ASSETS.avatar.length].url}
- alt="Previous Avatar"
+ alt={copy.alt.previousAvatar}
className="w-full h-full object-cover aspect-[3/4]"
/>
</div>
@@ -966,7 +974,7 @@ export default function MarketingStudio({
className="bg-[#22d3ee] text-black px-6 py-2.5 rounded-full font-bold text-sm hover:opacity-95 hover:scale-105 active:scale-95 transition-all flex items-center justify-center gap-1.5 shadow-lg shadow-[#22d3ee]/20"
>
<CheckSvg />
- Select Avatar
+ {copy.buttons.selectAvatar}
</button>
</div>
</div>
@@ -988,7 +996,7 @@ export default function MarketingStudio({
>
<img
src={ASSETS.avatar[(ASSETS.avatar.findIndex(a => a.id === previewAvatar.id) + 1) % ASSETS.avatar.length].url}
- alt="Next Avatar"
+ alt={copy.alt.nextAvatar}
className="w-full h-full object-cover aspect-[3/4]"
/>
</div>
diff --git a/packages/studio/src/components/McpCliStudio.jsx b/packages/studio/src/components/McpCliStudio.jsx
index b4f7bc0e..d7f4903d 100644
--- a/packages/studio/src/components/McpCliStudio.jsx
+++ b/packages/studio/src/components/McpCliStudio.jsx
@@ -2,14 +2,20 @@
import React from 'react';
import { FaGithub, FaTerminal, FaPlug, FaStar, FaExternalLinkAlt } from 'react-icons/fa';
+import en from '../messages/en/mcpCliStudio.json';
+import zh from '../messages/zh/mcpCliStudio.json';
+import { resolveCopy } from '../i18nUtils';
+// `title`/`tag` stay canonical (product/package names and short technical
+// category tags); `id` keys into copy.features/copy.quickStart/copy.examples
+// for the translated description/label. `code` blocks are technical and
+// never translated.
const FEATURES = [
{
+ id: 'cli',
tag: 'CLI',
title: 'muapi-cli',
icon: FaTerminal,
- description:
- 'Generate images, videos, and audio from the terminal across 14+ AI models. Dual interface — colored human output plus JSON for agents (--output-json, --jq filtering). Async workflows, file uploads, credit tracking.',
code: `npm install -g muapi-cli
muapi auth login
muapi image generate "a cyberpunk city" \\
@@ -17,38 +23,36 @@ muapi image generate "a cyberpunk city" \\
href: 'https://github.com/SamurAIGPT/muapi-cli',
},
{
+ id: 'mcp',
tag: 'MCP',
title: 'muapi-mcp-server',
icon: FaPlug,
- description:
- 'Connect Claude, Cursor, Windsurf, and any MCP-compatible assistant to 100+ generative models. Hosted endpoint — no install. 19 structured tools with input/output schemas, async polling, and account management.',
code: `claude mcp add --transport http muapi \\
https://api.muapi.ai/mcp \\
--header "Authorization: Bearer YOUR_KEY"`,
href: 'https://github.com/SamurAIGPT/muapi-mcp-server',
},
{
+ id: 'skills',
tag: 'Skills',
title: 'Generative Media Skills',
icon: FaStar,
- description:
- 'Multimodal toolkit for Claude Code, Cursor, and Gemini CLI. Cinema Director, Nano-Banana, UI Designer, Logo Creator, Seedance 2, AI Clipping, and YouTube Shorts presets. Agent-native with JSON outputs and semantic exit codes.',
code: `npx skills add SamurAIGPT/Generative-Media-Skills --all`,
href: 'https://github.com/SamurAIGPT/Generative-Media-Skills',
},
];
const QUICK_STEPS = [
- { num: '1', title: 'Install the CLI', code: 'npm install -g muapi-cli' },
- { num: '2', title: 'Sign in', code: 'muapi auth login' },
- { num: '3', title: 'Add the skills', code: 'npx skills add SamurAIGPT/Generative-Media-Skills' },
+ { id: 'installCli', num: '1', code: 'npm install -g muapi-cli' },
+ { id: 'signIn', num: '2', code: 'muapi auth login' },
+ { id: 'addSkills', num: '3', code: 'npx skills add SamurAIGPT/Generative-Media-Skills' },
];
const EXAMPLES = [
- { title: 'Image generation', code: 'muapi image generate "a serene mountain lake at sunrise" \\\n --model flux-dev --download ./outputs' },
- { title: 'Text-to-video', code: 'muapi video generate "a dog running on a beach" \\\n --model kling-master' },
- { title: 'Audio creation', code: 'muapi audio create "upbeat lo-fi hip hop for studying"' },
- { title: 'Run a skill', code: 'bash library/visual/nano-banana/scripts/\\\n generate-nano-art.sh --file image.jpg --view' },
+ { id: 'imageGeneration', code: 'muapi image generate "a serene mountain lake at sunrise" \\\n --model flux-dev --download ./outputs' },
+ { id: 'textToVideo', code: 'muapi video generate "a dog running on a beach" \\\n --model kling-master' },
+ { id: 'audioCreation', code: 'muapi audio create "upbeat lo-fi hip hop for studying"' },
+ { id: 'runSkill', code: 'bash library/visual/nano-banana/scripts/\\\n generate-nano-art.sh --file image.jpg --view' },
];
function CodeBlock({ children, className = '' }) {
@@ -61,7 +65,9 @@ function CodeBlock({ children, className = '' }) {
);
}
-export default function McpCliStudio() {
+export default function McpCliStudio({ locale = 'en' }) {
+ const copy = resolveCopy(en, zh, locale);
+
return (
<div className="w-full h-full overflow-y-auto bg-[#050505] text-white">
<div className="max-w-5xl mx-auto px-6 py-12 flex flex-col gap-12">
@@ -69,20 +75,18 @@ export default function McpCliStudio() {
{/* Hero */}
<section className="flex flex-col items-center text-center gap-4">
<div className="px-3 py-1 rounded-full border border-white/10 bg-white/5 text-[11px] font-bold uppercase tracking-widest text-white/60">
- For developers &amp; AI agents
+ {copy.hero.badge}
</div>
- <h1 className="text-4xl md:text-5xl font-bold tracking-tight">MCP &amp; CLI</h1>
+ <h1 className="text-4xl md:text-5xl font-bold tracking-tight">{copy.hero.title}</h1>
<p className="text-white/60 text-base md:text-lg max-w-2xl">
- Use Open Generative AI from your terminal, your IDE, or any MCP-compatible
- assistant. Generate cinematic images, videos, and audio across 100+ models —
- without leaving your workflow.
+ {copy.hero.description}
</p>
</section>
{/* Quick start */}
<section className="rounded-2xl border border-white/5 bg-white/[0.02] p-6 md:p-8 flex flex-col gap-4">
<div className="flex items-center gap-2">
- <span className="text-[11px] font-bold uppercase tracking-widest text-white/50">Quick start</span>
+ <span className="text-[11px] font-bold uppercase tracking-widest text-white/50">{copy.quickStart.sectionLabel}</span>
<div className="flex-1 h-px bg-white/5" />
</div>
<div className="grid md:grid-cols-3 gap-4">
@@ -95,7 +99,7 @@ export default function McpCliStudio() {
<span className="w-6 h-6 rounded-full bg-white text-black text-xs font-bold flex items-center justify-center">
{step.num}
</span>
- <span className="text-sm font-bold">{step.title}</span>
+ <span className="text-sm font-bold">{copy.quickStart.steps[step.id]}</span>
</div>
<CodeBlock className="text-[11.5px]">{step.code}</CodeBlock>
</div>
@@ -122,11 +126,11 @@ export default function McpCliStudio() {
<span className="text-[10px] font-bold uppercase tracking-widest text-white/50">{f.tag}</span>
</div>
<h3 className="text-lg font-bold">{f.title}</h3>
- <p className="text-[13px] text-white/60 leading-relaxed">{f.description}</p>
+ <p className="text-[13px] text-white/60 leading-relaxed">{copy.features[f.id].description}</p>
<CodeBlock>{f.code}</CodeBlock>
<div className="mt-auto flex items-center gap-1.5 text-[12px] font-bold text-white/50 group-hover:text-white transition-colors">
<FaGithub className="text-sm" />
- <span>View on GitHub</span>
+ <span>{copy.viewOnGithub}</span>
<FaExternalLinkAlt className="text-[10px]" />
</div>
</a>
@@ -137,16 +141,16 @@ export default function McpCliStudio() {
{/* Examples */}
<section className="flex flex-col gap-4">
<div className="flex items-center gap-2">
- <span className="text-[11px] font-bold uppercase tracking-widest text-white/50">Examples</span>
+ <span className="text-[11px] font-bold uppercase tracking-widest text-white/50">{copy.examples.sectionLabel}</span>
<div className="flex-1 h-px bg-white/5" />
</div>
<div className="grid md:grid-cols-2 gap-4">
{EXAMPLES.map((ex) => (
<div
- key={ex.title}
+ key={ex.id}
className="rounded-xl border border-white/5 bg-white/[0.02] p-4 flex flex-col gap-2"
>
- <span className="text-[12px] font-bold text-white/80">{ex.title}</span>
+ <span className="text-[12px] font-bold text-white/80">{copy.examples[ex.id]}</span>
<CodeBlock>{ex.code}</CodeBlock>
</div>
))}
@@ -154,7 +158,7 @@ export default function McpCliStudio() {
</section>
<p className="text-center text-xs text-white/40 pb-4">
- Open-source · MIT licensed · Works with Claude, Cursor, Windsurf, and Gemini CLI
+ {copy.footer}
</p>
</div>
</div>
diff --git a/packages/studio/src/components/RecastStudio.jsx b/packages/studio/src/components/RecastStudio.jsx
index df57147f..fc570cd0 100644
--- a/packages/studio/src/components/RecastStudio.jsx
+++ b/packages/studio/src/components/RecastStudio.jsx
@@ -29,6 +29,9 @@ import {
promptControlClassName,
promptMediaButtonClassName,
} from "./prompt/PromptComposer.jsx";
+import en from "../messages/en/recastStudio.json";
+import zh from "../messages/zh/recastStudio.json";
+import { resolveCopy } from "../i18nUtils";
// ---------------------------------------------------------------------------
// Upload button states
@@ -50,6 +53,7 @@ function MediaPickerButton({
fileName,
previewUrl,
isVideo,
+ copy,
}) {
const inputRef = useRef(null);
const [isDragging, setIsDragging] = useState(false);
@@ -132,8 +136,8 @@ function MediaPickerButton({
type="button"
title={
uploadState === UPLOAD_STATE.READY
- ? `${fileName} — click to clear`
- : `Upload ${label.toLowerCase()} file, or drag and drop`
+ ? copy.titles.clickToClear.replace("{fileName}", fileName)
+ : copy.titles.uploadFile.replace("{label}", label.toLowerCase())
}
onClick={handleClick}
onDragEnter={handleDragEnter}
@@ -233,6 +237,7 @@ function AssetsDropdown({
setFullscreenUrl,
onClose,
anchorRef,
+ copy,
}) {
const [activeTab, setActiveTab] = useState("videos"); // 'videos' | 'images' | 'results'
const dropRef = useRef(null);
@@ -258,7 +263,7 @@ function AssetsDropdown({
className="w-80 max-h-80 overflow-hidden flex flex-col gap-2"
onClick={(e) => e.stopPropagation()}
>
- <PromptPopoverHeader className="mb-0">Asset Library</PromptPopoverHeader>
+ <PromptPopoverHeader className="mb-0">{copy.assetLibrary.header}</PromptPopoverHeader>
{/* Tabs */}
<div className="flex border-b border-white/5 pb-1">
{["videos", "images", "results"].map((tab) => (
@@ -272,7 +277,7 @@ function AssetsDropdown({
: "text-white/40 hover:text-white/80"
}`}
>
- {tab}
+ {copy.assetLibrary.tabs[tab]}
</button>
))}
</div>
@@ -281,7 +286,7 @@ function AssetsDropdown({
<div className="overflow-y-auto custom-scrollbar flex-1 flex flex-col gap-1.5 min-h-[180px] max-h-60">
{items.length === 0 ? (
<div className="flex flex-col items-center justify-center flex-1 py-10 text-xs text-white/20">
- No assets found
+ {copy.assetLibrary.empty}
</div>
) : (
items.map((item, idx) => (
@@ -318,7 +323,7 @@ function AssetsDropdown({
{/* Enlarge preview overlay */}
<button
type="button"
- title="Enlarge preview"
+ title={copy.titles.enlargePreview}
onClick={(e) => {
e.stopPropagation();
setFullscreenUrl(item.url);
@@ -350,11 +355,11 @@ function AssetsDropdown({
type="button"
className="text-xs text-black font-black px-2.5 py-1 bg-[#22d3ee] rounded-md hover:bg-[#22d3ee]/90 transition-colors"
>
- Use
+ {copy.buttons.use}
</button>
<button
type="button"
- title="Delete from Library"
+ title={copy.titles.deleteFromLibrary}
onClick={(e) => {
e.stopPropagation();
onDeleteAsset(activeTab, item.url);
@@ -482,7 +487,9 @@ export default function RecastStudio({
historyItems,
droppedFiles,
onFilesHandled,
+ locale = "en",
}) {
+ const copy = resolveCopy(en, zh, locale);
const LEGACY_PERSIST_KEY = "hg_recast_studio_persistent";
const PERSIST_KEY = scopedPersistKey(LEGACY_PERSIST_KEY, apiKey);
useEffect(() => {
@@ -671,7 +678,7 @@ export default function RecastStudio({
const handleVideoPick = useCallback(
async (file) => {
if (file.size > 50 * 1024 * 1024) {
- alert("Video exceeds 50MB limit.");
+ alert(copy.errors.videoTooLarge);
return;
}
setVideoState(UPLOAD_STATE.UPLOADING);
@@ -690,7 +697,7 @@ export default function RecastStudio({
});
} catch (err) {
setVideoState(UPLOAD_STATE.IDLE);
- alert(`Video upload failed: ${err.message}`);
+ alert(copy.errors.videoUploadFailed.replace("{message}", err.message));
} finally {
setVideoProgress(0);
}
@@ -705,7 +712,7 @@ export default function RecastStudio({
const handleImageUpload = useCallback(
async (file) => {
if (file.size > 10 * 1024 * 1024) {
- alert("Image exceeds 10MB limit.");
+ alert(copy.errors.imageTooLarge);
return;
}
setImageState(UPLOAD_STATE.UPLOADING);
@@ -724,7 +731,7 @@ export default function RecastStudio({
});
} catch (err) {
setImageState(UPLOAD_STATE.IDLE);
- alert(`Image upload failed: ${err.message}`);
+ alert(copy.errors.imageUploadFailed.replace("{message}", err.message));
} finally {
setImageProgress(0);
}
@@ -777,11 +784,11 @@ export default function RecastStudio({
// ── Generation ──────────────────────────────────────────────────────────────
const handleGenerate = async () => {
if (!videoUrl) {
- alert("Please upload a source video first.");
+ alert(copy.errors.missingVideo);
return;
}
if (!imageUrl) {
- alert("Please upload a character image first.");
+ alert(copy.errors.missingImage);
return;
}
@@ -835,7 +842,7 @@ export default function RecastStudio({
}
} catch (e) {
console.error("[RecastStudio]", e);
- const errMsg = formatErrorMessage(e, "Body swap generation failed");
+ const errMsg = formatErrorMessage(e, copy.errors.generationFailed);
if (onGenerationError) onGenerationError(errMsg);
else toast.error(errMsg);
} finally {
@@ -883,7 +890,7 @@ export default function RecastStudio({
/>
<button
type="button"
- title="Download"
+ title={copy.buttons.download}
onClick={(e) => {
e.stopPropagation();
downloadFile(entry.url, `bodyswap-${entry.id || idx}.mp4`);
@@ -896,10 +903,10 @@ export default function RecastStudio({
</button>
<button
type="button"
- title="Delete"
+ title={copy.buttons.delete}
onClick={(e) => {
e.stopPropagation();
- if (confirm("Are you sure you want to delete this generated item?")) {
+ if (confirm(copy.confirm.deleteGenerated)) {
setInternalHistory(prev => prev.filter((_, i) => i !== idx));
}
}}
@@ -919,13 +926,13 @@ export default function RecastStudio({
actions={[
{
kind: "download",
- label: "Download",
+ label: copy.buttons.download,
onSelect: () =>
downloadFile(entry.url, `bodyswap-${entry.id || idx}.mp4`),
},
{
kind: "delete",
- label: "Delete",
+ label: copy.buttons.delete,
danger: true,
onSelect: () => {
if (confirm("Are you sure you want to delete this generated item?")) {
@@ -945,7 +952,7 @@ export default function RecastStudio({
)}
<div className="flex items-center justify-between flex-wrap gap-1 mt-1">
<span className="text-[10px] font-bold text-primary px-2 py-0.5 bg-primary/10 rounded border border-primary/20 whitespace-nowrap">
- Body Swap
+ {copy.badges.bodySwap}
</span>
</div>
</div>
@@ -987,13 +994,13 @@ export default function RecastStudio({
</div>
<h1 className="text-2xl sm:text-4xl md:text-5xl font-extrabold tracking-tight mb-4 text-center px-4 flex flex-col items-center">
- <span className="text-white font-black uppercase text-xl sm:text-3xl tracking-wide mb-1 opacity-90">START CREATING WITH</span>
+ <span className="text-white font-black uppercase text-xl sm:text-3xl tracking-wide mb-1 opacity-90">{copy.empty.titleLine1}</span>
<span className="text-[#22d3ee] font-black uppercase text-2xl sm:text-4xl sm:mt-1 tracking-tight">
- BODY SWAP STUDIO
+ {copy.empty.titleLine2}
</span>
</h1>
<p className="text-white/40 text-xs sm:text-sm font-medium tracking-wide text-center max-w-lg leading-relaxed px-4">
- Swap the character in any video dynamically by choosing a video clip and a target character image.
+ {copy.empty.description}
</p>
</div>
)}
@@ -1007,7 +1014,7 @@ export default function RecastStudio({
{/* Source video */}
<MediaPickerButton
accept="video/*"
- label="Video"
+ label={copy.labels.video}
icon={<VideoIcon className="text-white/40 group-hover:text-[#22d3ee] transition-colors" />}
onUpload={handleVideoPick}
onClear={() => {
@@ -1020,12 +1027,13 @@ export default function RecastStudio({
fileName={videoName}
previewUrl={videoUrl}
isVideo={true}
+ copy={copy}
/>
{/* Character image */}
<MediaPickerButton
accept="image/*"
- label="Character image"
+ label={copy.labels.characterImage}
icon={<ImageIcon className="text-white/40 group-hover:text-[#22d3ee] transition-colors" />}
onUpload={handleImageUpload}
onClear={() => {
@@ -1038,6 +1046,7 @@ export default function RecastStudio({
fileName={imageName}
previewUrl={imageUrl}
isVideo={false}
+ copy={copy}
/>
</div>
@@ -1047,7 +1056,7 @@ export default function RecastStudio({
ref={textareaRef}
value={prompt}
onChange={handlePromptInput}
- placeholder="Optional — describe the motion or scene..."
+ placeholder={copy.placeholders.prompt}
/>
</div>
</div>
@@ -1072,13 +1081,13 @@ export default function RecastStudio({
<span className="text-[9px] font-black text-black">R</span>
</div>
<span className={PROMPT_CONTROL_LABEL_CLASS}>
- {selectedModel?.name ?? "Select model"}
+ {selectedModel?.name ?? copy.dropdowns.selectModel}
</span>
<PromptChevronIcon />
</button>
<Dropdown
isOpen={openDropdown === "model"}
- title="Model"
+ title={copy.dropdowns.model}
items={recastModels}
selectedId={selectedModelId}
onSelect={handleModelSelect}
@@ -1110,7 +1119,7 @@ export default function RecastStudio({
</button>
<Dropdown
isOpen={openDropdown === "aspect"}
- title="Aspect Ratio"
+ title={copy.dropdowns.aspectRatio}
items={aspectDropdownItems}
selectedId={selectedAspectRatio}
onSelect={(item) => setSelectedAspectRatio(item.id)}
@@ -1135,7 +1144,7 @@ export default function RecastStudio({
})}
>
<span className="text-xs font-semibold text-current opacity-50 group-hover:opacity-100 transition-opacity">
- Orientation:
+ {copy.labels.orientationPrefix}
</span>
<span className="text-xs font-semibold text-current capitalize">
{characterOrientation}
@@ -1144,10 +1153,10 @@ export default function RecastStudio({
</button>
<Dropdown
isOpen={openDropdown === "orientation"}
- title="Orientation"
+ title={copy.dropdowns.orientation}
items={[
- { id: "image", name: "Image", description: "Use image orientation (Max 10s video)" },
- { id: "video", name: "Video", description: "Use video orientation (Max 30s video)" },
+ { id: "image", name: copy.dropdowns.orientationImage, description: copy.dropdowns.orientationImageDesc },
+ { id: "video", name: copy.dropdowns.orientationVideo, description: copy.dropdowns.orientationVideoDesc },
]}
selectedId={characterOrientation}
onSelect={(item) => setCharacterOrientation(item.id)}
@@ -1184,7 +1193,7 @@ export default function RecastStudio({
<path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z" />
</svg>
<span className="text-xs font-semibold text-white/70 group-hover:text-[#22d3ee] transition-colors">
- Library
+ {copy.labels.library}
</span>
<PromptChevronIcon />
</button>
@@ -1195,19 +1204,19 @@ export default function RecastStudio({
results={assetResults}
onSelectVideo={(url, name) => {
setVideoUrl(url);
- setVideoName(name || "Selected Video");
+ setVideoName(name || copy.defaults.selectedVideo);
setVideoState(UPLOAD_STATE.READY);
setOpenDropdown(null);
}}
onSelectImage={(url, name) => {
setImageUrl(url);
- setImageName(name || "Selected Image");
+ setImageName(name || copy.defaults.selectedImage);
setImageState(UPLOAD_STATE.READY);
setOpenDropdown(null);
}}
onSelectResultAsVideo={(url, name) => {
setVideoUrl(url);
- setVideoName(name || "Result Video");
+ setVideoName(name || copy.defaults.resultVideo);
setVideoState(UPLOAD_STATE.READY);
setOpenDropdown(null);
}}
@@ -1215,6 +1224,7 @@ export default function RecastStudio({
setFullscreenUrl={setFullscreenUrl}
onClose={() => setOpenDropdown(null)}
anchorRef={assetsBtnRef}
+ copy={copy}
/>
)}
</div>
@@ -1228,10 +1238,10 @@ export default function RecastStudio({
{isGenerating ? (
<>
<span className="animate-spin inline-block text-black">◌</span>{" "}
- Swapping...
+ {copy.buttons.swapping}
</>
) : (
- <span>Swap Body</span>
+ <span>{copy.buttons.swapBody}</span>
)}
</PromptAction>
</PromptFooter>
diff --git a/packages/studio/src/components/VibeMotionStudio.jsx b/packages/studio/src/components/VibeMotionStudio.jsx
index 11a6c2f0..0775f5de 100644
--- a/packages/studio/src/components/VibeMotionStudio.jsx
+++ b/packages/studio/src/components/VibeMotionStudio.jsx
@@ -26,6 +26,9 @@ import {
PromptTextarea,
promptControlClassName,
} from "./prompt/PromptComposer.jsx";
+import en from "../messages/en/vibeMotionStudio.json";
+import zh from "../messages/zh/vibeMotionStudio.json";
+import { resolveCopy } from "../i18nUtils";
// ── helpers ───────────────────────────────────────────────────────────────────
async function downloadFile(url, filename) {
@@ -74,7 +77,9 @@ export default function VibeMotionStudio({
onGenerationEnd,
onGenerationComplete,
onGenerationError,
+ locale = "en",
}) {
+ const copy = resolveCopy(en, zh, locale);
const LEGACY_PERSIST_KEY = "hg_vibe_motion_studio_persistent";
const PERSIST_KEY = scopedPersistKey(LEGACY_PERSIST_KEY, apiKey);
useEffect(() => {
@@ -202,14 +207,14 @@ export default function VibeMotionStudio({
if (isStaleEdit) {
console.warn("[VibeMotionStudio] Remix unavailable:", raw.slice(0, 120));
- const msg = "This generation can't be remixed — the animation code wasn't saved server-side. Generate a new motion graphic first, then remix that result.";
+ const msg = copy.errors.staleEditUnavailable;
if (onGenerationError) onGenerationError(msg);
else toast.error(msg);
setEditMode(false);
setEditSourceId(null);
} else {
console.error("[VibeMotionStudio]", err);
- const errMsg = formatErrorMessage(raw || err, "Vibe Motion generation failed");
+ const errMsg = formatErrorMessage(raw || err, copy.errors.generationFailed);
if (onGenerationError) onGenerationError(errMsg);
else toast.error(errMsg);
}
@@ -231,6 +236,7 @@ export default function VibeMotionStudio({
onGenerationEnd,
onGenerationError,
onGenerationStart,
+ copy,
]);
const handleKeyDown = (e) => {
@@ -290,9 +296,9 @@ export default function VibeMotionStudio({
</div>
<div className="flex flex-col items-center gap-1">
<span className="text-white/80 font-semibold text-sm">
- {editMode ? "Remixing motion graphics…" : "Generating motion graphics…"}
+ {editMode ? copy.loading.remixing : copy.loading.generating}
</span>
- <span className="text-white/30 text-xs">React/Remotion rendering on Modal</span>
+ <span className="text-white/30 text-xs">{copy.loading.backend}</span>
</div>
<div className="flex items-center gap-2 text-white/30 text-xs bg-white/[0.03] px-4 py-1.5 rounded-full border border-white/[0.05]">
<svg className="animate-spin" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="3">
@@ -331,7 +337,7 @@ export default function VibeMotionStudio({
? "bg-[#22d3ee]/20 text-[#22d3ee] border-[#22d3ee]/30"
: "bg-violet-600/30 text-violet-300 border-violet-500/30"
}`}>
- {entry.mode === "edit" ? "✏ Edit" : "✦ Generated"}
+ {entry.mode === "edit" ? copy.card.modeEdit : copy.card.modeGenerated}
</div>
{/* ── Hover overlay actions ── */}
@@ -342,7 +348,7 @@ export default function VibeMotionStudio({
/>
<button
type="button"
- title="Download"
+ title={copy.card.download}
onClick={(e) => { e.stopPropagation(); downloadFile(entry.url, `motion-${entry.id || idx}.mp4`); }}
className="p-2 bg-black/60 backdrop-blur-md rounded-full text-white hover:bg-primary hover:text-black transition-all border border-white/10"
>
@@ -353,7 +359,7 @@ export default function VibeMotionStudio({
{entry.requestId && entry.canEdit !== false ? (
<button
type="button"
- title="Remix this generation"
+ title={copy.card.remixThis}
onClick={(e) => {
e.stopPropagation();
setEditMode(true);
@@ -371,7 +377,7 @@ export default function VibeMotionStudio({
) : entry.requestId && entry.canEdit === false ? (
/* Legacy generation — animation code not saved by API, remix not available */
<div
- title="Legacy generation — remix not available. Generate a new motion graphic to enable editing."
+ title={copy.card.legacyRemixUnavailable}
className="p-2 bg-black/60 backdrop-blur-md rounded-full text-white/20 border border-white/5 cursor-not-allowed"
>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round" className="opacity-40">
@@ -383,10 +389,10 @@ export default function VibeMotionStudio({
) : null}
<button
type="button"
- title="Delete"
+ title={copy.card.delete}
onClick={(e) => {
e.stopPropagation();
- if (confirm("Are you sure you want to delete this generated item?")) {
+ if (confirm(copy.card.confirmDelete)) {
setHistory(prev => prev.filter((_, i) => i !== idx));
}
}}
@@ -406,14 +412,14 @@ export default function VibeMotionStudio({
actions={[
{
kind: "download",
- label: "Download",
+ label: copy.mobileActions.download,
onSelect: () =>
downloadFile(entry.url, `motion-${entry.id || idx}.mp4`),
},
entry.requestId &&
entry.canEdit !== false && {
kind: "remix",
- label: "Remix",
+ label: copy.mobileActions.remix,
onSelect: () => {
setEditMode(true);
setEditSourceId(entry.requestId);
@@ -423,10 +429,10 @@ export default function VibeMotionStudio({
},
{
kind: "delete",
- label: "Delete",
+ label: copy.mobileActions.delete,
danger: true,
onSelect: () => {
- if (confirm("Are you sure you want to delete this generated item?")) {
+ if (confirm(copy.card.confirmDelete)) {
setHistory((prev) => prev.filter((_, i) => i !== idx));
}
},
@@ -437,12 +443,12 @@ export default function VibeMotionStudio({
{/* ── Card footer: prompt + metadata ── */}
<div className="p-3 bg-black/80 backdrop-blur-sm border-t border-white/5 flex-1 flex flex-col justify-between gap-2">
<p className="text-white/70 text-xs line-clamp-3 leading-relaxed" title={entry.prompt}>
- {entry.prompt || "No prompt"}
+ {entry.prompt || copy.card.noPrompt}
</p>
<div className="flex items-center justify-between mt-1 flex-wrap gap-1">
<div className="flex items-center gap-2">
<span className="text-[10px] font-bold text-primary px-2 py-0.5 bg-primary/10 rounded border border-primary/20 whitespace-nowrap">
- Vibe Motion
+ {copy.card.tag}
</span>
<div className="flex gap-2">
{entry.aspectRatio && (
@@ -494,13 +500,13 @@ export default function VibeMotionStudio({
</div>
<h1 className="text-2xl sm:text-4xl md:text-5xl font-extrabold tracking-tight mb-4 text-center px-4 flex flex-col items-center">
- <span className="text-white font-black uppercase text-xl sm:text-3xl tracking-wide mb-1 opacity-90">START CREATING WITH</span>
+ <span className="text-white font-black uppercase text-xl sm:text-3xl tracking-wide mb-1 opacity-90">{copy.empty.titleLine1}</span>
<span className="text-[#22d3ee] font-black uppercase text-2xl sm:text-4xl sm:mt-1 tracking-tight">
- VIBE MOTION STUDIO
+ {copy.empty.titleLine2}
</span>
</h1>
<p className="text-white/40 text-xs sm:text-sm font-medium tracking-wide text-center max-w-lg leading-relaxed px-4">
- Generate animated motion graphics from a text prompt — kinetic typography, data charts, logo reveals, and more.
+ {copy.empty.description}
</p>
</div>
) : null}
@@ -518,7 +524,7 @@ export default function VibeMotionStudio({
onClick={() => { setEditMode(false); setEditSourceId(null); }}
selected={!editMode}
>
- Generate
+ {copy.modeToggle.generate}
</PromptSegmentOption>
<PromptSegmentOption
type="button"
@@ -527,7 +533,7 @@ export default function VibeMotionStudio({
selected={editMode}
className="disabled:opacity-30 disabled:cursor-not-allowed"
>
- Edit
+ {copy.modeToggle.edit}
</PromptSegmentOption>
</PromptSegmentedControl>
@@ -540,13 +546,13 @@ export default function VibeMotionStudio({
</svg>
<span className="truncate">
{sourceEntry
- ? `Editing: "${sourceEntry.prompt?.slice(0, 45)}${sourceEntry.prompt?.length > 45 ? "…" : ""}"`
- : "Select a source generation from the gallery"}
+ ? `${copy.editBanner.editingPrefix} "${sourceEntry.prompt?.slice(0, 45)}${sourceEntry.prompt?.length > 45 ? "…" : ""}"`
+ : copy.editBanner.selectSource}
</span>
<button
onClick={() => { setEditMode(false); setEditSourceId(null); setPrompt(""); }}
className="ml-auto text-[#22d3ee]/40 hover:text-[#22d3ee] transition-colors text-sm leading-none flex-shrink-0"
- title="Cancel Edit Mode"
+ title={copy.editBanner.cancelEdit}
>
×
</button>
@@ -563,8 +569,8 @@ export default function VibeMotionStudio({
onKeyDown={handleKeyDown}
placeholder={
editMode
- ? "Describe what to change — 'change background to dark navy, make bars gold, add particles…'"
- : "Describe the motion graphic — 'Animated sales dashboard with glowing bar charts and rising numbers'"
+ ? copy.placeholder.edit
+ : copy.placeholder.generate
}
/>
</div>
@@ -597,7 +603,7 @@ export default function VibeMotionStudio({
</button>
{openDropdown === "ar" && (
<PromptPopover>
- <PromptPopoverHeader>Aspect Ratio</PromptPopoverHeader>
+ <PromptPopoverHeader>{copy.controls.aspectRatio}</PromptPopoverHeader>
<PromptMenuList>
{ASPECT_RATIOS.map((ar) => (
<DropdownItem
@@ -628,7 +634,7 @@ export default function VibeMotionStudio({
</button>
{openDropdown === "dur" && (
<PromptPopover>
- <PromptPopoverHeader>Duration</PromptPopoverHeader>
+ <PromptPopoverHeader>{copy.controls.duration}</PromptPopoverHeader>
<PromptMenuList>
{DURATION_OPTIONS.map((d) => (
<DropdownItem
@@ -658,13 +664,13 @@ export default function VibeMotionStudio({
</svg>
</div>
<span className={`${PROMPT_CONTROL_LABEL_CLASS} text-[#22d3ee]/70 max-w-[120px] truncate`}>
- {sourceEntry ? `Source: ${sourceEntry.prompt?.slice(0, 20)}…` : "Pick source…"}
+ {sourceEntry ? `${copy.controls.sourcePrefix} ${sourceEntry.prompt?.slice(0, 20)}…` : copy.controls.pickSource}
</span>
<PromptChevronIcon />
</button>
{openDropdown === "source" && (
<PromptPopover className="w-64">
- <PromptPopoverHeader>Source Generation</PromptPopoverHeader>
+ <PromptPopoverHeader>{copy.controls.sourceGeneration}</PromptPopoverHeader>
<div className="flex flex-col gap-1">
{editSources.map((src) => (
<div
@@ -688,7 +694,7 @@ export default function VibeMotionStudio({
</div>
)}
- <span className="text-[10px] text-white/20 hidden sm:block ml-2">Ctrl+Enter to run</span>
+ <span className="text-[10px] text-white/20 hidden sm:block ml-2">{copy.controls.shortcutHint}</span>
</PromptControls>
{/* ── Generate Button — matches VideoStudio exactly ── */}
@@ -699,12 +705,12 @@ export default function VibeMotionStudio({
{generating ? (
<>
<span className="animate-spin inline-block text-black">◌</span>{" "}
- {editMode ? "Remixing..." : "Generating..."}
+ {editMode ? copy.generateButton.remixing : copy.generateButton.generating}
</>
) : editMode ? (
- <span>Remix</span>
+ <span>{copy.generateButton.remix}</span>
) : (
- <span>Generate</span>
+ <span>{copy.generateButton.generate}</span>
)}
</PromptAction>
</PromptFooter>
diff --git a/packages/studio/src/components/VideoStudio.jsx b/packages/studio/src/components/VideoStudio.jsx
index 1e1407fa..c8cd377c 100644
--- a/packages/studio/src/components/VideoStudio.jsx
+++ b/packages/studio/src/components/VideoStudio.jsx
@@ -76,6 +76,9 @@ import {
promptControlClassName,
promptMediaButtonClassName,
} from "./prompt/PromptComposer.jsx";
+import en from "../messages/en/videoStudio.json";
+import zh from "../messages/zh/videoStudio.json";
+import { resolveCopy } from "../i18nUtils";
async function downloadFile(url, filename) {
try {
@@ -137,8 +140,9 @@ function ReferencePreview({
onRemove,
label = null,
description = null,
+ copy = en,
}) {
- const mediaLabel = label || (type === "image" ? "image" : type === "video" ? "video" : "audio");
+ const mediaLabel = label || (type === "image" ? copy.media.image : type === "video" ? copy.media.video : copy.media.audio);
const actionLabel = description || mediaLabel;
return (
<div className="flex min-w-[60px] flex-col items-center gap-1.5">
@@ -158,8 +162,8 @@ function ReferencePreview({
)}
<button
type="button"
- aria-label={`Remove ${actionLabel.toLowerCase()}`}
- title={`Remove ${actionLabel.toLowerCase()}`}
+ aria-label={`${copy.media.removePrefix} ${actionLabel}`}
+ title={`${copy.media.removePrefix} ${actionLabel}`}
onClick={() => onRemove(index)}
className="absolute top-0.5 right-0.5 w-4 h-4 bg-black/60 hover:bg-black rounded-full flex items-center justify-center text-white/85 hover:text-white text-[8px] border border-white/5"
>
@@ -184,6 +188,7 @@ function ReferenceUploadButton({
label = null,
required = false,
disabled = false,
+ copy = en,
}) {
const localInputRef = useRef(null);
const resolvedInputRef = inputRef || localInputRef;
@@ -323,7 +328,7 @@ function ReferenceUploadButton({
aria-live="polite"
aria-atomic="true"
>
- {uploading ? `${title}: ${announcedProgress}% uploaded` : ""}
+ {uploading ? copy.upload.uploadingProgress.replace('{title}', title).replace('{progress}', announcedProgress) : ""}
</span>
<ReferenceMediaLabel label={label} required={required} />
</div>
@@ -415,22 +420,22 @@ function ModelDropdown({ selectedModel, onSelect, onClose }) {
const modelCategories = [
{
id: "all",
- label: "All",
+ label: copy.categories.all,
entries: videoModelPickerEntries,
},
{
id: "t2v",
- label: "Text to Video",
+ label: copy.categories.t2v,
entries: videoModelPickerEntries.filter((entry) => entry.variantsByMode.t2v),
},
{
id: "i2v",
- label: "Image to Video",
+ label: copy.categories.i2v,
entries: videoModelPickerEntries.filter((entry) => entry.variantsByMode.i2v),
},
{
id: "v2v",
- label: "Video Tools",
+ label: copy.categories.v2v,
entries: videoModelPickerEntries.filter((entry) => entry.variantsByMode.v2v),
},
];
@@ -579,7 +584,7 @@ function ModelDropdown({ selectedModel, onSelect, onClose }) {
? "bg-white/10 text-yellow-400 border-yellow-500/30 shadow-md scale-105"
: "bg-white/[0.02] text-white/50 border-white/[0.03] hover:bg-white/5 hover:text-white"
}`}
- title="All Providers"
+ title={copy.providers.allProviders}
>
<svg width="15" height="15" viewBox="0 0 24 24" fill={selectedProvider === "all" ? "currentColor" : "none"} stroke="currentColor" strokeWidth="2">
<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" />
@@ -653,7 +658,7 @@ function ModelDropdown({ selectedModel, onSelect, onClose }) {
</svg>
<input
type="text"
- placeholder="Search models..."
+ placeholder={copy.search.placeholder}
value={search}
onChange={(e) => {
const value = e.target.value;
@@ -706,7 +711,9 @@ export default function VideoStudio({
onDeleteHistoryItem,
droppedFiles,
onFilesHandled,
+ locale = "en",
}) {
+ const copy = resolveCopy(en, zh, locale);
const LEGACY_PERSIST_KEY = "hg_video_studio_persistent";
const PERSIST_KEY = scopedPersistKey(LEGACY_PERSIST_KEY, apiKey);
useEffect(() => {
@@ -1236,13 +1243,13 @@ export default function VideoStudio({
const validUrls = urls.filter(Boolean);
if (validUrls.length === 0) return;
if (selectionAtStart && !isSameSelection(selectionAtStart, selectionRef.current)) {
- toast.error("The model changed during upload. Please add the file again.");
+ toast.error(copy.errors.modelChangedDuringUpload);
return;
}
const resolvedTarget = target || resolveMediaTarget(mediaType);
if (!resolvedTarget) {
const family = videoModelCatalog.familyById.get(selectionRef.current.selectedFamilyId);
- toast.error(`${family.name} does not support ${mediaType} references.`);
+ toast.error(copy.errors.modelDoesNotSupportReference.replace('{family}', family.name).replace('{mediaType}', mediaType));
return;
}
@@ -1292,7 +1299,7 @@ export default function VideoStudio({
);
});
if (!slot || !workflowMediaDraftKey || !entry?.url) {
- toast.error("The selected source does not accept images.");
+ toast.error(copy.errors.sourceDoesNotAcceptImages);
return;
}
setWorkflowMediaDrafts((drafts) => {
@@ -1326,7 +1333,7 @@ export default function VideoStudio({
const selectedFiles = Array.from(files);
const tooLarge = selectedFiles.find((file) => file.size > maxBytes);
if (tooLarge) {
- alert(`${label} exceeds ${Math.round(maxBytes / 1024 / 1024)}MB limit.`);
+ alert(copy.errors.labelExceedsLimit.replace('{label}', label).replace('{limit}', Math.round(maxBytes / 1024 / 1024)));
return [];
}
setUploading(true);
@@ -1345,7 +1352,7 @@ export default function VideoStudio({
);
} catch (err) {
console.error(`[VideoStudio] ${label} upload failed:`, err);
- alert(`${label} upload failed: ${err.message}`);
+ alert(copy.errors.labelUploadFailed.replace('{label}', label).replace('{message}', err.message));
return [];
} finally {
setUploading(false);
@@ -1502,10 +1509,10 @@ export default function VideoStudio({
if (remaining === 0) return;
const options = mediaType === "image"
- ? { label: "Image", maxBytes: 10 * 1024 * 1024, setUploading: setImageUploading, setProgress: setImageProgress }
+ ? { label: copy.media.image, maxBytes: 10 * 1024 * 1024, setUploading: setImageUploading, setProgress: setImageProgress }
: mediaType === "video"
- ? { label: "Video", maxBytes: 50 * 1024 * 1024, setUploading: setVideoUploading, setProgress: setVideoProgress }
- : { label: "Audio", maxBytes: 50 * 1024 * 1024, setUploading: setAudioUploading, setProgress: setAudioProgress };
+ ? { label: copy.media.video, maxBytes: 50 * 1024 * 1024, setUploading: setVideoUploading, setProgress: setVideoProgress }
+ : { label: copy.media.audio, maxBytes: 50 * 1024 * 1024, setUploading: setAudioUploading, setProgress: setAudioProgress };
const urls = await uploadFiles(Array.from(files).slice(0, remaining), options);
applyReferenceUrls(mediaType, urls, target, selectionAtStart);
},
@@ -1517,9 +1524,7 @@ export default function VideoStudio({
if (droppedFiles && droppedFiles.length > 0) {
if (selectedWorkflowId) {
if (workflowUploadSlotRef.current) {
- toast.error(
- "Wait for the current upload to finish, then add these files again.",
- );
+ toast.error(copy.errors.waitForCurrentUpload);
onFilesHandled?.();
return;
}
@@ -1600,7 +1605,7 @@ export default function VideoStudio({
const file = e.target.files[0];
if (!file) return;
if (file.size > 10 * 1024 * 1024) {
- alert("Image exceeds 10MB limit.");
+ alert(copy.errors.imageExceeds10MB);
return;
}
setEndImageUploading(true);
@@ -1762,7 +1767,7 @@ export default function VideoStudio({
return;
}
if (currentModel?.promptRequired && !trimmedPrompt) {
- alert("Please enter a prompt for this model.");
+ alert(copy.errors.noPromptForModel);
return;
}
@@ -1778,11 +1783,11 @@ export default function VideoStudio({
}
} else if (v2vMode) {
if (!uploadedVideoUrl) {
- alert("Please upload a video first.");
+ alert(copy.errors.uploadVideoFirst);
return;
}
if (currentModel?.imageField && !currentModel?.imageOptional && !uploadedImageUrl) {
- alert("Please upload a reference image for motion control.");
+ alert(copy.errors.uploadReferenceImageForMotion);
return;
}
} else if (isExtendMode) {
@@ -1792,12 +1797,12 @@ export default function VideoStudio({
}
} else if (imageMode) {
if (uploadedImageUrls.length === 0) {
- alert("Please upload at least one reference image first.");
+ alert(copy.errors.uploadAtLeastOneReferenceImage);
return;
}
} else {
if (!trimmedPrompt) {
- alert("Please enter a prompt to generate a video.");
+ alert(copy.errors.enterPromptToGenerate);
return;
}
}
@@ -1828,7 +1833,7 @@ export default function VideoStudio({
v2vParams.prompt = trimmedPrompt;
}
res = await processV2V(apiKey, v2vParams);
- if (!res?.url) throw new Error("No video URL returned by API");
+ if (!res?.url) throw new Error(copy.errors.noVideoUrlReturned);
const genId = res.id || Date.now().toString();
const entry = {
@@ -1863,7 +1868,7 @@ export default function VideoStudio({
if (showEffect && selectedEffect) i2vParams.name = selectedEffect;
res = await generateI2V(apiKey, i2vParams);
- if (!res?.url) throw new Error("No video URL returned by API");
+ if (!res?.url) throw new Error(copy.errors.noVideoUrlReturned);
const genId = res.id || Date.now().toString();
setGenerationSources((sources) =>
@@ -1909,7 +1914,7 @@ export default function VideoStudio({
if (selectedQuality) params.quality = selectedQuality;
res = await generateVideo(apiKey, params);
- if (!res?.url) throw new Error("No video URL returned by API");
+ if (!res?.url) throw new Error(copy.errors.noVideoUrlReturned);
const genId = res.id || Date.now().toString();
setGenerationSources((sources) =>
@@ -1936,7 +1941,7 @@ export default function VideoStudio({
}
} catch (e) {
console.error("[VideoStudio]", e);
- const errMsg = formatErrorMessage(e, "Video generation failed");
+ const errMsg = formatErrorMessage(e, copy.errors.videoGenerationFailed);
if (onGenerationError) onGenerationError(errMsg);
else toast.error(errMsg);
} finally {
@@ -2053,24 +2058,24 @@ export default function VideoStudio({
: imageUploadCapability.separateLastItem;
const promptPlaceholder = selectedWorkflowId === "edit_video"
- ? "Describe how to edit the video"
+ ? copy.placeholders.editVideo
: selectedWorkflowId === "extend_uploaded_video"
- ? "Describe how to continue the video"
+ ? copy.placeholders.continueVideo
: selectedWorkflowId === "motion_transfer"
- ? "Describe the motion"
+ ? copy.placeholders.motion
: v2vMode
? currentModelObj?.imageField
? currentModelObj?.promptRequired
- ? "Describe the motion"
- : "Describe the motion (optional)"
- : "Video ready — click Generate to remove watermark"
+ ? copy.placeholders.motion
+ : copy.placeholders.motionOptional
+ : copy.placeholders.videoReadyRemoveWatermark
: imageMode
? currentModelObj?.promptRequired
- ? "Describe the motion or effect"
- : "Describe the motion or effect (optional)"
+ ? copy.placeholders.motionOrEffect
+ : copy.placeholders.motionOrEffectOptional
: isExtendMode
- ? "Optional: describe how to continue the video..."
- : "Describe the video you want to create";
+ ? copy.placeholders.optionalContinueVideo
+ : copy.placeholders.describeVideo;
const focusWorkflowMenuItem = useCallback((target = "selected") => {
const items = Array.from(
@@ -2211,7 +2216,7 @@ export default function VideoStudio({
/>
<button
type="button"
- title="Download"
+ title={copy.gallery.download}
onClick={(e) => {
e.stopPropagation();
downloadFile(entry.url, `video-${entry.id || idx}.mp4`);
@@ -2225,7 +2230,7 @@ export default function VideoStudio({
{isSeedance2 && (
<button
type="button"
- title="Extend this video using Seedance 2.0 Extend"
+ title={copy.gallery.extendSeedance}
onClick={(e) => {
e.stopPropagation();
handleExtend(entry.id, entry.model);
@@ -2239,12 +2244,12 @@ export default function VideoStudio({
)}
<button
type="button"
- title="Delete"
+ title={copy.gallery.delete}
onClick={(e) => {
e.stopPropagation();
- if (confirm("Are you sure you want to delete this generated item?")) {
+ if (confirm(copy.gallery.confirmDelete)) {
handleDeleteEntry(entry, idx).catch((err) => {
- onGenerationError?.(err.message || "Failed to delete item");
+ onGenerationError?.(err.message || copy.errors.deleteItemFailed);
});
}
}}
@@ -2264,23 +2269,23 @@ export default function VideoStudio({
actions={[
{
kind: "download",
- label: "Download",
+ label: copy.gallery.download,
onSelect: () =>
downloadFile(entry.url, `video-${entry.id || idx}.mp4`),
},
isSeedance2 && {
kind: "extend",
- label: "Extend",
+ label: copy.gallery.extend,
onSelect: () => handleExtend(entry.id, entry.model),
},
{
kind: "delete",
- label: "Delete",
+ label: copy.gallery.delete,
danger: true,
onSelect: () => {
- if (confirm("Are you sure you want to delete this generated item?")) {
+ if (confirm(copy.gallery.confirmDelete)) {
handleDeleteEntry(entry, idx).catch((err) => {
- onGenerationError?.(err.message || "Failed to delete item");
+ onGenerationError?.(err.message || copy.errors.deleteItemFailed);
});
}
},
@@ -2291,12 +2296,12 @@ export default function VideoStudio({
{/* Prompt & Details */}
<div className="p-3 bg-black/80 backdrop-blur-sm border-t border-white/5 flex-1 flex flex-col justify-between gap-2">
<p className="text-white/70 text-xs line-clamp-3 leading-relaxed" title={entry.prompt}>
- {entry.prompt || "No prompt provided"}
+ {entry.prompt || copy.gallery.noPromptProvided}
</p>
<div className="flex items-center justify-between mt-1 flex-wrap gap-1">
<div className="flex items-center gap-2">
<span className="text-[10px] font-bold text-primary px-2 py-0.5 bg-primary/10 rounded border border-primary/20 whitespace-nowrap capitalize">
- {entry.model?.replace("-", " ") || "Video Studio"}
+ {entry.model?.replace("-", " ") || copy.gallery.fallbackTitle}
</span>
<div className="flex gap-2">
{entry.resolution && (
@@ -2320,41 +2325,41 @@ export default function VideoStudio({
<div className="w-18 h-22 sm:w-24 sm:h-28 rounded-2xl border border-white/10 shadow-2xl -rotate-[12deg] transform hover:rotate-0 hover:scale-110 hover:z-20 transition-all duration-300 overflow-hidden bg-white/[0.01] flex-shrink-0">
<img
src="https://d3adwkbyhxyrtq.cloudfront.net/webassets/videomodels/sdxl-image.avif"
- alt="Creative asset 1"
+ alt={copy.creativeAssets.asset1}
className="w-full h-full object-cover"
/>
</div>
<div className="w-18 h-22 sm:w-24 sm:h-28 rounded-2xl border border-white/10 shadow-2xl -rotate-[4deg] transform hover:rotate-0 hover:scale-110 hover:z-20 transition-all duration-300 overflow-hidden bg-white/[0.01] -ml-3 sm:-ml-4 flex-shrink-0">
<img
src="https://d3adwkbyhxyrtq.cloudfront.net/webassets/videomodels/chroma-image.avif"
- alt="Creative asset 2"
+ alt={copy.creativeAssets.asset2}
className="w-full h-full object-cover"
/>
</div>
<div className="w-18 h-18 sm:w-24 sm:h-24 rounded-full border border-white/10 shadow-2xl rotate-[6deg] transform hover:rotate-0 hover:scale-110 hover:z-20 transition-all duration-300 overflow-hidden bg-white/[0.01] -ml-3 sm:-ml-4 flex-shrink-0">
<img
src="https://d3adwkbyhxyrtq.cloudfront.net/webassets/videomodels/neta-lumina.avif"
- alt="Creative asset 3"
+ alt={copy.creativeAssets.asset3}
className="w-full h-full object-cover"
/>
</div>
<div className="w-18 h-22 sm:w-24 sm:h-28 rounded-2xl border border-white/10 shadow-2xl rotate-[12deg] transform hover:rotate-0 hover:scale-110 hover:z-20 transition-all duration-300 overflow-hidden bg-white/[0.01] -ml-3 sm:-ml-4 flex-shrink-0">
<img
src="https://d3adwkbyhxyrtq.cloudfront.net/webassets/videomodels/perfect-pony-xl.avif"
- alt="Creative asset 4"
+ alt={copy.creativeAssets.asset4}
className="w-full h-full object-cover"
/>
</div>
</div>
<h1 className="text-2xl sm:text-4xl md:text-5xl font-extrabold tracking-tight mb-4 text-center px-4 flex flex-col items-center">
- <span className="text-white font-black uppercase text-xl sm:text-3xl tracking-wide mb-1 opacity-90">START CREATING WITH</span>
+ <span className="text-white font-black uppercase text-xl sm:text-3xl tracking-wide mb-1 opacity-90">{copy.empty.heading}</span>
<span className="text-[#22d3ee] font-black uppercase text-2xl sm:text-4xl sm:mt-1 tracking-tight">
{selectedFamily.name}
</span>
</h1>
<p className="text-white/40 text-xs sm:text-sm font-medium tracking-wide text-center max-w-lg leading-relaxed px-4">
- Animate images into stunning AI videos with motion effects
+ {copy.empty.subtitle}
</p>
</div>
)}
@@ -2371,6 +2376,7 @@ export default function VideoStudio({
const values = activeWorkflowMediaDraft?.[slot.id] || [];
return values.map((url, index) => (
<ReferencePreview
+ copy={copy}
key={`${slot.id}:${index}:${url}`}
type={slot.mediaType}
url={url}
@@ -2408,6 +2414,7 @@ export default function VideoStudio({
: audioProgress;
return (
<ReferenceUploadButton
+ copy={copy}
key={slot.id}
accept={`${slot.mediaType}/*`}
multiple={remaining > 1}
@@ -2435,6 +2442,7 @@ export default function VideoStudio({
<>
{uploadedImageUrls.map((url, index) => (
<ReferencePreview
+ copy={copy}
key={url}
type="image"
url={url}
@@ -2442,24 +2450,26 @@ export default function VideoStudio({
onRemove={removeImageAtIndex}
label={
uploadedImageUrls.length > 1
- ? `Image · ${index + 1}`
- : "Image"
+ ? `${copy.media.image} · ${index + 1}`
+ : copy.media.image
}
/>
))}
{uploadedEndImageUrl && (
<ReferencePreview
+ copy={copy}
type="image"
url={uploadedEndImageUrl}
index={0}
onRemove={clearEndImage}
- label="End frame"
+ label={copy.media.endFrame}
/>
)}
{uploadedVideoUrls.map((url, index) => (
<ReferencePreview
+ copy={copy}
key={url}
type="video"
url={url}
@@ -2467,14 +2477,15 @@ export default function VideoStudio({
onRemove={removeVideoAtIndex}
label={
uploadedVideoUrls.length > 1
- ? `Video · ${index + 1}`
- : "Video"
+ ? `${copy.media.video} · ${index + 1}`
+ : copy.media.video
}
/>
))}
{uploadedAudioUrls.map((url, index) => (
<ReferencePreview
+ copy={copy}
key={url}
type="audio"
url={url}
@@ -2482,8 +2493,8 @@ export default function VideoStudio({
onRemove={removeAudioAtIndex}
label={
uploadedAudioUrls.length > 1
- ? `Audio · ${index + 1}`
- : "Audio"
+ ? `${copy.media.audio} · ${index + 1}`
+ : copy.media.audio
}
/>
))}
@@ -2491,6 +2502,7 @@ export default function VideoStudio({
{/* Upload trigger buttons */}
{canUploadImageReference && uploadedImageUrls.length < imageUploadLimit && (
<ReferenceUploadButton
+ copy={copy}
inputRef={imageFileInputRef}
accept="image/*"
multiple={imageUploadLimit - uploadedImageUrls.length > 1}
@@ -2498,8 +2510,8 @@ export default function VideoStudio({
onClick={() => imageFileInputRef.current?.click()}
title={
selectedWorkflowId === "keyframes"
- ? "Upload start frame"
- : `Upload up to ${imageUploadLimit} reference images`
+ ? copy.upload.uploadStartFrame
+ : copy.upload.uploadUpToReferenceImages.replace('{count}', imageUploadLimit)
}
uploading={imageUploading}
progress={imageProgress}
@@ -2509,12 +2521,13 @@ export default function VideoStudio({
{showEndImageUpload && !uploadedEndImageUrl && (
<ReferenceUploadButton
+ copy={copy}
inputRef={endImageFileInputRef}
accept="image/*"
multiple={false}
onChange={handleEndImageFileChange}
onClick={() => endImageFileInputRef.current?.click()}
- title="Upload end frame"
+ title={copy.upload.uploadEndFrame}
uploading={endImageUploading}
progress={endImageProgress}
type="image"
@@ -2523,6 +2536,7 @@ export default function VideoStudio({
{videoUploadLimit > 0 && uploadedVideoUrls.length < videoUploadLimit && (
<ReferenceUploadButton
+ copy={copy}
inputRef={videoFileInputRef}
accept="video/*"
multiple={videoUploadLimit - uploadedVideoUrls.length > 1}
@@ -2537,6 +2551,7 @@ export default function VideoStudio({
{audioUploadLimit > 0 && uploadedAudioUrls.length < audioUploadLimit && (
<ReferenceUploadButton
+ copy={copy}
inputRef={audioFileInputRef}
accept="audio/*"
multiple={audioUploadLimit - uploadedAudioUrls.length > 1}
@@ -2577,7 +2592,7 @@ export default function VideoStudio({
>
<path d="M5 12h14M12 5l7 7-7 7" />
</svg>
- <span>Continuing the previous {selectedFamily.name} generation</span>
+ <span>{copy.extend.continuingGeneration.replace('{family}', selectedFamily.name)}</span>
</div>
)}
@@ -2617,7 +2632,7 @@ export default function VideoStudio({
onClick={(e) => e.stopPropagation()}
className="w-[calc(100vw-2rem)] md:w-[480px] max-w-md md:max-w-none max-h-[70vh]"
>
- <PromptPopoverHeader>Model</PromptPopoverHeader>
+ <PromptPopoverHeader>{copy.dropdowns.model}</PromptPopoverHeader>
<ModelDropdown
selectedModel={selectedModel}
onSelect={handleModelSelect}
@@ -2688,7 +2703,7 @@ export default function VideoStudio({
style={{ maxHeight: "55vh" }}
onClick={(event) => event.stopPropagation()}
>
- <PromptPopoverHeader>Source</PromptPopoverHeader>
+ <PromptPopoverHeader>{copy.dropdowns.source}</PromptPopoverHeader>
<div
ref={workflowMenuRef}
id={workflowMenuId}
@@ -2737,7 +2752,7 @@ export default function VideoStudio({
<path d="M3 12a9 9 0 1 0 3-6.7L3 8" />
<path d="M3 3v5h5" />
</svg>
- <span>Base generation</span>
+ <span>{copy.dropdowns.baseGeneration}</span>
</button>
</div>
)}
@@ -2777,7 +2792,7 @@ export default function VideoStudio({
onClick={(e) => e.stopPropagation()}
>
<PromptPopoverHeader>
- Aspect Ratio
+ {copy.dropdowns.aspectRatio}
</PromptPopoverHeader>
<PromptMenuList>
{getCurrentAspectRatios(selectedModel).map((r) => (
@@ -2821,7 +2836,7 @@ export default function VideoStudio({
<path d="M5 3l14 9-14 9V3z" />
</svg>
<span className={`${PROMPT_CONTROL_LABEL_CLASS} max-w-[140px] truncate`}>
- {selectedEffect || "Effect"}
+ {selectedEffect || copy.dropdowns.effect}
</span>
</button>
{openDropdown === "effect" && (
@@ -2830,7 +2845,7 @@ export default function VideoStudio({
className="min-w-[200px]"
>
<PromptPopoverHeader>
- Effect Type
+ {copy.dropdowns.effectType}
</PromptPopoverHeader>
<PromptMenuList>
{getEffectsForI2VModel(selectedModel).map((eff) => (
@@ -2872,7 +2887,7 @@ export default function VideoStudio({
onClick={(e) => e.stopPropagation()}
>
<PromptPopoverHeader>
- Duration
+ {copy.dropdowns.duration}
</PromptPopoverHeader>
<PromptMenuList>
{getCurrentDurations(selectedModel).map((d) => (
@@ -2914,7 +2929,7 @@ export default function VideoStudio({
onClick={(e) => e.stopPropagation()}
>
<PromptPopoverHeader>
- Resolution
+ {copy.dropdowns.resolution}
</PromptPopoverHeader>
<PromptMenuList>
{getCurrentResolutions(selectedModel).map((r) => (
@@ -2954,7 +2969,7 @@ export default function VideoStudio({
<path d="M12 20h9" />
<path d="M16.5 3.5a2.121 2.121 0 013 3L7 19l-4 1 1-4L16.5 3.5z" />
</svg>
- <span className={PROMPT_CONTROL_LABEL_CLASS}>Draw</span>
+ <span className={PROMPT_CONTROL_LABEL_CLASS}>{copy.controls.draw}</span>
</button>
)}
</PromptControls>
@@ -2969,11 +2984,11 @@ export default function VideoStudio({
<span className="animate-spin inline-block text-black">
◌
</span>{" "}
- Generating...
+ {copy.controls.generating}
</>
) : (
<>
- <span>Generate</span>
+ <span>{copy.controls.generate}</span>
</>
)}
</PromptAction>
diff --git a/packages/studio/src/i18nUtils.js b/packages/studio/src/i18nUtils.js
new file mode 100644
index 00000000..1a206ec9
--- /dev/null
+++ b/packages/studio/src/i18nUtils.js
@@ -0,0 +1,41 @@
+// Tiny, dependency-free locale-copy resolver shared by every Studio
+// component in this package.
+//
+// Design: each component ships its own English default bundle (source of
+// truth for keys/shape) plus one override bundle per additional locale.
+// `resolveCopy` deep-merges the override over English so a partial
+// translation still renders — missing keys fall back to English rather
+// than showing `undefined`. This mirrors the merge behavior in the host
+// app's `lib/locales.js` (see Open-Higgsfield-ai/lib/locales.js) but is
+// duplicated here (not imported) so this package has no dependency on the
+// consuming app's file layout — it only needs a `locale` string prop.
+//
+// Adding a new locale to a component: add `../messages/<locale>/<name>.json`
+// next to the existing `en`/`zh` bundles, import it, and pass it into
+// `resolveCopy(en, localeBundles[locale], locale)`. No changes needed here.
+
+function isPlainObject(value) {
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
+}
+
+export function mergeCopy(base, override) {
+ if (!override) return base;
+ if (!base) return override;
+ if (!isPlainObject(base) || !isPlainObject(override)) return override;
+
+ const merged = { ...base };
+ for (const key of Object.keys(override)) {
+ merged[key] = isPlainObject(base[key]) && isPlainObject(override[key])
+ ? mergeCopy(base[key], override[key])
+ : override[key];
+ }
+ return merged;
+}
+
+// `en` is the required default bundle; `localeBundle` is the override for
+// the active `locale` (or undefined/null when only English exists yet, or
+// when locale === 'en'). Always returns a fully-populated copy object.
+export function resolveCopy(en, localeBundle, locale) {
+ if (!locale || locale === 'en') return en;
+ return mergeCopy(en, localeBundle);
+}
diff --git a/packages/studio/src/messages/en/agentStudio.json b/packages/studio/src/messages/en/agentStudio.json
new file mode 100644
index 00000000..e76af1d2
--- /dev/null
+++ b/packages/studio/src/messages/en/agentStudio.json
@@ -0,0 +1,57 @@
+{
+ "tabs": {
+ "templates": "Templates",
+ "my-agents": "My Agents",
+ "my-chats": "My Chats"
+ },
+ "headings": {
+ "agents": "Agents",
+ "createAgent": "Create Agent"
+ },
+ "buttons": {
+ "back": "Agents",
+ "create": "Create",
+ "createAgentSubmit": "Create Agent",
+ "creating": "Creating...",
+ "send": "Send",
+ "retry": "Retry",
+ "browseTemplates": "Browse Templates"
+ },
+ "labels": {
+ "name": "Name",
+ "description": "Description",
+ "systemPrompt": "System Prompt",
+ "welcomeMessage": "Welcome Message (optional)"
+ },
+ "placeholders": {
+ "name": "e.g. Caption Crafter Pro",
+ "description": "What does this agent help with?",
+ "systemPrompt": "You are a helpful assistant that...",
+ "welcomeMessage": "Hi! How can I help you today?",
+ "chatInput": "Message this agent..."
+ },
+ "empty": {
+ "noChats": "No chats yet",
+ "noAgents": "No agents found"
+ },
+ "errors": {
+ "loadFailed": "Failed to load.",
+ "loadAgentFailed": "Failed to load agent",
+ "sendFailed": "Failed to send message",
+ "createFailed": "Failed to create agent"
+ },
+ "card": {
+ "defaultCategory": "AI Assistant",
+ "unnamedAgent": "Unnamed Agent",
+ "byPrefix": "By",
+ "unknownAgent": "Unknown Agent",
+ "newChat": "New Chat",
+ "msgsSuffix": "msgs"
+ },
+ "time": {
+ "justNow": "just now",
+ "minutesAgo": "{n}m ago",
+ "hoursAgo": "{n}h ago",
+ "daysAgo": "{n}d ago"
+ }
+}
diff --git a/packages/studio/src/messages/en/aiInfluencerStudio.json b/packages/studio/src/messages/en/aiInfluencerStudio.json
new file mode 100644
index 00000000..dc13e55c
--- /dev/null
+++ b/packages/studio/src/messages/en/aiInfluencerStudio.json
@@ -0,0 +1,63 @@
+{
+ "builder": {
+ "title": "Builder",
+ "reset": "Reset"
+ },
+ "categoryTabs": {
+ "face": "Face",
+ "body": "Body",
+ "style": "Style"
+ },
+ "subcategories": {
+ "character_type": "Character Type",
+ "gender": "Gender",
+ "ethnicity_origin_base": "Ethnicity / Origin",
+ "eye_color": "Eye Color",
+ "eyes_type": "Eye Type",
+ "eyes_details": "Eye Features",
+ "mouth": "Mouth & Teeth",
+ "ears": "Ears",
+ "horns": "Horns",
+ "skin_conditions": "Skin Conditions",
+ "face_skin_material": "Face Skin Material",
+ "face_surface_pattern": "Skin Pattern",
+ "body_type": "Body Type",
+ "left_arm": "Left Arm",
+ "right_arm": "Right Arm",
+ "left_leg": "Left Leg",
+ "right_leg": "Right Leg",
+ "hair": "Hair / Head Growth",
+ "accessories": "Accessories & Markings",
+ "rendering_style": "Rendering Style"
+ },
+ "toolbar": {
+ "shuffle": "Shuffle",
+ "generate": "Generate Character",
+ "generating": "Generating…"
+ },
+ "preview": {
+ "generating": "Generating your AI influencer…",
+ "emptyTitle": "Your AI influencer lives here.",
+ "emptySubtitleLine1": "Design and build your AI influencer",
+ "emptySubtitleLine2": "from scratch",
+ "save": "Save",
+ "altGenerated": "Generated AI Character"
+ },
+ "tags": {
+ "showMore": "show more",
+ "hide": "hide"
+ },
+ "customPrompt": {
+ "placeholder": "Add extra details… e.g. neon cyberpunk lighting, dramatic shadows"
+ },
+ "gallery": {
+ "title": "Generated",
+ "countSuffix": "characters",
+ "emptyText": "Generated characters\nappear here",
+ "altPrefix": "Character",
+ "download": "Download"
+ },
+ "errors": {
+ "generationFailed": "Generation failed. Please try again."
+ }
+}
diff --git a/packages/studio/src/messages/en/appsStudio.json b/packages/studio/src/messages/en/appsStudio.json
new file mode 100644
index 00000000..0a09a54f
--- /dev/null
+++ b/packages/studio/src/messages/en/appsStudio.json
@@ -0,0 +1,42 @@
+{
+ "hero": {
+ "badge": "Revenue-Ready Templates",
+ "titleLine1": "LAUNCH AN AI APP.",
+ "titleLine2": "START EARNING TODAY.",
+ "subtitle": "Each template is a fully-functional, Stripe-integrated AI SaaS you can deploy in minutes. Charge your users, keep the revenue — muapi handles the AI infrastructure."
+ },
+ "steps": {
+ "stepLabel": "Step",
+ "deploy": {
+ "title": "Deploy in Minutes",
+ "body": "Fork the open-source template, add your muapi key, and push to Vercel. No backend setup needed."
+ },
+ "collect": {
+ "title": "Collect Payments",
+ "body": "Stripe is pre-wired. Set your own pricing — one-time credits, subscriptions, or pay-per-use."
+ },
+ "keep": {
+ "title": "Keep the Revenue",
+ "body": "Payments go straight to your Stripe account. You own the product, the brand, and the profits."
+ }
+ },
+ "card": {
+ "templateFallback": "Template",
+ "github": "Github",
+ "demo": "Demo"
+ },
+ "footer": {
+ "moreComingSoon": "Muapi Ecosystem — More templates coming soon"
+ },
+ "modal": {
+ "deployTitle": "Deploy {appName}",
+ "body": "Enter your details and we'll send you the {appName} template along with setup instructions so you can deploy and start earning immediately.",
+ "sending": "Sending Details...",
+ "getTemplate": "Get Template",
+ "maybeLater": "Maybe Later"
+ },
+ "toast": {
+ "requestSuccess": "Got it! We'll send you the template details shortly.",
+ "requestError": "Failed to register interest. Please try again later."
+ }
+}
diff --git a/packages/studio/src/messages/en/audioStudio.json b/packages/studio/src/messages/en/audioStudio.json
new file mode 100644
index 00000000..dfaaf71d
--- /dev/null
+++ b/packages/studio/src/messages/en/audioStudio.json
@@ -0,0 +1,53 @@
+{
+ "uploader": {
+ "clear": "Clear",
+ "uploadPrompt": "Upload audio track",
+ "uploadHint": "MP3, WAV, M4A up to 20MB",
+ "uploading": "Uploading...",
+ "ready": "Ready to generate",
+ "maxSuffix": "(Max {max})",
+ "trackLabel": "Track #{index}",
+ "sizeLimitError": "Audio file exceeds 20MB limit.",
+ "uploadFailedError": "Upload failed: {message}"
+ },
+ "player": {
+ "nowPlaying": "Now Playing",
+ "defaultTitle": "Generated Track",
+ "muteUnmute": "Mute/Unmute",
+ "pause": "Pause",
+ "play": "Play",
+ "download": "Download Audio",
+ "save": "Save"
+ },
+ "sidebar": {
+ "modelLabel": "Audio Model",
+ "selectModel": "Select Model",
+ "descriptionLabel": "Description",
+ "selectOption": "Select option",
+ "promptPlaceholder": "Enter what you want generated...",
+ "lyricsPromptLabel": "Lyrics / Prompt",
+ "fieldPlaceholder": "Enter {field}...",
+ "requiredFieldError": "Please complete the required field: {field}"
+ },
+ "generate": {
+ "generating": "Generating Audio...",
+ "cta": "Generate Track",
+ "noUrlError": "No audio URL returned by the API.",
+ "genericError": "Audio generation failed",
+ "droppedFileUploadError": "Failed to upload dropped file: {message}"
+ },
+ "result": {
+ "errorHeading": "Generation Error",
+ "loadingHeading": "Generating Soundtrack",
+ "loadingSubtext": "Rendering audio waveforms and vocals...",
+ "emptyHeading": "Audio Studio",
+ "emptyBody": "Choose an AI music model, voice cloner, or sound generator. Modify variables on the left and craft your next high-fidelity track.",
+ "newGeneration": "New Generation",
+ "success": "Success"
+ },
+ "history": {
+ "heading": "Generation History ({count})",
+ "untitled": "Untitled Audio",
+ "fallbackModel": "Audio"
+ }
+}
diff --git a/packages/studio/src/messages/en/cinemaStudio.json b/packages/studio/src/messages/en/cinemaStudio.json
new file mode 100644
index 00000000..7b99723d
--- /dev/null
+++ b/packages/studio/src/messages/en/cinemaStudio.json
@@ -0,0 +1,49 @@
+{
+ "cameraOverlay": {
+ "eyebrow": "Cinema Studio",
+ "title": "Camera settings",
+ "description": "Build a consistent cinematic look by choosing the camera, lens, focal length, and depth of field.",
+ "close": "Close",
+ "closeAria": "Close camera settings",
+ "columns": {
+ "camera": "Camera",
+ "lens": "Lens",
+ "focalLength": "Focal length",
+ "aperture": "Aperture"
+ }
+ },
+ "dropdowns": {
+ "aspectRatio": "Aspect Ratio",
+ "resolution": "Resolution"
+ },
+ "actions": {
+ "copyPrompt": "Copy prompt",
+ "promptCopied": "Prompt copied",
+ "copyImage": "Copy image",
+ "imageCopied": "Image copied",
+ "download": "Download",
+ "delete": "Delete",
+ "deleteConfirm": "Are you sure you want to delete this generated item?"
+ },
+ "card": {
+ "noPrompt": "No prompt",
+ "badge": "Cinema Studio",
+ "historyItemAlt": "History item {index}"
+ },
+ "empty": {
+ "kicker": "START CREATING WITH",
+ "title": "CINEMA STUDIO",
+ "description": "What would you shoot with infinite budget? Control cameras, lighting, lenses, and prompt high-end cinematic scenes."
+ },
+ "prompt": {
+ "placeholder": "Describe your cinema scene...",
+ "generating": "Generating...",
+ "generate": "Shoot"
+ },
+ "fullscreen": {
+ "alt": "Fullscreen Preview"
+ },
+ "referenceImage": {
+ "alt": "Reference"
+ }
+}
diff --git a/packages/studio/src/messages/en/clippingStudio.json b/packages/studio/src/messages/en/clippingStudio.json
new file mode 100644
index 00000000..2f978352
--- /dev/null
+++ b/packages/studio/src/messages/en/clippingStudio.json
@@ -0,0 +1,73 @@
+{
+ "headings": {
+ "startCreatingWith": "START CREATING WITH",
+ "aiClippingStudio": "AI CLIPPING STUDIO",
+ "emptyStateSubtitle": "Extract viral highlights and precise timings from your videos automatically.",
+ "clippingHistoryRuns": "Clipping History Runs",
+ "savedGenerations": "{count} Saved Generations",
+ "backToHistory": "Back to History",
+ "highlightsTimeline": "Highlights Timeline",
+ "matches": "{count} Matches",
+ "extractedVideoClips": "Extracted Video Clips",
+ "aspectRatioLabel": "Aspect Ratio: {ratio}",
+ "originalVideoPlayer": "Original Video Player"
+ },
+ "modes": {
+ "timelineSeek": "Timeline Seek Mode",
+ "clipsGallery": "Clips Gallery Mode"
+ },
+ "labels": {
+ "highlights": "{count} Highlights",
+ "clips": "{count} Clips",
+ "highlightFallback": "Highlight #{index}",
+ "scoreSuffix": "% Score",
+ "durationSuffix": "s duration",
+ "seekAndPlay": "Seek & Play",
+ "clipIndex": "Clip #{index}",
+ "aiClipping": "AI Clipping"
+ },
+ "buttons": {
+ "deleteFromHistory": "Delete from history",
+ "delete": "Delete",
+ "copyLink": "Copy Link",
+ "copyLinkShort": "Copy link",
+ "download": "Download",
+ "clearVideo": "Clear video",
+ "uploadSourceVideo": "Upload source video",
+ "generate": "Generate ✦ 5",
+ "generating": "Generating...",
+ "coordinatesOnly": "Coordinates Only"
+ },
+ "placeholders": {
+ "promptOrUrl": "Describe prompt / highlights to extract"
+ },
+ "popovers": {
+ "aspectRatio": "Aspect Ratio",
+ "maxHighlights": "Max Highlights",
+ "limit": "Limit:"
+ },
+ "empty": {
+ "noHighlights": "No highlights extracted.",
+ "noClips": "No video clips generated. Try re-running."
+ },
+ "alerts": {
+ "urlCopied": "URL copied to clipboard!",
+ "needVideo": "Please upload a video or paste a video URL first."
+ },
+ "errors": {
+ "dismissNotification": "Dismiss notification",
+ "videoTooLarge": "The file is too large for this mode. Compress or trim the video, then upload a smaller file.",
+ "videoExceedsLimit": "Video exceeds {mb}MB limit.",
+ "uploadFailed": "Video upload failed. Please try again.",
+ "generationFailed": "Failed to process AI clipping."
+ },
+ "sourceVideoFallback": "source_video.mp4",
+ "aspectRatioLabels": {
+ "9:16": "9:16 (TikTok / Reels / Shorts)",
+ "16:9": "16:9 (YouTube / TV)",
+ "1:1": "1:1 (Instagram Square)",
+ "4:5": "4:5 (Instagram Portrait)",
+ "4:3": "4:3 (Classic Video)",
+ "3:4": "3:4 (Portrait)"
+ }
+}
diff --git a/packages/studio/src/messages/en/imageStudio.json b/packages/studio/src/messages/en/imageStudio.json
new file mode 100644
index 00000000..875ef2ad
--- /dev/null
+++ b/packages/studio/src/messages/en/imageStudio.json
@@ -0,0 +1,68 @@
+{
+ "uploadButton": {
+ "faceLabel": "Face",
+ "referenceImageLabel": "Reference image",
+ "addUpToImages": "Add up to {max} images",
+ "singleSelectedTitle": "1 image selected — click to add more (up to {max})",
+ "multiSelectedTitle": "{count} of {max} images selected — click to manage",
+ "tooLargeAlert": "The following images are too large (max 10MB): {names}",
+ "uploadFailedAlert": "Image upload failed: {message}",
+ "headerTitle": "Reference Images",
+ "selectUpTo": "Select up to {max} images",
+ "doneButton": "✓ Done ({count})",
+ "uploadFilesButton": "Upload files",
+ "uploadNewButton": "Upload new",
+ "emptyState": "No uploads yet",
+ "removeFromHistory": "Remove from history",
+ "selectedCount": "{count} of {max} selected",
+ "useSelected": "Use Selected"
+ },
+ "modelDropdown": {
+ "categoryAll": "All",
+ "categoryT2I": "Text to Image",
+ "categoryI2I": "Image to Image",
+ "allProviders": "All Providers",
+ "searchPlaceholder": "Search models...",
+ "modelsSuffix": "models",
+ "noModelsFound": "No models found"
+ },
+ "gallery": {
+ "generatedImageAlt": "Generated image",
+ "download": "Download",
+ "delete": "Delete",
+ "deleteConfirm": "Are you sure you want to delete this generated item?",
+ "deleteFailed": "Failed to delete item",
+ "noPrompt": "No prompt provided",
+ "modelFallback": "Image Studio"
+ },
+ "emptyState": {
+ "heading": "START CREATING WITH",
+ "subtitle": "Describe a scene, character, mood, or style — and watch it come to life"
+ },
+ "promptBar": {
+ "placeholderMultiImage": "{count} images selected — describe the transformation (optional)",
+ "placeholderI2I": "Describe how to transform this image (optional)",
+ "placeholderT2I": "Describe the image you want to create",
+ "swapFaceLabel": "Swap Face",
+ "effectFallback": "Effect",
+ "drawButton": "Draw",
+ "generating": "Generating...",
+ "generateButton": "Generate ✦"
+ },
+ "popovers": {
+ "model": "Model",
+ "aspectRatio": "Aspect Ratio",
+ "resolution": "Resolution",
+ "effectType": "Effect Type"
+ },
+ "errors": {
+ "noImageReferenceSupport": "{name} does not support image references.",
+ "uploadReferenceFirst": "Please upload a reference image first.",
+ "uploadSwapFaceFirst": "Please upload a swap face image.",
+ "enterPromptFirst": "Please enter a prompt to generate an image.",
+ "generationFailed": "Image generation failed"
+ },
+ "fullscreen": {
+ "previewAlt": "Fullscreen Preview"
+ }
+}
diff --git a/packages/studio/src/messages/en/layersStudio.json b/packages/studio/src/messages/en/layersStudio.json
new file mode 100644
index 00000000..e4056726
--- /dev/null
+++ b/packages/studio/src/messages/en/layersStudio.json
@@ -0,0 +1,178 @@
+{
+ "common": {
+ "model": "Model",
+ "reset": "Reset"
+ },
+ "panels": {
+ "layer-decomposition": "Layer Decomposition",
+ "upscale": "Upscale",
+ "color-grading": "Color Grading",
+ "remove-bg": "Remove Background",
+ "expand-crop": "Expand Image",
+ "tools": "Tools"
+ },
+ "menuItems": {
+ "layer-decomposition": "Layer Decomposition",
+ "upscale": "Upscale",
+ "color-grading": "Color Grading",
+ "remove-bg": "Remove background",
+ "expand-crop": "Expand & Outpaint",
+ "edit-text": "Edit text",
+ "enhancer": "Enhancer",
+ "relight": "Relight",
+ "angles": "Angles",
+ "new": "New"
+ },
+ "tools": {
+ "uploadOrChangeImage": "Upload or Change Image",
+ "clearMarkedRegions": "Clear Marked Regions",
+ "runSelectionEdit": "Run Selection Edit",
+ "line": "Line",
+ "arrow": "Arrow",
+ "rectangle": "Rectangle",
+ "circle": "Circle",
+ "customColor": "Custom Color",
+ "undoStroke": "Undo Stroke",
+ "redoStroke": "Redo Stroke",
+ "clearDrawings": "Clear Drawings",
+ "selectPointerTool": "Select Pointer Tool",
+ "panTool": "Pan Tool",
+ "lassoEdit": "Lasso Edit",
+ "regionalEdit": "Regional Edit",
+ "highlightMarkerPen": "Highlight Marker Pen",
+ "eraserTool": "Eraser Tool",
+ "shapes": "Shapes (R)",
+ "resetZoomPan": "Reset Zoom & Pan",
+ "addImage": "Add Image",
+ "runLayerDecomposition": "Run Layer Decomposition",
+ "backToTools": "Back to Tools",
+ "closePanel": "Close Panel",
+ "regionalPromptPlaceholder": "Type your prompt here..."
+ },
+ "sample": {
+ "clickToLoad": "Click to load this layer decomposition example",
+ "original": "Original",
+ "layersCount": "5 Layers",
+ "try": "Try →",
+ "clickToExplore": "Click to explore sample"
+ },
+ "settings": {
+ "heading": "Settings",
+ "resolution": "Resolution",
+ "layers": "Layers"
+ },
+ "carousel": {
+ "heading": "Layer Carousel",
+ "soloActive": "Solo Active",
+ "stackMode": "Stack Mode",
+ "viewOnlyActive": "View only active layer",
+ "downloadAll": "Download All",
+ "previousLayer": "Previous Layer",
+ "nextLayer": "Next Layer",
+ "toggleVisibility": "Toggle Visibility",
+ "downloadThisLayer": "Download this layer",
+ "save": "Save",
+ "layerLabel": "Layer {n}",
+ "seedreamDecomposed": "Seedream Decomposed"
+ },
+ "colorGrading": {
+ "colorCorrect": { "heading": "Color Correct", "info": "Temperature, hue, saturation, contrast and split-tone", "reset": "Reset Color Correct" },
+ "softenDetails": { "heading": "Soften Details", "info": "Radius and detail softening", "reset": "Reset Soften Details" },
+ "bloom": { "heading": "Bloom", "info": "Luminescence diffusion and blend mode", "reset": "Reset Bloom" },
+ "halation": { "heading": "Halation", "info": "Film red glow around intense highlights", "reset": "Reset Halation" },
+ "lensInstructions": { "heading": "Lens Instructions", "info": "Vignette and optical lens distortion", "reset": "Reset Lens Instructions" },
+ "exposure": { "heading": "Exposure", "info": "Exposure stops adjustment", "reset": "Reset Exposure" },
+ "filmGrain": { "heading": "Film Grain", "info": "Analog film stock grain simulation", "reset": "Reset Film Grain" },
+ "resetToDefault": "Reset to default",
+ "resetAll": "Reset All Color Grading",
+ "download": "Download"
+ },
+ "removeBg": {
+ "credit": "1.0 credit",
+ "modelName": "AI Background Remover",
+ "targetPreview": "Target Preview",
+ "alphaMatte": "Alpha Matte Cutout",
+ "feature1": "Precision edge extraction (hair, fur, fine contours)",
+ "feature2": "High-resolution transparent PNG output"
+ },
+ "expandCrop": {
+ "credit": "0.03 credits",
+ "modelName": "AI Image Extension",
+ "canvasPreview": "Canvas Preview",
+ "boundaryOutpainting": "Boundary Outpainting",
+ "expand": "Expand",
+ "feature1": "Expands borders while matching lighting, style & textures",
+ "feature2": "Automatic intelligent edge outpainting & continuation"
+ },
+ "editText": {
+ "heading": "Edit Text Tool",
+ "placeholder": "Enter text modification prompt...",
+ "run": "Run Text Edit",
+ "processing": "Processing..."
+ },
+ "enhancer": {
+ "heading": "AI Enhancer",
+ "description": "Automatically optimize lighting, sharpness, and color balance.",
+ "run": "Enhance Image",
+ "processing": "Enhancing..."
+ },
+ "relight": {
+ "heading": "AI Relight",
+ "description": "Adjust illumination, ambient studio light, and shadows.",
+ "run": "Apply Relight",
+ "processing": "Relighting..."
+ },
+ "angles": {
+ "heading": "3D Angle Perspective",
+ "description": "Adjust perspective tilt and camera angle alignment.",
+ "run": "Apply Perspective Angle",
+ "processing": "Transforming..."
+ },
+ "footer": {
+ "decomposing": "Decomposing ({progress}%)...",
+ "separateLayers": "Separate layers {count}",
+ "upscaling": "Upscaling ({progress}%)...",
+ "upscaleCost": "Upscale {cost}",
+ "removingBackground": "Removing background ({progress}%)...",
+ "removeBackgroundCost": "Remove Background 1.0",
+ "expandingBorders": "Expanding borders ({progress}%)...",
+ "expandImageCost": "Expand Image 0.03"
+ },
+ "toasts": {
+ "enterApiKeyUpload": "Please enter your API Key to upload images.",
+ "imageUploaded": "Image uploaded successfully!",
+ "uploadFailed": "Upload failed: {error}",
+ "uploadImageFileOnly": "Please upload an image file.",
+ "fileTooLarge": "File too large (max 20MB): {name}",
+ "viewReset": "View reset",
+ "enterApiKey": "Please enter your API key.",
+ "enterRegionPrompt": "Please enter a prompt for the selected region.",
+ "editFailed": "Edit failed: {error}",
+ "apiKeyMissingSet": "API key is missing. Please set your API key.",
+ "uploadOrSelectDecompose": "Please upload or select an image to decompose into layers.",
+ "decomposedInto": "Decomposed into {count} layer(s)!",
+ "decompositionFailed": "Decomposition failed: {error}",
+ "uploadOrSelectUpscale": "Please select or upload an image to upscale.",
+ "upscaleSuccess": "Image upscaled successfully with {model}!",
+ "upscaleNoOutput": "Upscale completed but no output URL was returned.",
+ "upscaleFailed": "Upscale failed: {error}",
+ "uploadOrSelectRemoveBg": "Please upload or select an image to remove background.",
+ "removeBgSuccess": "Background removed cleanly with AI Background Remover!",
+ "removeBgNoOutput": "Background removal completed but no output URL was returned.",
+ "removeBgFailed": "Background removal failed: {error}",
+ "uploadOrSelectExpand": "Please upload or select an image to expand.",
+ "expandSuccess": "Image expanded cleanly with AI Image Extension!",
+ "expandNoOutput": "Image expansion completed but no output URL was returned.",
+ "expandFailed": "Image expansion failed: {error}",
+ "upscaleSettingsReset": "Upscale settings reset to default",
+ "resetCategory": "Reset {category}",
+ "colorGradingReset": "Color grading reset to default",
+ "downloadedGraded": "Downloaded color graded image!",
+ "loadedSample": "Loaded Seedream 5-layer sample!",
+ "apiKeyMissing": "API key is missing.",
+ "uploadImageFirst": "Please upload an image first.",
+ "toolCompleted": "{tool} completed successfully!",
+ "operationFailed": "Operation failed: {error}",
+ "downloadingAll": "Downloading all layers..."
+ }
+}
diff --git a/packages/studio/src/messages/en/lipSyncStudio.json b/packages/studio/src/messages/en/lipSyncStudio.json
new file mode 100644
index 00000000..faec5158
--- /dev/null
+++ b/packages/studio/src/messages/en/lipSyncStudio.json
@@ -0,0 +1,54 @@
+{
+ "hero": {
+ "titleLine1": "START CREATING WITH",
+ "titleLine2": "LIP SYNC STUDIO",
+ "subtitle": "Sync any voice with any face video to create premium talking avatars and videos."
+ },
+ "modes": {
+ "portraitImage": "Portrait Image",
+ "video": "Video"
+ },
+ "media": {
+ "imageLabel": "Image",
+ "videoLabel": "Video",
+ "audioLabel": "Audio",
+ "uploadFilePrefix": "Upload",
+ "uploadFileSuffix": "file",
+ "clickToClear": "click to clear",
+ "noImage": "No image",
+ "noVideo": "No video",
+ "noAudio": "No audio"
+ },
+ "prompt": {
+ "placeholder": "Describe speech style..."
+ },
+ "model": {
+ "selectModel": "Select model",
+ "dropdownTitle": "Model",
+ "resolutionDropdownTitle": "Resolution"
+ },
+ "actions": {
+ "generate": "Sync Lip",
+ "generating": "Generating...",
+ "download": "Download",
+ "delete": "Delete"
+ },
+ "confirm": {
+ "deleteItem": "Are you sure you want to delete this generated item?"
+ },
+ "badges": {
+ "lipSync": "Lip Sync"
+ },
+ "errors": {
+ "imageTooLarge": "Image exceeds 10MB limit.",
+ "videoTooLarge": "Video exceeds 50MB limit.",
+ "audioTooLarge": "Audio file exceeds 10MB limit.",
+ "imageUploadFailed": "Image upload failed: {message}",
+ "videoUploadFailed": "Video upload failed: {message}",
+ "audioUploadFailed": "Audio upload failed: {message}",
+ "needAudio": "Please upload an audio file first.",
+ "needImage": "Please upload a portrait image first.",
+ "needVideo": "Please upload a source video first.",
+ "generationFailed": "Lip sync generation failed"
+ }
+}
diff --git a/packages/studio/src/messages/en/marketingStudio.json b/packages/studio/src/messages/en/marketingStudio.json
new file mode 100644
index 00000000..242b5968
--- /dev/null
+++ b/packages/studio/src/messages/en/marketingStudio.json
@@ -0,0 +1,49 @@
+{
+ "empty": {
+ "titleLine1": "START CREATING WITH",
+ "titleLine2": "MARKETING STUDIO",
+ "subtitle": "Describe your scene, upload your product, and watch high-converting AI video ads come to life."
+ },
+ "uploadSlots": {
+ "product": "Product",
+ "avatar": "Avatar",
+ "references": "References",
+ "uploadPrefix": "Upload"
+ },
+ "prompt": {
+ "placeholder": "Describe your ad script... Use @image1 for product, @image2 for avatar."
+ },
+ "dropdowns": {
+ "videoFormatPresets": "Video Format Presets",
+ "avatarPresets": "Avatar Presets",
+ "aspectRatio": "Aspect Ratio",
+ "resolution": "Resolution",
+ "duration": "Duration",
+ "selectAvatarFallback": "Select Avatar"
+ },
+ "buttons": {
+ "generating": "Generating...",
+ "launch": "Launch",
+ "enlargePreview": "Enlarge preview",
+ "enlargeSelectedAvatar": "Enlarge selected avatar",
+ "selectAvatar": "Select Avatar",
+ "download": "Download",
+ "delete": "Delete"
+ },
+ "history": {
+ "badge": "Marketing Studio"
+ },
+ "alt": {
+ "creativeAsset": "Creative asset {index}",
+ "previousAvatar": "Previous Avatar",
+ "nextAvatar": "Next Avatar"
+ },
+ "errors": {
+ "missingScript": "Please enter an ad script.",
+ "missingProductImage": "Please upload a product image.",
+ "generationFailed": "Marketing generation failed"
+ },
+ "confirm": {
+ "deleteItem": "Are you sure you want to delete this generated item?"
+ }
+}
diff --git a/packages/studio/src/messages/en/mcpCliStudio.json b/packages/studio/src/messages/en/mcpCliStudio.json
new file mode 100644
index 00000000..1d9eec07
--- /dev/null
+++ b/packages/studio/src/messages/en/mcpCliStudio.json
@@ -0,0 +1,35 @@
+{
+ "hero": {
+ "badge": "For developers & AI agents",
+ "title": "MCP & CLI",
+ "description": "Use Open Generative AI from your terminal, your IDE, or any MCP-compatible assistant. Generate cinematic images, videos, and audio across 100+ models — without leaving your workflow."
+ },
+ "quickStart": {
+ "sectionLabel": "Quick start",
+ "steps": {
+ "installCli": "Install the CLI",
+ "signIn": "Sign in",
+ "addSkills": "Add the skills"
+ }
+ },
+ "features": {
+ "cli": {
+ "description": "Generate images, videos, and audio from the terminal across 14+ AI models. Dual interface — colored human output plus JSON for agents (--output-json, --jq filtering). Async workflows, file uploads, credit tracking."
+ },
+ "mcp": {
+ "description": "Connect Claude, Cursor, Windsurf, and any MCP-compatible assistant to 100+ generative models. Hosted endpoint — no install. 19 structured tools with input/output schemas, async polling, and account management."
+ },
+ "skills": {
+ "description": "Multimodal toolkit for Claude Code, Cursor, and Gemini CLI. Cinema Director, Nano-Banana, UI Designer, Logo Creator, Seedance 2, AI Clipping, and YouTube Shorts presets. Agent-native with JSON outputs and semantic exit codes."
+ }
+ },
+ "viewOnGithub": "View on GitHub",
+ "examples": {
+ "sectionLabel": "Examples",
+ "imageGeneration": "Image generation",
+ "textToVideo": "Text-to-video",
+ "audioCreation": "Audio creation",
+ "runSkill": "Run a skill"
+ },
+ "footer": "Open-source · MIT licensed · Works with Claude, Cursor, Windsurf, and Gemini CLI"
+}
diff --git a/packages/studio/src/messages/en/recastStudio.json b/packages/studio/src/messages/en/recastStudio.json
new file mode 100644
index 00000000..623a1254
--- /dev/null
+++ b/packages/studio/src/messages/en/recastStudio.json
@@ -0,0 +1,68 @@
+{
+ "labels": {
+ "video": "Video",
+ "characterImage": "Character image",
+ "library": "Library",
+ "orientationPrefix": "Orientation:"
+ },
+ "buttons": {
+ "use": "Use",
+ "download": "Download",
+ "delete": "Delete",
+ "swapBody": "Swap Body",
+ "swapping": "Swapping..."
+ },
+ "titles": {
+ "clickToClear": "{fileName} — click to clear",
+ "uploadFile": "Upload {label} file, or drag and drop",
+ "enlargePreview": "Enlarge preview",
+ "deleteFromLibrary": "Delete from Library"
+ },
+ "assetLibrary": {
+ "header": "Asset Library",
+ "tabs": {
+ "videos": "Videos",
+ "images": "Images",
+ "results": "Results"
+ },
+ "empty": "No assets found"
+ },
+ "dropdowns": {
+ "model": "Model",
+ "selectModel": "Select model",
+ "aspectRatio": "Aspect Ratio",
+ "orientation": "Orientation",
+ "orientationImage": "Image",
+ "orientationVideo": "Video",
+ "orientationImageDesc": "Use image orientation (Max 10s video)",
+ "orientationVideoDesc": "Use video orientation (Max 30s video)"
+ },
+ "empty": {
+ "titleLine1": "START CREATING WITH",
+ "titleLine2": "BODY SWAP STUDIO",
+ "description": "Swap the character in any video dynamically by choosing a video clip and a target character image."
+ },
+ "placeholders": {
+ "prompt": "Optional — describe the motion or scene..."
+ },
+ "badges": {
+ "bodySwap": "Body Swap"
+ },
+ "confirm": {
+ "deleteGenerated": "Are you sure you want to delete this generated item?"
+ },
+ "errors": {
+ "videoTooLarge": "Video exceeds 50MB limit.",
+ "imageTooLarge": "Image exceeds 10MB limit.",
+ "missingVideo": "Please upload a source video first.",
+ "missingImage": "Please upload a character image first.",
+ "videoUploadFailed": "Video upload failed: {message}",
+ "imageUploadFailed": "Image upload failed: {message}",
+ "generationFailed": "Body swap generation failed"
+ },
+ "defaults": {
+ "selectedVideo": "Selected Video",
+ "selectedImage": "Selected Image",
+ "resultVideo": "Result Video"
+ }
+}
diff --git a/packages/studio/src/messages/en/vibeMotionStudio.json b/packages/studio/src/messages/en/vibeMotionStudio.json
new file mode 100644
index 00000000..38c55fed
--- /dev/null
+++ b/packages/studio/src/messages/en/vibeMotionStudio.json
@@ -0,0 +1,59 @@
+{
+ "loading": {
+ "remixing": "Remixing motion graphics…",
+ "generating": "Generating motion graphics…",
+ "backend": "React/Remotion rendering on Modal"
+ },
+ "card": {
+ "modeEdit": "✏ Edit",
+ "modeGenerated": "✦ Generated",
+ "download": "Download",
+ "remixThis": "Remix this generation",
+ "legacyRemixUnavailable": "Legacy generation — remix not available. Generate a new motion graphic to enable editing.",
+ "delete": "Delete",
+ "confirmDelete": "Are you sure you want to delete this generated item?",
+ "noPrompt": "No prompt",
+ "tag": "Vibe Motion"
+ },
+ "mobileActions": {
+ "download": "Download",
+ "remix": "Remix",
+ "delete": "Delete"
+ },
+ "empty": {
+ "titleLine1": "START CREATING WITH",
+ "titleLine2": "VIBE MOTION STUDIO",
+ "description": "Generate animated motion graphics from a text prompt — kinetic typography, data charts, logo reveals, and more."
+ },
+ "modeToggle": {
+ "generate": "Generate",
+ "edit": "Edit"
+ },
+ "editBanner": {
+ "editingPrefix": "Editing:",
+ "selectSource": "Select a source generation from the gallery",
+ "cancelEdit": "Cancel Edit Mode"
+ },
+ "placeholder": {
+ "edit": "Describe what to change — 'change background to dark navy, make bars gold, add particles…'",
+ "generate": "Describe the motion graphic — 'Animated sales dashboard with glowing bar charts and rising numbers'"
+ },
+ "controls": {
+ "aspectRatio": "Aspect Ratio",
+ "duration": "Duration",
+ "sourcePrefix": "Source:",
+ "pickSource": "Pick source…",
+ "sourceGeneration": "Source Generation",
+ "shortcutHint": "Ctrl+Enter to run"
+ },
+ "errors": {
+ "staleEditUnavailable": "This generation can't be remixed — the animation code wasn't saved server-side. Generate a new motion graphic first, then remix that result.",
+ "generationFailed": "Vibe Motion generation failed"
+ },
+ "generateButton": {
+ "remixing": "Remixing...",
+ "generating": "Generating...",
+ "remix": "Remix",
+ "generate": "Generate"
+ }
+}
diff --git a/packages/studio/src/messages/en/videoStudio.json b/packages/studio/src/messages/en/videoStudio.json
new file mode 100644
index 00000000..f1328973
--- /dev/null
+++ b/packages/studio/src/messages/en/videoStudio.json
@@ -0,0 +1,92 @@
+{
+ "categories": {
+ "all": "All",
+ "t2v": "Text to Video",
+ "i2v": "Image to Video",
+ "v2v": "Video Tools"
+ },
+ "providers": {
+ "allProviders": "All Providers"
+ },
+ "search": {
+ "placeholder": "Search models..."
+ },
+ "media": {
+ "image": "Image",
+ "video": "Video",
+ "audio": "Audio",
+ "endFrame": "End frame",
+ "removePrefix": "Remove"
+ },
+ "upload": {
+ "uploadStartFrame": "Upload start frame",
+ "uploadEndFrame": "Upload end frame",
+ "uploadUpToReferenceImages": "Upload up to {count} reference images",
+ "uploadingProgress": "{title}: {progress}% uploaded"
+ },
+ "placeholders": {
+ "editVideo": "Describe how to edit the video",
+ "continueVideo": "Describe how to continue the video",
+ "motion": "Describe the motion",
+ "motionOptional": "Describe the motion (optional)",
+ "videoReadyRemoveWatermark": "Video ready — click Generate to remove watermark",
+ "motionOrEffect": "Describe the motion or effect",
+ "motionOrEffectOptional": "Describe the motion or effect (optional)",
+ "optionalContinueVideo": "Optional: describe how to continue the video...",
+ "describeVideo": "Describe the video you want to create"
+ },
+ "dropdowns": {
+ "model": "Model",
+ "source": "Source",
+ "baseGeneration": "Base generation",
+ "aspectRatio": "Aspect Ratio",
+ "effect": "Effect",
+ "effectType": "Effect Type",
+ "duration": "Duration",
+ "resolution": "Resolution"
+ },
+ "controls": {
+ "draw": "Draw",
+ "generate": "Generate",
+ "generating": "Generating..."
+ },
+ "extend": {
+ "continuingGeneration": "Continuing the previous {family} generation"
+ },
+ "gallery": {
+ "download": "Download",
+ "extend": "Extend",
+ "extendSeedance": "Extend this video using Seedance 2.0 Extend",
+ "delete": "Delete",
+ "confirmDelete": "Are you sure you want to delete this generated item?",
+ "noPromptProvided": "No prompt provided",
+ "fallbackTitle": "Video Studio"
+ },
+ "empty": {
+ "heading": "START CREATING WITH",
+ "subtitle": "Animate images into stunning AI videos with motion effects"
+ },
+ "creativeAssets": {
+ "asset1": "Creative asset 1",
+ "asset2": "Creative asset 2",
+ "asset3": "Creative asset 3",
+ "asset4": "Creative asset 4"
+ },
+ "errors": {
+ "modelChangedDuringUpload": "The model changed during upload. Please add the file again.",
+ "modelDoesNotSupportReference": "{family} does not support {mediaType} references.",
+ "sourceDoesNotAcceptImages": "The selected source does not accept images.",
+ "waitForCurrentUpload": "Wait for the current upload to finish, then add these files again.",
+ "imageExceeds10MB": "Image exceeds 10MB limit.",
+ "labelExceedsLimit": "{label} exceeds {limit}MB limit.",
+ "labelUploadFailed": "{label} upload failed: {message}",
+ "noPromptForModel": "Please enter a prompt for this model.",
+ "uploadVideoFirst": "Please upload a video first.",
+ "uploadReferenceImageForMotion": "Please upload a reference image for motion control.",
+ "uploadAtLeastOneReferenceImage": "Please upload at least one reference image first.",
+ "enterPromptToGenerate": "Please enter a prompt to generate a video.",
+ "noVideoUrlReturned": "No video URL returned by API",
+ "videoGenerationFailed": "Video generation failed",
+ "deleteItemFailed": "Failed to delete item"
+ }
+}
diff --git a/packages/studio/src/messages/zh/agentStudio.json b/packages/studio/src/messages/zh/agentStudio.json
new file mode 100644
index 00000000..1a8747ae
--- /dev/null
+++ b/packages/studio/src/messages/zh/agentStudio.json
@@ -0,0 +1,57 @@
+{
+ "tabs": {
+ "templates": "模板",
+ "my-agents": "我的智能体",
+ "my-chats": "我的对话"
+ },
+ "headings": {
+ "agents": "智能体",
+ "createAgent": "创建智能体"
+ },
+ "buttons": {
+ "back": "智能体",
+ "create": "创建",
+ "createAgentSubmit": "创建智能体",
+ "creating": "创建中...",
+ "send": "发送",
+ "retry": "重试",
+ "browseTemplates": "浏览模板"
+ },
+ "labels": {
+ "name": "名称",
+ "description": "描述",
+ "systemPrompt": "系统提示词",
+ "welcomeMessage": "欢迎语(可选)"
+ },
+ "placeholders": {
+ "name": "例如:文案精灵 Pro",
+ "description": "这个智能体能帮助解决什么问题?",
+ "systemPrompt": "你是一个乐于助人的助手,会……",
+ "welcomeMessage": "你好!今天有什么可以帮你的吗?",
+ "chatInput": "给这个智能体发消息……"
+ },
+ "empty": {
+ "noChats": "暂无对话",
+ "noAgents": "未找到智能体"
+ },
+ "errors": {
+ "loadFailed": "加载失败。",
+ "loadAgentFailed": "加载智能体失败",
+ "sendFailed": "发送消息失败",
+ "createFailed": "创建智能体失败"
+ },
+ "card": {
+ "defaultCategory": "AI 助手",
+ "unnamedAgent": "未命名智能体",
+ "byPrefix": "创建者:",
+ "unknownAgent": "未知智能体",
+ "newChat": "新对话",
+ "msgsSuffix": "条消息"
+ },
+ "time": {
+ "justNow": "刚刚",
+ "minutesAgo": "{n} 分钟前",
+ "hoursAgo": "{n} 小时前",
+ "daysAgo": "{n} 天前"
+ }
+}
diff --git a/packages/studio/src/messages/zh/aiInfluencerStudio.json b/packages/studio/src/messages/zh/aiInfluencerStudio.json
new file mode 100644
index 00000000..b2cee9f0
--- /dev/null
+++ b/packages/studio/src/messages/zh/aiInfluencerStudio.json
@@ -0,0 +1,63 @@
+{
+ "builder": {
+ "title": "构建器",
+ "reset": "重置"
+ },
+ "categoryTabs": {
+ "face": "面部",
+ "body": "身体",
+ "style": "风格"
+ },
+ "subcategories": {
+ "character_type": "角色类型",
+ "gender": "性别",
+ "ethnicity_origin_base": "种族 / 出身",
+ "eye_color": "眼睛颜色",
+ "eyes_type": "眼睛类型",
+ "eyes_details": "眼部特征",
+ "mouth": "嘴巴与牙齿",
+ "ears": "耳朵",
+ "horns": "角",
+ "skin_conditions": "皮肤状况",
+ "face_skin_material": "面部皮肤材质",
+ "face_surface_pattern": "皮肤图案",
+ "body_type": "体型",
+ "left_arm": "左臂",
+ "right_arm": "右臂",
+ "left_leg": "左腿",
+ "right_leg": "右腿",
+ "hair": "毛发 / 头部生长物",
+ "accessories": "配饰与印记",
+ "rendering_style": "渲染风格"
+ },
+ "toolbar": {
+ "shuffle": "随机",
+ "generate": "生成角色",
+ "generating": "生成中…"
+ },
+ "preview": {
+ "generating": "正在生成您的 AI 网红角色…",
+ "emptyTitle": "您的 AI 网红将在此呈现。",
+ "emptySubtitleLine1": "从零开始设计并构建",
+ "emptySubtitleLine2": "您的 AI 网红",
+ "save": "保存",
+ "altGenerated": "生成的 AI 角色"
+ },
+ "tags": {
+ "showMore": "显示更多",
+ "hide": "收起"
+ },
+ "customPrompt": {
+ "placeholder": "添加更多细节…例如霓虹赛博朋克灯光、戏剧性阴影"
+ },
+ "gallery": {
+ "title": "已生成",
+ "countSuffix": "个角色",
+ "emptyText": "生成的角色\n将显示在此处",
+ "altPrefix": "角色",
+ "download": "下载"
+ },
+ "errors": {
+ "generationFailed": "生成失败,请重试。"
+ }
+}
diff --git a/packages/studio/src/messages/zh/appsStudio.json b/packages/studio/src/messages/zh/appsStudio.json
new file mode 100644
index 00000000..ac466f88
--- /dev/null
+++ b/packages/studio/src/messages/zh/appsStudio.json
@@ -0,0 +1,42 @@
+{
+ "hero": {
+ "badge": "现成可变现模板",
+ "titleLine1": "上线一款 AI 应用,",
+ "titleLine2": "今天就开始赚钱。",
+ "subtitle": "每个模板都是一套功能完整、已集成 Stripe 支付的 AI SaaS 应用,几分钟内即可部署。向用户收费、利润归你所有——AI 基础设施由 muapi 负责。"
+ },
+ "steps": {
+ "stepLabel": "步骤",
+ "deploy": {
+ "title": "几分钟内完成部署",
+ "body": "Fork 开源模板,填入你的 muapi 密钥,然后推送到 Vercel。无需搭建后端。"
+ },
+ "collect": {
+ "title": "收取付款",
+ "body": "Stripe 已预先接入。自行设置定价——一次性积分、订阅制或按次付费均可。"
+ },
+ "keep": {
+ "title": "利润全归你",
+ "body": "款项直接进入你的 Stripe 账户。产品、品牌和利润都归你所有。"
+ }
+ },
+ "card": {
+ "templateFallback": "模板",
+ "github": "Github",
+ "demo": "演示"
+ },
+ "footer": {
+ "moreComingSoon": "Muapi 生态系统 — 更多模板即将上线"
+ },
+ "modal": {
+ "deployTitle": "部署 {appName}",
+ "body": "请留下您的信息,我们会将 {appName} 模板及部署说明发送给您,以便您立即部署并开始盈利。",
+ "sending": "正在发送详情...",
+ "getTemplate": "获取模板",
+ "maybeLater": "稍后再说"
+ },
+ "toast": {
+ "requestSuccess": "已收到!我们会尽快为您发送模板详情。",
+ "requestError": "登记意向失败,请稍后重试。"
+ }
+}
diff --git a/packages/studio/src/messages/zh/audioStudio.json b/packages/studio/src/messages/zh/audioStudio.json
new file mode 100644
index 00000000..db6c09ad
--- /dev/null
+++ b/packages/studio/src/messages/zh/audioStudio.json
@@ -0,0 +1,53 @@
+{
+ "uploader": {
+ "clear": "清除",
+ "uploadPrompt": "上传音频文件",
+ "uploadHint": "支持 MP3、WAV、M4A,最大 20MB",
+ "uploading": "上传中...",
+ "ready": "已准备好生成",
+ "maxSuffix": "(最多 {max} 个)",
+ "trackLabel": "音轨 #{index}",
+ "sizeLimitError": "音频文件超过 20MB 限制。",
+ "uploadFailedError": "上传失败:{message}"
+ },
+ "player": {
+ "nowPlaying": "正在播放",
+ "defaultTitle": "生成的音轨",
+ "muteUnmute": "静音/取消静音",
+ "pause": "暂停",
+ "play": "播放",
+ "download": "下载音频",
+ "save": "保存"
+ },
+ "sidebar": {
+ "modelLabel": "音频模型",
+ "selectModel": "选择模型",
+ "descriptionLabel": "描述",
+ "selectOption": "选择选项",
+ "promptPlaceholder": "输入您想要生成的内容...",
+ "lyricsPromptLabel": "歌词 / 提示词",
+ "fieldPlaceholder": "输入{field}...",
+ "requiredFieldError": "请填写必填字段:{field}"
+ },
+ "generate": {
+ "generating": "正在生成音频...",
+ "cta": "生成音轨",
+ "noUrlError": "API 未返回音频地址。",
+ "genericError": "音频生成失败",
+ "droppedFileUploadError": "上传拖放的文件失败:{message}"
+ },
+ "result": {
+ "errorHeading": "生成错误",
+ "loadingHeading": "正在生成配乐",
+ "loadingSubtext": "正在渲染音频波形和人声...",
+ "emptyHeading": "音频工作室",
+ "emptyBody": "选择一个 AI 音乐模型、声音克隆或音效生成器。在左侧修改参数,创作您的下一段高保真音轨。",
+ "newGeneration": "新建生成",
+ "success": "成功"
+ },
+ "history": {
+ "heading": "生成历史({count})",
+ "untitled": "未命名音频",
+ "fallbackModel": "音频"
+ }
+}
diff --git a/packages/studio/src/messages/zh/cinemaStudio.json b/packages/studio/src/messages/zh/cinemaStudio.json
new file mode 100644
index 00000000..b4298c83
--- /dev/null
+++ b/packages/studio/src/messages/zh/cinemaStudio.json
@@ -0,0 +1,49 @@
+{
+ "cameraOverlay": {
+ "eyebrow": "影院工作室",
+ "title": "相机设置",
+ "description": "通过选择相机、镜头、焦距和景深,打造统一的电影质感。",
+ "close": "关闭",
+ "closeAria": "关闭相机设置",
+ "columns": {
+ "camera": "相机",
+ "lens": "镜头",
+ "focalLength": "焦距",
+ "aperture": "光圈"
+ }
+ },
+ "dropdowns": {
+ "aspectRatio": "宽高比",
+ "resolution": "分辨率"
+ },
+ "actions": {
+ "copyPrompt": "复制提示词",
+ "promptCopied": "提示词已复制",
+ "copyImage": "复制图片",
+ "imageCopied": "图片已复制",
+ "download": "下载",
+ "delete": "删除",
+ "deleteConfirm": "确定要删除此生成结果吗?"
+ },
+ "card": {
+ "noPrompt": "无提示词",
+ "badge": "影院工作室",
+ "historyItemAlt": "历史记录 {index}"
+ },
+ "empty": {
+ "kicker": "开始使用",
+ "title": "影院工作室",
+ "description": "如果预算无限,你想拍什么?自由掌控相机、灯光、镜头,写下高端电影级场景的提示词。"
+ },
+ "prompt": {
+ "placeholder": "描述你的电影场景...",
+ "generating": "生成中...",
+ "generate": "拍摄"
+ },
+ "fullscreen": {
+ "alt": "全屏预览"
+ },
+ "referenceImage": {
+ "alt": "参考图片"
+ }
+}
diff --git a/packages/studio/src/messages/zh/clippingStudio.json b/packages/studio/src/messages/zh/clippingStudio.json
new file mode 100644
index 00000000..a96b67e2
--- /dev/null
+++ b/packages/studio/src/messages/zh/clippingStudio.json
@@ -0,0 +1,73 @@
+{
+ "headings": {
+ "startCreatingWith": "开始使用",
+ "aiClippingStudio": "AI 剪辑工作室",
+ "emptyStateSubtitle": "自动从您的视频中提取爆款高光片段和精确的时间点。",
+ "clippingHistoryRuns": "剪辑历史记录",
+ "savedGenerations": "已保存 {count} 个生成结果",
+ "backToHistory": "返回历史记录",
+ "highlightsTimeline": "高光时间轴",
+ "matches": "{count} 个匹配项",
+ "extractedVideoClips": "已提取的视频片段",
+ "aspectRatioLabel": "宽高比:{ratio}",
+ "originalVideoPlayer": "原始视频播放器"
+ },
+ "modes": {
+ "timelineSeek": "时间轴定位模式",
+ "clipsGallery": "片段画廊模式"
+ },
+ "labels": {
+ "highlights": "{count} 个高光片段",
+ "clips": "{count} 个片段",
+ "highlightFallback": "高光片段 #{index}",
+ "scoreSuffix": "% 匹配度",
+ "durationSuffix": "秒时长",
+ "seekAndPlay": "跳转并播放",
+ "clipIndex": "片段 #{index}",
+ "aiClipping": "AI 剪辑"
+ },
+ "buttons": {
+ "deleteFromHistory": "从历史记录中删除",
+ "delete": "删除",
+ "copyLink": "复制链接",
+ "copyLinkShort": "复制链接",
+ "download": "下载",
+ "clearVideo": "清除视频",
+ "uploadSourceVideo": "上传源视频",
+ "generate": "生成 ✦ 5",
+ "generating": "生成中...",
+ "coordinatesOnly": "仅返回坐标"
+ },
+ "placeholders": {
+ "promptOrUrl": "描述要提取的提示词/高光片段"
+ },
+ "popovers": {
+ "aspectRatio": "宽高比",
+ "maxHighlights": "最大高光数量",
+ "limit": "限制:"
+ },
+ "empty": {
+ "noHighlights": "未提取到任何高光片段。",
+ "noClips": "未生成任何视频片段,请重试。"
+ },
+ "alerts": {
+ "urlCopied": "链接已复制到剪贴板!",
+ "needVideo": "请先上传视频或粘贴视频链接。"
+ },
+ "errors": {
+ "dismissNotification": "关闭通知",
+ "videoTooLarge": "该文件在此模式下过大。请压缩或裁剪视频后再上传较小的文件。",
+ "videoExceedsLimit": "视频超过 {mb}MB 限制。",
+ "uploadFailed": "视频上传失败,请重试。",
+ "generationFailed": "AI 剪辑处理失败。"
+ },
+ "sourceVideoFallback": "source_video.mp4",
+ "aspectRatioLabels": {
+ "9:16": "9:16(TikTok / Reels / Shorts)",
+ "16:9": "16:9(YouTube / 电视)",
+ "1:1": "1:1(Instagram 方形)",
+ "4:5": "4:5(Instagram 竖版)",
+ "4:3": "4:3(经典视频)",
+ "3:4": "3:4(竖版)"
+ }
+}
diff --git a/packages/studio/src/messages/zh/imageStudio.json b/packages/studio/src/messages/zh/imageStudio.json
new file mode 100644
index 00000000..0fdac04d
--- /dev/null
+++ b/packages/studio/src/messages/zh/imageStudio.json
@@ -0,0 +1,68 @@
+{
+ "uploadButton": {
+ "faceLabel": "人脸",
+ "referenceImageLabel": "参考图片",
+ "addUpToImages": "最多添加 {max} 张图片",
+ "singleSelectedTitle": "已选择 1 张图片 — 点击可继续添加(最多 {max} 张)",
+ "multiSelectedTitle": "已选择 {count}/{max} 张图片 — 点击管理",
+ "tooLargeAlert": "以下图片过大(最大 10MB):{names}",
+ "uploadFailedAlert": "图片上传失败:{message}",
+ "headerTitle": "参考图片",
+ "selectUpTo": "最多选择 {max} 张图片",
+ "doneButton": "✓ 完成({count})",
+ "uploadFilesButton": "上传文件",
+ "uploadNewButton": "上传新图片",
+ "emptyState": "暂无上传记录",
+ "removeFromHistory": "从历史记录中移除",
+ "selectedCount": "已选择 {count}/{max}",
+ "useSelected": "使用所选图片"
+ },
+ "modelDropdown": {
+ "categoryAll": "全部",
+ "categoryT2I": "文本生成图像",
+ "categoryI2I": "图像生成图像",
+ "allProviders": "所有提供商",
+ "searchPlaceholder": "搜索模型...",
+ "modelsSuffix": "个模型",
+ "noModelsFound": "未找到相关模型"
+ },
+ "gallery": {
+ "generatedImageAlt": "生成的图像",
+ "download": "下载",
+ "delete": "删除",
+ "deleteConfirm": "确定要删除这个生成的项目吗?",
+ "deleteFailed": "删除项目失败",
+ "noPrompt": "未提供提示词",
+ "modelFallback": "图像工作室"
+ },
+ "emptyState": {
+ "heading": "开始使用",
+ "subtitle": "描述一个场景、角色、情绪或风格 — 让它跃然眼前"
+ },
+ "promptBar": {
+ "placeholderMultiImage": "已选择 {count} 张图片 — 描述转换效果(可选)",
+ "placeholderI2I": "描述如何转换这张图片(可选)",
+ "placeholderT2I": "描述你想要创建的图像",
+ "swapFaceLabel": "换脸",
+ "effectFallback": "效果",
+ "drawButton": "绘制",
+ "generating": "生成中...",
+ "generateButton": "生成 ✦"
+ },
+ "popovers": {
+ "model": "模型",
+ "aspectRatio": "宽高比",
+ "resolution": "分辨率",
+ "effectType": "效果类型"
+ },
+ "errors": {
+ "noImageReferenceSupport": "{name} 不支持图像参考。",
+ "uploadReferenceFirst": "请先上传一张参考图片。",
+ "uploadSwapFaceFirst": "请上传一张换脸图片。",
+ "enterPromptFirst": "请输入提示词以生成图像。",
+ "generationFailed": "图像生成失败"
+ },
+ "fullscreen": {
+ "previewAlt": "全屏预览"
+ }
+}
diff --git a/packages/studio/src/messages/zh/layersStudio.json b/packages/studio/src/messages/zh/layersStudio.json
new file mode 100644
index 00000000..83d11d76
--- /dev/null
+++ b/packages/studio/src/messages/zh/layersStudio.json
@@ -0,0 +1,178 @@
+{
+ "common": {
+ "model": "模型",
+ "reset": "重置"
+ },
+ "panels": {
+ "layer-decomposition": "图层分解",
+ "upscale": "超分辨率",
+ "color-grading": "调色",
+ "remove-bg": "背景移除",
+ "expand-crop": "扩图",
+ "tools": "工具"
+ },
+ "menuItems": {
+ "layer-decomposition": "图层分解",
+ "upscale": "超分辨率",
+ "color-grading": "调色",
+ "remove-bg": "移除背景",
+ "expand-crop": "扩展与外扩绘制",
+ "edit-text": "编辑文字",
+ "enhancer": "增强器",
+ "relight": "重新打光",
+ "angles": "角度调整",
+ "new": "新"
+ },
+ "tools": {
+ "uploadOrChangeImage": "上传或更换图片",
+ "clearMarkedRegions": "清除标记区域",
+ "runSelectionEdit": "运行选区编辑",
+ "line": "直线",
+ "arrow": "箭头",
+ "rectangle": "矩形",
+ "circle": "圆形",
+ "customColor": "自定义颜色",
+ "undoStroke": "撤销笔画",
+ "redoStroke": "重做笔画",
+ "clearDrawings": "清除绘画",
+ "selectPointerTool": "选择指针工具",
+ "panTool": "平移工具",
+ "lassoEdit": "套索编辑",
+ "regionalEdit": "区域编辑",
+ "highlightMarkerPen": "高亮记号笔",
+ "eraserTool": "橡皮擦工具",
+ "shapes": "形状 (R)",
+ "resetZoomPan": "重置缩放与平移",
+ "addImage": "添加图片",
+ "runLayerDecomposition": "运行图层分解",
+ "backToTools": "返回工具",
+ "closePanel": "关闭面板",
+ "regionalPromptPlaceholder": "在此输入提示词..."
+ },
+ "sample": {
+ "clickToLoad": "点击加载此图层分解示例",
+ "original": "原图",
+ "layersCount": "5 个图层",
+ "try": "试试 →",
+ "clickToExplore": "点击查看示例"
+ },
+ "settings": {
+ "heading": "设置",
+ "resolution": "分辨率",
+ "layers": "图层数"
+ },
+ "carousel": {
+ "heading": "图层轮播",
+ "soloActive": "仅显示当前",
+ "stackMode": "堆叠模式",
+ "viewOnlyActive": "仅查看当前图层",
+ "downloadAll": "下载全部",
+ "previousLayer": "上一图层",
+ "nextLayer": "下一图层",
+ "toggleVisibility": "切换可见性",
+ "downloadThisLayer": "下载此图层",
+ "save": "保存",
+ "layerLabel": "图层 {n}",
+ "seedreamDecomposed": "Seedream 分解结果"
+ },
+ "colorGrading": {
+ "colorCorrect": { "heading": "色彩校正", "info": "色温、色相、饱和度、对比度与分离色调", "reset": "重置色彩校正" },
+ "softenDetails": { "heading": "细节柔化", "info": "半径与细节柔化程度", "reset": "重置细节柔化" },
+ "bloom": { "heading": "泛光", "info": "光晕扩散与混合模式", "reset": "重置泛光" },
+ "halation": { "heading": "光晕渗色", "info": "强光边缘的红色光晕效果", "reset": "重置光晕渗色" },
+ "lensInstructions": { "heading": "镜头效果", "info": "暗角与光学镜头畸变", "reset": "重置镜头效果" },
+ "exposure": { "heading": "曝光", "info": "曝光档位调整", "reset": "重置曝光" },
+ "filmGrain": { "heading": "胶片颗粒", "info": "模拟胶片颗粒质感", "reset": "重置胶片颗粒" },
+ "resetToDefault": "重置为默认",
+ "resetAll": "重置全部调色",
+ "download": "下载"
+ },
+ "removeBg": {
+ "credit": "1.0 积分",
+ "modelName": "AI 背景移除",
+ "targetPreview": "目标预览",
+ "alphaMatte": "透明通道抠图",
+ "feature1": "精细边缘提取(发丝、毛发、细节轮廓)",
+ "feature2": "高分辨率透明 PNG 输出"
+ },
+ "expandCrop": {
+ "credit": "0.03 积分",
+ "modelName": "AI 图像扩展",
+ "canvasPreview": "画布预览",
+ "boundaryOutpainting": "边界外扩绘制",
+ "expand": "扩展",
+ "feature1": "在匹配光照、风格与纹理的同时扩展边界",
+ "feature2": "自动智能边缘外扩与延展"
+ },
+ "editText": {
+ "heading": "文字编辑工具",
+ "placeholder": "输入文字修改提示词...",
+ "run": "运行文字编辑",
+ "processing": "处理中..."
+ },
+ "enhancer": {
+ "heading": "AI 增强器",
+ "description": "自动优化光照、清晰度与色彩平衡。",
+ "run": "增强图像",
+ "processing": "增强中..."
+ },
+ "relight": {
+ "heading": "AI 重新打光",
+ "description": "调整光照、环境影棚灯光与阴影。",
+ "run": "应用打光",
+ "processing": "打光中..."
+ },
+ "angles": {
+ "heading": "3D 角度透视",
+ "description": "调整透视倾斜与相机角度对齐。",
+ "run": "应用透视角度",
+ "processing": "变换中..."
+ },
+ "footer": {
+ "decomposing": "分解中({progress}%)...",
+ "separateLayers": "分离图层 {count}",
+ "upscaling": "超分辨率处理中({progress}%)...",
+ "upscaleCost": "超分辨率 {cost}",
+ "removingBackground": "正在移除背景({progress}%)...",
+ "removeBackgroundCost": "移除背景 1.0",
+ "expandingBorders": "正在扩展边界({progress}%)...",
+ "expandImageCost": "扩展图像 0.03"
+ },
+ "toasts": {
+ "enterApiKeyUpload": "请输入您的 API 密钥以上传图片。",
+ "imageUploaded": "图片上传成功!",
+ "uploadFailed": "上传失败:{error}",
+ "uploadImageFileOnly": "请上传图片文件。",
+ "fileTooLarge": "文件过大(最大 20MB):{name}",
+ "viewReset": "视图已重置",
+ "enterApiKey": "请输入您的 API 密钥。",
+ "enterRegionPrompt": "请为所选区域输入提示词。",
+ "editFailed": "编辑失败:{error}",
+ "apiKeyMissingSet": "缺少 API 密钥,请先设置您的 API 密钥。",
+ "uploadOrSelectDecompose": "请上传或选择一张图片以分解图层。",
+ "decomposedInto": "已分解为 {count} 个图层!",
+ "decompositionFailed": "图层分解失败:{error}",
+ "uploadOrSelectUpscale": "请选择或上传一张图片以进行超分辨率处理。",
+ "upscaleSuccess": "已使用 {model} 成功完成超分辨率处理!",
+ "upscaleNoOutput": "超分辨率处理已完成,但未返回输出地址。",
+ "upscaleFailed": "超分辨率处理失败:{error}",
+ "uploadOrSelectRemoveBg": "请上传或选择一张图片以移除背景。",
+ "removeBgSuccess": "已使用 AI 背景移除工具干净地移除背景!",
+ "removeBgNoOutput": "背景移除已完成,但未返回输出地址。",
+ "removeBgFailed": "背景移除失败:{error}",
+ "uploadOrSelectExpand": "请上传或选择一张图片以进行扩展。",
+ "expandSuccess": "已使用 AI 图像扩展工具干净地完成图像扩展!",
+ "expandNoOutput": "图像扩展已完成,但未返回输出地址。",
+ "expandFailed": "图像扩展失败:{error}",
+ "upscaleSettingsReset": "超分辨率设置已重置为默认",
+ "resetCategory": "已重置 {category}",
+ "colorGradingReset": "调色已重置为默认",
+ "downloadedGraded": "已下载调色后的图像!",
+ "loadedSample": "已加载 Seedream 5 层示例!",
+ "apiKeyMissing": "缺少 API 密钥。",
+ "uploadImageFirst": "请先上传一张图片。",
+ "toolCompleted": "{tool} 已成功完成!",
+ "operationFailed": "操作失败:{error}",
+ "downloadingAll": "正在下载所有图层..."
+ }
+}
diff --git a/packages/studio/src/messages/zh/lipSyncStudio.json b/packages/studio/src/messages/zh/lipSyncStudio.json
new file mode 100644
index 00000000..58b37bb9
--- /dev/null
+++ b/packages/studio/src/messages/zh/lipSyncStudio.json
@@ -0,0 +1,54 @@
+{
+ "hero": {
+ "titleLine1": "开始使用",
+ "titleLine2": "唇形同步工作室",
+ "subtitle": "将任意语音与任意人脸视频同步,创建高质量的说话头像和视频。"
+ },
+ "modes": {
+ "portraitImage": "人像图片",
+ "video": "视频"
+ },
+ "media": {
+ "imageLabel": "图片",
+ "videoLabel": "视频",
+ "audioLabel": "音频",
+ "uploadFilePrefix": "上传",
+ "uploadFileSuffix": "文件",
+ "clickToClear": "点击清除",
+ "noImage": "无图片",
+ "noVideo": "无视频",
+ "noAudio": "无音频"
+ },
+ "prompt": {
+ "placeholder": "描述说话风格..."
+ },
+ "model": {
+ "selectModel": "选择模型",
+ "dropdownTitle": "模型",
+ "resolutionDropdownTitle": "分辨率"
+ },
+ "actions": {
+ "generate": "同步唇形",
+ "generating": "生成中...",
+ "download": "下载",
+ "delete": "删除"
+ },
+ "confirm": {
+ "deleteItem": "确定要删除此生成内容吗?"
+ },
+ "badges": {
+ "lipSync": "唇形同步"
+ },
+ "errors": {
+ "imageTooLarge": "图片超过 10MB 限制。",
+ "videoTooLarge": "视频超过 50MB 限制。",
+ "audioTooLarge": "音频文件超过 10MB 限制。",
+ "imageUploadFailed": "图片上传失败:{message}",
+ "videoUploadFailed": "视频上传失败:{message}",
+ "audioUploadFailed": "音频上传失败:{message}",
+ "needAudio": "请先上传音频文件。",
+ "needImage": "请先上传人像图片。",
+ "needVideo": "请先上传源视频。",
+ "generationFailed": "唇形同步生成失败"
+ }
+}
diff --git a/packages/studio/src/messages/zh/marketingStudio.json b/packages/studio/src/messages/zh/marketingStudio.json
new file mode 100644
index 00000000..d748c697
--- /dev/null
+++ b/packages/studio/src/messages/zh/marketingStudio.json
@@ -0,0 +1,49 @@
+{
+ "empty": {
+ "titleLine1": "开始使用",
+ "titleLine2": "营销工作室创作",
+ "subtitle": "描述您的场景,上传您的产品,观看高转化率的 AI 视频广告瞬间生成。"
+ },
+ "uploadSlots": {
+ "product": "产品",
+ "avatar": "形象",
+ "references": "参考图",
+ "uploadPrefix": "上传"
+ },
+ "prompt": {
+ "placeholder": "描述您的广告脚本... 使用 @image1 表示产品,@image2 表示形象。"
+ },
+ "dropdowns": {
+ "videoFormatPresets": "视频格式预设",
+ "avatarPresets": "形象预设",
+ "aspectRatio": "宽高比",
+ "resolution": "分辨率",
+ "duration": "时长",
+ "selectAvatarFallback": "选择形象"
+ },
+ "buttons": {
+ "generating": "生成中...",
+ "launch": "生成",
+ "enlargePreview": "放大预览",
+ "enlargeSelectedAvatar": "放大已选形象",
+ "selectAvatar": "选择形象",
+ "download": "下载",
+ "delete": "删除"
+ },
+ "history": {
+ "badge": "营销工作室"
+ },
+ "alt": {
+ "creativeAsset": "创意素材 {index}",
+ "previousAvatar": "上一个形象",
+ "nextAvatar": "下一个形象"
+ },
+ "errors": {
+ "missingScript": "请输入广告脚本。",
+ "missingProductImage": "请上传产品图片。",
+ "generationFailed": "营销广告生成失败"
+ },
+ "confirm": {
+ "deleteItem": "确定要删除此生成内容吗?"
+ }
+}
diff --git a/packages/studio/src/messages/zh/mcpCliStudio.json b/packages/studio/src/messages/zh/mcpCliStudio.json
new file mode 100644
index 00000000..772af6bb
--- /dev/null
+++ b/packages/studio/src/messages/zh/mcpCliStudio.json
@@ -0,0 +1,35 @@
+{
+ "hero": {
+ "badge": "面向开发者与 AI 智能体",
+ "title": "MCP 与 CLI",
+ "description": "在终端、IDE 或任何兼容 MCP 的助手中使用 Open Generative AI。跨 100 多个模型生成电影级图像、视频与音频——无需离开你的工作流程。"
+ },
+ "quickStart": {
+ "sectionLabel": "快速开始",
+ "steps": {
+ "installCli": "安装命令行工具",
+ "signIn": "登录",
+ "addSkills": "添加技能包"
+ }
+ },
+ "features": {
+ "cli": {
+ "description": "在终端中跨 14 种以上 AI 模型生成图像、视频和音频。双重输出模式——面向人类的彩色输出,以及面向智能体的 JSON 输出(--output-json、--jq 过滤)。支持异步工作流、文件上传和额度追踪。"
+ },
+ "mcp": {
+ "description": "将 Claude、Cursor、Windsurf 及任何兼容 MCP 的助手连接到 100 多个生成式模型。托管端点,无需安装。提供 19 个带输入/输出模式的结构化工具,支持异步轮询和账户管理。"
+ },
+ "skills": {
+ "description": "面向 Claude Code、Cursor 和 Gemini CLI 的多模态工具包。内置 Cinema Director、Nano-Banana、UI Designer、Logo Creator、Seedance 2、AI 剪辑和 YouTube Shorts 预设。原生适配智能体,支持 JSON 输出和语义化退出码。"
+ }
+ },
+ "viewOnGithub": "在 GitHub 上查看",
+ "examples": {
+ "sectionLabel": "示例",
+ "imageGeneration": "图像生成",
+ "textToVideo": "文字转视频",
+ "audioCreation": "音频创作",
+ "runSkill": "运行技能"
+ },
+ "footer": "开源 · MIT 许可 · 支持 Claude、Cursor、Windsurf 和 Gemini CLI"
+}
diff --git a/packages/studio/src/messages/zh/recastStudio.json b/packages/studio/src/messages/zh/recastStudio.json
new file mode 100644
index 00000000..06f918f4
--- /dev/null
+++ b/packages/studio/src/messages/zh/recastStudio.json
@@ -0,0 +1,68 @@
+{
+ "labels": {
+ "video": "视频",
+ "characterImage": "角色图片",
+ "library": "素材库",
+ "orientationPrefix": "朝向:"
+ },
+ "buttons": {
+ "use": "使用",
+ "download": "下载",
+ "delete": "删除",
+ "swapBody": "开始换体",
+ "swapping": "正在换体..."
+ },
+ "titles": {
+ "clickToClear": "{fileName} — 点击清除",
+ "uploadFile": "上传{label}文件,或拖放至此",
+ "enlargePreview": "放大预览",
+ "deleteFromLibrary": "从素材库中删除"
+ },
+ "assetLibrary": {
+ "header": "素材库",
+ "tabs": {
+ "videos": "视频",
+ "images": "图片",
+ "results": "结果"
+ },
+ "empty": "未找到素材"
+ },
+ "dropdowns": {
+ "model": "模型",
+ "selectModel": "选择模型",
+ "aspectRatio": "画面比例",
+ "orientation": "朝向",
+ "orientationImage": "图片",
+ "orientationVideo": "视频",
+ "orientationImageDesc": "使用图片朝向(最长 10 秒视频)",
+ "orientationVideoDesc": "使用视频朝向(最长 30 秒视频)"
+ },
+ "empty": {
+ "titleLine1": "开始创作,使用",
+ "titleLine2": "换体工作室",
+ "description": "通过选择一段视频片段和一张目标角色图片,动态替换视频中的角色。"
+ },
+ "placeholders": {
+ "prompt": "可选 — 描述动作或场景..."
+ },
+ "badges": {
+ "bodySwap": "换体"
+ },
+ "confirm": {
+ "deleteGenerated": "确定要删除此生成内容吗?"
+ },
+ "errors": {
+ "videoTooLarge": "视频超过 50MB 限制。",
+ "imageTooLarge": "图片超过 10MB 限制。",
+ "missingVideo": "请先上传源视频。",
+ "missingImage": "请先上传角色图片。",
+ "videoUploadFailed": "视频上传失败:{message}",
+ "imageUploadFailed": "图片上传失败:{message}",
+ "generationFailed": "换体生成失败"
+ },
+ "defaults": {
+ "selectedVideo": "已选视频",
+ "selectedImage": "已选图片",
+ "resultVideo": "结果视频"
+ }
+}
diff --git a/packages/studio/src/messages/zh/vibeMotionStudio.json b/packages/studio/src/messages/zh/vibeMotionStudio.json
new file mode 100644
index 00000000..9c679371
--- /dev/null
+++ b/packages/studio/src/messages/zh/vibeMotionStudio.json
@@ -0,0 +1,59 @@
+{
+ "loading": {
+ "remixing": "正在混剪动态图形…",
+ "generating": "正在生成动态图形…",
+ "backend": "基于 Modal 的 React/Remotion 渲染"
+ },
+ "card": {
+ "modeEdit": "✏ 编辑",
+ "modeGenerated": "✦ 已生成",
+ "download": "下载",
+ "remixThis": "混剪此生成结果",
+ "legacyRemixUnavailable": "旧版生成结果 — 暂不支持混剪。请先生成一个新的动态图形以启用编辑功能。",
+ "delete": "删除",
+ "confirmDelete": "确定要删除此生成项吗?",
+ "noPrompt": "无提示词",
+ "tag": "动感运镜"
+ },
+ "mobileActions": {
+ "download": "下载",
+ "remix": "混剪",
+ "delete": "删除"
+ },
+ "empty": {
+ "titleLine1": "开始使用",
+ "titleLine2": "动感运镜工作室",
+ "description": "根据文本提示生成动态图形动画 — 动态排版、数据图表、Logo 展示等。"
+ },
+ "modeToggle": {
+ "generate": "生成",
+ "edit": "编辑"
+ },
+ "editBanner": {
+ "editingPrefix": "正在编辑:",
+ "selectSource": "从图库中选择一个源生成结果",
+ "cancelEdit": "取消编辑模式"
+ },
+ "placeholder": {
+ "edit": "描述要更改的内容 — “将背景改为深藏青色,柱状图改为金色,添加粒子效果……”",
+ "generate": "描述该动态图形 — “带有发光柱状图和上升数字的动态销售仪表盘”"
+ },
+ "controls": {
+ "aspectRatio": "宽高比",
+ "duration": "时长",
+ "sourcePrefix": "来源:",
+ "pickSource": "选择来源…",
+ "sourceGeneration": "源生成结果",
+ "shortcutHint": "Ctrl+Enter 运行"
+ },
+ "errors": {
+ "staleEditUnavailable": "此生成结果无法混剪 — 服务器未保存动画代码。请先生成一个新的动态图形,然后再对该结果进行混剪。",
+ "generationFailed": "动感运镜生成失败"
+ },
+ "generateButton": {
+ "remixing": "混剪中...",
+ "generating": "生成中...",
+ "remix": "混剪",
+ "generate": "生成"
+ }
+}
diff --git a/packages/studio/src/messages/zh/videoStudio.json b/packages/studio/src/messages/zh/videoStudio.json
new file mode 100644
index 00000000..cc897844
--- /dev/null
+++ b/packages/studio/src/messages/zh/videoStudio.json
@@ -0,0 +1,92 @@
+{
+ "categories": {
+ "all": "全部",
+ "t2v": "文本生成视频",
+ "i2v": "图片生成视频",
+ "v2v": "视频工具"
+ },
+ "providers": {
+ "allProviders": "所有提供商"
+ },
+ "search": {
+ "placeholder": "搜索模型..."
+ },
+ "media": {
+ "image": "图片",
+ "video": "视频",
+ "audio": "音频",
+ "endFrame": "结束帧",
+ "removePrefix": "移除"
+ },
+ "upload": {
+ "uploadStartFrame": "上传起始帧",
+ "uploadEndFrame": "上传结束帧",
+ "uploadUpToReferenceImages": "最多可上传 {count} 张参考图片",
+ "uploadingProgress": "{title}:已上传 {progress}%"
+ },
+ "placeholders": {
+ "editVideo": "描述如何编辑此视频",
+ "continueVideo": "描述如何继续此视频",
+ "motion": "描述运动效果",
+ "motionOptional": "描述运动效果(可选)",
+ "videoReadyRemoveWatermark": "视频已就绪 — 点击生成以去除水印",
+ "motionOrEffect": "描述运动或特效",
+ "motionOrEffectOptional": "描述运动或特效(可选)",
+ "optionalContinueVideo": "可选:描述如何继续此视频...",
+ "describeVideo": "描述你想要创建的视频"
+ },
+ "dropdowns": {
+ "model": "模型",
+ "source": "来源",
+ "baseGeneration": "基础生成",
+ "aspectRatio": "宽高比",
+ "effect": "特效",
+ "effectType": "特效类型",
+ "duration": "时长",
+ "resolution": "分辨率"
+ },
+ "controls": {
+ "draw": "绘制",
+ "generate": "生成",
+ "generating": "生成中..."
+ },
+ "extend": {
+ "continuingGeneration": "正在继续上一个 {family} 生成"
+ },
+ "gallery": {
+ "download": "下载",
+ "extend": "延长",
+ "extendSeedance": "使用 Seedance 2.0 延长功能延长此视频",
+ "delete": "删除",
+ "confirmDelete": "确定要删除此生成项吗?",
+ "noPromptProvided": "未提供提示词",
+ "fallbackTitle": "视频工作室"
+ },
+ "empty": {
+ "heading": "开始使用",
+ "subtitle": "通过动态效果将图片转化为精美的 AI 视频"
+ },
+ "creativeAssets": {
+ "asset1": "创意素材 1",
+ "asset2": "创意素材 2",
+ "asset3": "创意素材 3",
+ "asset4": "创意素材 4"
+ },
+ "errors": {
+ "modelChangedDuringUpload": "上传过程中模型已更改,请重新添加文件。",
+ "modelDoesNotSupportReference": "{family} 不支持{mediaType}参考素材。",
+ "sourceDoesNotAcceptImages": "所选来源不接受图片。",
+ "waitForCurrentUpload": "请等待当前上传完成后再重新添加这些文件。",
+ "imageExceeds10MB": "图片超过 10MB 限制。",
+ "labelExceedsLimit": "{label}超过 {limit}MB 限制。",
+ "labelUploadFailed": "{label}上传失败:{message}",
+ "noPromptForModel": "请为该模型输入提示词。",
+ "uploadVideoFirst": "请先上传视频。",
+ "uploadReferenceImageForMotion": "请上传用于运动控制的参考图片。",
+ "uploadAtLeastOneReferenceImage": "请先上传至少一张参考图片。",
+ "enterPromptToGenerate": "请输入提示词以生成视频。",
+ "noVideoUrlReturned": "API 未返回视频链接",
+ "videoGenerationFailed": "视频生成失败",
+ "deleteItemFailed": "删除项目失败"
+ }
+}