@@ -7,6 +7,7 @@ import ComposerNotice, { type ComposerNotice as ComposerNoticeData } from "./com
77
88import type { ComposerAttachment , ComposerDraft , ComposerPart , PromptMode , SlashCommandOption } from "../../types" ;
99import { perfNow , recordPerfLog } from "../../lib/perf-log" ;
10+ import { t } from "../../../i18n" ;
1011
1112type MentionOption = {
1213 id : string ;
@@ -516,7 +517,7 @@ export default function Composer(props: ComposerProps) {
516517 span . dataset . pasteId = part . id ;
517518 span . dataset . pasteLabel = part . label ;
518519 span . dataset . pasteLines = String ( part . lines ) ;
519- span . title = "Click to expand pasted text" ;
520+ span . title = t ( "composer.expand_pasted" ) ;
520521 span . className =
521522 "inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-semibold bg-gray-3 text-gray-10 border border-gray-6 cursor-pointer hover:bg-gray-4 hover:text-gray-11" ;
522523 return span ;
@@ -1058,7 +1059,7 @@ export default function Composer(props: ComposerProps) {
10581059 const addAttachments = async ( files : File [ ] ) => {
10591060 if ( attachmentsDisabled ( ) ) {
10601061 props . onNotice ( {
1061- title : props . attachmentsDisabledReason ?? "Attachments are unavailable." ,
1062+ title : props . attachmentsDisabledReason ?? t ( "composer.attachments_unavailable" ) ,
10621063 tone : "warning" ,
10631064 } ) ;
10641065 return ;
@@ -1078,7 +1079,7 @@ export default function Composer(props: ComposerProps) {
10781079 for ( const file of supportedFiles ) {
10791080 if ( file . size > MAX_ATTACHMENT_BYTES ) {
10801081 props . onNotice ( {
1081- title : ` ${ file . name } exceeds the 8MB limit.` ,
1082+ title : t ( "composer.file_exceeds_limit" , undefined , { name : file . name } ) ,
10821083 tone : "warning" ,
10831084 } ) ;
10841085 continue ;
@@ -1089,7 +1090,7 @@ export default function Composer(props: ComposerProps) {
10891090 const estimatedJsonBytes = estimateInlineAttachmentBytes ( processed ) ;
10901091 if ( estimatedJsonBytes > MAX_ATTACHMENT_BYTES ) {
10911092 props . onNotice ( {
1092- title : ` ${ file . name } is too large after encoding. Try a smaller image.` ,
1093+ title : t ( "composer.file_too_large_encoding" , undefined , { name : file . name } ) ,
10931094 tone : "warning" ,
10941095 } ) ;
10951096 continue ;
@@ -1105,7 +1106,7 @@ export default function Composer(props: ComposerProps) {
11051106 } ) ;
11061107 } catch ( error ) {
11071108 props . onNotice ( {
1108- title : error instanceof Error ? error . message : "Failed to read attachment" ,
1109+ title : error instanceof Error ? error . message : t ( "composer.failed_read_attachment" ) ,
11091110 tone : "error" ,
11101111 } ) ;
11111112 }
@@ -1221,29 +1222,29 @@ export default function Composer(props: ComposerProps) {
12211222 props . onNotice ( {
12221223 title :
12231224 links . length === 1
1224- ? `Uploaded ${ links [ 0 ] . name } to the shared folder and inserted a link.`
1225- : `Uploaded ${ links . length } files to the shared folder and inserted links.` ,
1225+ ? t ( "composer.uploaded_single_file" , undefined , { name : links [ 0 ] . name } )
1226+ : t ( "composer.uploaded_multiple_files" , undefined , { count : links . length } ) ,
12261227 tone : "success" ,
12271228 } ) ;
12281229 return ;
12291230 }
12301231 }
12311232 props . onNotice ( {
1232- title : "Couldn't upload to the shared folder. Inserted local links instead." ,
1233+ title : t ( "composer.upload_failed_local_links" ) ,
12331234 tone : "warning" ,
12341235 } ) ;
12351236 }
12361237
12371238 const text = formatLinks ( fallbackLinks ( ) ) ;
12381239 if ( ! text ) {
1239- props . onNotice ( { title : "Unsupported attachment type." , tone : "warning" } ) ;
1240+ props . onNotice ( { title : t ( "composer.unsupported_attachment_type" ) , tone : "warning" } ) ;
12401241 return ;
12411242 }
12421243 insertPlainTextAtSelection ( text ) ;
12431244 updateMentionQuery ( ) ;
12441245 updateSlashQuery ( ) ;
12451246 emitDraftChange ( ) ;
1246- props . onNotice ( { title : "Inserted links for unsupported files." , tone : "info" } ) ;
1247+ props . onNotice ( { title : t ( "composer.inserted_links_unsupported" ) , tone : "info" } ) ;
12471248 } ;
12481249
12491250 const handlePaste = ( event : ClipboardEvent ) => {
@@ -1277,10 +1278,9 @@ export default function Composer(props: ComposerProps) {
12771278 const hasAbsoluteWindows = / ( ^ | \s ) [ a - z A - Z ] : \\ / . test ( trimmedForCheck ) ;
12781279 if ( hasFileUrl || hasAbsolutePosix || hasAbsoluteWindows ) {
12791280 props . onNotice ( {
1280- title :
1281- "This is a remote worker. Sandboxes are remote too. To share files with it, upload them to the Shared folder in the sidebar." ,
1281+ title : t ( "composer.remote_worker_paste_warning" ) ,
12821282 tone : "warning" ,
1283- actionLabel : props . onUploadInboxFiles ? "Upload to shared folder" : undefined ,
1283+ actionLabel : props . onUploadInboxFiles ? t ( "composer.upload_to_shared_folder" ) : undefined ,
12841284 onAction : props . onUploadInboxFiles ? ( ) => inboxFileInputRef ?. click ( ) : undefined ,
12851285 } ) ;
12861286 }
@@ -1572,7 +1572,7 @@ export default function Composer(props: ComposerProps) {
15721572 < div class = "max-h-64 overflow-y-auto bg-dls-surface p-2" onMouseDown = { ( event : MouseEvent ) => event . preventDefault ( ) } >
15731573 < Show
15741574 when = { mentionVisible ( ) . length }
1575- fallback = { < div class = "px-3 py-2 text-xs text-gray-10" > No matches found. </ div > }
1575+ fallback = { < div class = "px-3 py-2 text-xs text-gray-10" > { t ( "composer.no_matches" ) } </ div > }
15761576 >
15771577 < For each = { mentionVisible ( ) } >
15781578 { ( option : MentionOption ) => {
@@ -1635,7 +1635,7 @@ export default function Composer(props: ComposerProps) {
16351635 when = { slashFiltered ( ) . length }
16361636 fallback = {
16371637 < div class = "px-3 py-2 text-xs text-gray-10" >
1638- { slashLoading ( ) ? "Loading commands..." : "No commands found." }
1638+ { slashLoading ( ) ? t ( "composer.loading_commands" ) : t ( "composer.no_commands" ) }
16391639 </ div >
16401640 }
16411641 >
@@ -1662,7 +1662,7 @@ export default function Composer(props: ComposerProps) {
16621662 </ div >
16631663 < Show when = { cmd . source && cmd . source !== "command" } >
16641664 < span class = "text-[10px] uppercase tracking-wider text-gray-10 shrink-0" >
1665- { cmd . source === "skill" ? "Skill" : cmd . source === "mcp" ? "MCP" : "" }
1665+ { cmd . source === "skill" ? t ( "composer.skill_source" ) : cmd . source === "mcp" ? "MCP" : "" }
16661666 </ span >
16671667 </ Show >
16681668 </ button >
@@ -1697,7 +1697,7 @@ export default function Composer(props: ComposerProps) {
16971697 < div class = "max-w-[160px]" >
16981698 < div class = "truncate text-gray-11" > { attachment . name } </ div >
16991699 < div class = "text-[10px] text-gray-10" >
1700- { attachment . kind === "image" ? "Image" : attachment . mimeType || "File" }
1700+ { attachment . kind === "image" ? t ( "composer.image_kind" ) : attachment . mimeType || t ( "composer.file_kind" ) }
17011701 </ div >
17021702 </ div >
17031703 < button
@@ -1721,7 +1721,7 @@ export default function Composer(props: ComposerProps) {
17211721 < div class = "relative" >
17221722 < Show when = { ! hasDraftContent ( ) } >
17231723 < div class = "absolute left-0 top-0 text-gray-9 text-[15px] leading-relaxed pointer-events-none" >
1724- Describe your task...
1724+ { t ( "composer.placeholder" ) }
17251725 </ div >
17261726 </ Show >
17271727 < div
@@ -1775,8 +1775,8 @@ export default function Composer(props: ComposerProps) {
17751775 disabled = { attachmentsDisabled ( ) }
17761776 title = {
17771777 attachmentsDisabled ( )
1778- ? props . attachmentsDisabledReason ?? "Attachments are unavailable."
1779- : "Attach files"
1778+ ? props . attachmentsDisabledReason ?? t ( "composer.attachments_unavailable" )
1779+ : t ( "composer.attach_files" )
17801780 }
17811781 >
17821782 < Paperclip size = { 16 } />
@@ -1794,21 +1794,21 @@ export default function Composer(props: ComposerProps) {
17941794 ? "bg-gray-4 text-gray-10"
17951795 : "bg-dls-accent text-white hover:bg-[var(--dls-accent-hover)]"
17961796 } `}
1797- title = "Run task"
1797+ title = { t ( "composer.run_task" ) }
17981798 >
17991799 < ArrowUp size = { 15 } />
1800- < span > Run task </ span >
1800+ < span > { t ( "composer.run_task" ) } </ span >
18011801 </ button >
18021802 }
18031803 >
18041804 < button
18051805 type = "button"
18061806 onClick = { ( ) => props . onStop ( ) }
18071807 class = "inline-flex items-center gap-2 rounded-full bg-gray-12 px-4 py-2 text-[13px] font-medium text-gray-1 transition-colors hover:bg-gray-11"
1808- title = "Stop"
1808+ title = { t ( "composer.stop" ) }
18091809 >
18101810 < Square size = { 12 } fill = "currentColor" />
1811- < span > Stop </ span >
1811+ < span > { t ( "composer.stop" ) } </ span >
18121812 </ button >
18131813 </ Show >
18141814 </ div >
@@ -1829,7 +1829,7 @@ export default function Composer(props: ComposerProps) {
18291829 onClick = { props . onToggleAgentPicker }
18301830 disabled = { props . busy }
18311831 aria-expanded = { props . agentPickerOpen }
1832- title = "Agent"
1832+ title = { t ( "composer.agent_label" ) }
18331833 >
18341834 < span class = "max-w-[140px] truncate" > { props . agentLabel } </ span >
18351835 < ChevronDown size = { 13 } />
@@ -1838,14 +1838,14 @@ export default function Composer(props: ComposerProps) {
18381838 < Show when = { props . agentPickerOpen } >
18391839 < div class = "absolute left-0 bottom-full z-40 mb-2 w-64 overflow-hidden rounded-[18px] border border-dls-border bg-dls-surface shadow-[var(--dls-shell-shadow)]" >
18401840 < div class = "border-b border-dls-border px-3 pt-2 pb-1 text-[10px] font-semibold uppercase tracking-[0.2em] text-gray-10" >
1841- Agent
1841+ { t ( "composer.agent_label" ) }
18421842 </ div >
18431843
18441844 < div class = "p-2 space-y-1 max-h-64 overflow-y-auto" onMouseDown = { ( event : MouseEvent ) => event . preventDefault ( ) } >
18451845 < Show
18461846 when = { ! props . agentPickerBusy }
18471847 fallback = {
1848- < div class = "px-3 py-2 text-xs text-gray-10" > Loading agents... </ div >
1848+ < div class = "px-3 py-2 text-xs text-gray-10" > { t ( "composer.loading_agents" ) } </ div >
18491849 }
18501850 >
18511851 < Show when = { ! props . agentPickerError } >
@@ -1860,7 +1860,7 @@ export default function Composer(props: ComposerProps) {
18601860 props . onSelectAgent ( null ) ;
18611861 } }
18621862 >
1863- < span > Default agent </ span >
1863+ < span > { t ( "composer.default_agent" ) } </ span >
18641864 < Show when = { ! props . selectedAgent } >
18651865 < Check size = { 14 } class = "text-gray-10" />
18661866 </ Show >
@@ -1931,7 +1931,7 @@ export default function Composer(props: ComposerProps) {
19311931 < Show when = { variantMenuOpen ( ) } >
19321932 < div class = "absolute left-0 bottom-full z-40 mb-2 w-48 overflow-hidden rounded-[18px] border border-dls-border bg-dls-surface shadow-[var(--dls-shell-shadow)]" >
19331933 < div class = "border-b border-dls-border px-3 pt-2 pb-1 text-[10px] font-semibold uppercase tracking-[0.2em] text-gray-10" >
1934- Behavior
1934+ { t ( "composer.behavior_label" ) }
19351935 </ div >
19361936 < div class = "p-2 space-y-1" >
19371937 < For each = { props . modelBehaviorOptions } >
0 commit comments