diff --git a/package.json b/package.json index 0305ea85..29fea0bd 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,8 @@ ], "scripts": { "dev": "bun run --hot apps/web/src/index.ts", - "i18n:compile": "paraglide-js compile --project ./packages/webui/project.inlang --outdir ./packages/webui/paraglide --emit-ts-declarations --no-emit-git-ignore", - "i18n:watch": "paraglide-js compile --project ./packages/webui/project.inlang --outdir ./packages/webui/paraglide --watch --emit-ts-declarations --no-emit-git-ignore", + "i18n:compile": "bunx @inlang/paraglide-js compile --project ./packages/webui/project.inlang --outdir ./packages/webui/paraglide --emit-ts-declarations --no-emit-git-ignore", + "i18n:watch": "bunx @inlang/paraglide-js compile --project ./packages/webui/project.inlang --outdir ./packages/webui/paraglide --watch --emit-ts-declarations --no-emit-git-ignore", "typecheck": "tsc --noEmit", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "test": "bun --bun vitest run", diff --git a/packages/webui/components/auth-layout.tsx b/packages/webui/components/auth-layout.tsx index 3a60e4eb..fbb4c2cf 100644 --- a/packages/webui/components/auth-layout.tsx +++ b/packages/webui/components/auth-layout.tsx @@ -1,6 +1,7 @@ import { ShumaiLogo } from '@/ui/components/ui/icons' import { CheckCircle2 } from 'lucide-react' import { ReactNode } from 'react' +import { m } from '@/ui/paraglide/messages.js' export function AuthLayout({ children }: { children: ReactNode }) { return ( @@ -27,41 +28,31 @@ export function AuthLayout({ children }: { children: ReactNode }) { {/* Marketing Copy / Feature Points */}

- One workspace -
- for all your -
- - creative assets. - + {m.auth_tagline()}

- Upload and index your files, enrich them with custom metadata schemas, draw - annotations directly on media, and gather instant feedback — all in one modern - workspace built for creators. + {m.auth_description()}

{/* Footer Label */}

- Join our community of developers and designers. + {m.auth_community_cta()}

diff --git a/packages/webui/components/settings/AgentFormDialog.tsx b/packages/webui/components/settings/AgentFormDialog.tsx index 5bb06243..b6729993 100644 --- a/packages/webui/components/settings/AgentFormDialog.tsx +++ b/packages/webui/components/settings/AgentFormDialog.tsx @@ -23,6 +23,7 @@ import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query' import { useForm, useStore } from '@tanstack/react-form' import { Loader2, Puzzle } from 'lucide-react' import { useEffect, useMemo } from 'react' +import { m } from '@/ui/paraglide/messages.js' import { toast } from 'sonner' import { AgentInfo, AgentType, ThinkingLevel, thinkingLevelSchema } from '@shumai/dtos' import { Textarea } from '@/ui/components/ui/textarea' @@ -41,7 +42,7 @@ interface AgentFormDialogProps { } const agentFormSchema = z.object({ - name: z.string().min(1, 'Name is required'), + name: z.string().min(1, m.name_is_required()), type: z.enum(['chat', 'autofill', 'embedding']), avatar: z.string().optional(), providerId: z.string().optional(), @@ -98,14 +99,14 @@ export function AgentFormDialog({ if (!data.providerId) { ctx.addIssue({ code: z.ZodIssueCode.custom, - message: 'Provider is required', + message: m.provider_is_required(), path: ['providerId'], }) } if (!data.modelId) { ctx.addIssue({ code: z.ZodIssueCode.custom, - message: 'Model is required', + message: m.model_is_required(), path: ['modelId'], }) } @@ -167,10 +168,10 @@ export function AgentFormDialog({ onSuccess: () => { onClose() queryClient.invalidateQueries({ queryKey: ['agents', teamId] }) - toast.success('Agent created successfully') + toast.success(m.agent_created_successfully()) }, onError: (error) => { - toast.error(`Error: ${error.message}`) + toast.error(m.error_message({ message: error.message })) }, }) @@ -186,10 +187,10 @@ export function AgentFormDialog({ onSuccess: () => { onClose() queryClient.invalidateQueries({ queryKey: ['agents', teamId] }) - toast.success('Agent updated successfully') + toast.success(m.agent_updated_successfully()) }, onError: (error) => { - toast.error(`Error: ${error.message}`) + toast.error(m.error_message({ message: error.message })) }, }) @@ -217,9 +218,7 @@ export function AgentFormDialog({ {title} - - Configure your AI agent's personality and capabilities. - + {m.configure_agent_description()}
- Agent Name + {m.agent_name()} field.handleChange(e.target.value)} - placeholder="e.g., Support Assistant" + placeholder={m.agent_name_placeholder()} aria-invalid={isInvalid} /> {isInvalid && } @@ -257,7 +256,7 @@ export function AgentFormDialog({ name="type" children={(field) => ( - Agent Type + {m.agent_type()} @@ -280,7 +279,7 @@ export function AgentFormDialog({ name="avatar" children={(field) => ( - Agent Avatar + {m.agent_avatar()}
{AVAILABLE_AVATARS.map((avatarPath) => { const isSelected = field.state.value === avatarPath @@ -299,7 +298,7 @@ export function AgentFormDialog({ Preset Avatar Option ) @@ -312,7 +311,7 @@ export function AgentFormDialog({ Current Custom Avatar )} @@ -332,7 +331,7 @@ export function AgentFormDialog({ !!field.state.meta.errors.length && field.state.meta.isTouched return ( - Provider + {m.provider()} - + {models?.map((m) => ( @@ -397,26 +396,34 @@ export function AgentFormDialog({
( - - Thinking Level - - - )} + children={(field) => { + const thinkingLabels: Record = { + off: m.thinking_disable(), + low: m.thinking_low(), + medium: m.thinking_medium(), + high: m.thinking_high(), + } + return ( + + {m.thinking_level()} + + + ) + }} />
@@ -425,12 +432,12 @@ export function AgentFormDialog({ name="soul" children={(field) => ( - Agent Soul (Personality) + {m.agent_soul()}