@@ -5,7 +5,6 @@ import { schedulerDeleteJob, schedulerListJobs } from "../lib/tauri";
55import { isTauriRuntime } from "../utils" ;
66import { createWorkspaceContextKey } from "./workspace-context" ;
77import type { OpenworkServerStore } from "../connections/openwork-server-store" ;
8- import { t } from "../../i18n" ;
98
109export type AutomationsStore = ReturnType < typeof createAutomationsStore > ;
1110
@@ -34,10 +33,10 @@ const buildCreateAutomationPrompt = (
3433 const schedule = input . schedule . trim ( ) ;
3534 const prompt = normalizeSentence ( input . prompt ) ;
3635 if ( ! schedule ) {
37- return { ok : false , error : t ( "automations.schedule_required" ) } ;
36+ return { ok : false , error : "Schedule is required." } ;
3837 }
3938 if ( ! prompt ) {
40- return { ok : false , error : t ( "automations.prompt_required" ) } ;
39+ return { ok : false , error : "Prompt is required." } ;
4140 }
4241 const workdir = ( input . workdir ?? "" ) . trim ( ) ;
4342 const nameSegment = name ? ` named \"${ name } \"` : "" ;
@@ -59,7 +58,7 @@ const buildRunAutomationPrompt = (
5958 if ( job . run ?. prompt || job . prompt ) {
6059 const promptBody = ( job . run ?. prompt ?? job . prompt ?? "" ) . trim ( ) ;
6160 if ( ! promptBody ) {
62- return { ok : false , error : t ( "automations.prompt_empty" ) } ;
61+ return { ok : false , error : "Automation prompt is empty." } ;
6362 }
6463 return {
6564 ok : true ,
@@ -137,10 +136,10 @@ export function createAutomationsStore(options: {
137136 if ( scheduledJobsContextKey ( ) !== requestContextKey ) return "skipped" ;
138137 const status =
139138 options . openworkServer . openworkServerStatus ( ) === "disconnected"
140- ? t ( "automations.server_unavailable" )
139+ ? "OpenWork server unavailable. Connect to sync scheduled tasks."
141140 : options . openworkServer . openworkServerStatus ( ) === "limited"
142- ? t ( "automations.server_needs_token" )
143- : t ( "automations.server_not_ready" ) ;
141+ ? "OpenWork server needs a token to load scheduled tasks."
142+ : "OpenWork server not ready." ;
144143 setScheduledJobsStatus ( status ) ;
145144 return "unavailable" ;
146145 }
@@ -156,7 +155,7 @@ export function createAutomationsStore(options: {
156155 } catch ( error ) {
157156 if ( scheduledJobsContextKey ( ) !== requestContextKey ) return "skipped" ;
158157 const message = error instanceof Error ? error . message : String ( error ) ;
159- setScheduledJobsStatus ( message || t ( "automations.failed_to_load" ) ) ;
158+ setScheduledJobsStatus ( message || "Failed to load scheduled tasks." ) ;
160159 return "error" ;
161160 } finally {
162161 setScheduledJobsBusy ( false ) ;
@@ -181,7 +180,7 @@ export function createAutomationsStore(options: {
181180 } catch ( error ) {
182181 if ( scheduledJobsContextKey ( ) !== requestContextKey ) return "skipped" ;
183182 const message = error instanceof Error ? error . message : String ( error ) ;
184- setScheduledJobsStatus ( message || t ( "automations.failed_to_load" ) ) ;
183+ setScheduledJobsStatus ( message || "Failed to load scheduled tasks." ) ;
185184 return "error" ;
186185 } finally {
187186 setScheduledJobsBusy ( false ) ;
@@ -193,15 +192,15 @@ export function createAutomationsStore(options: {
193192 const client = options . openworkServer . openworkServerClient ( ) ;
194193 const workspaceId = ( options . runtimeWorkspaceId ( ) ?? "" ) . trim ( ) ;
195194 if ( ! client || ! workspaceId ) {
196- throw new Error ( t ( "automations.server_unavailable" ) ) ;
195+ throw new Error ( "OpenWork server unavailable. Connect to sync scheduled tasks." ) ;
197196 }
198197 const response = await client . deleteScheduledJob ( workspaceId , name ) ;
199198 setScheduledJobs ( ( current ) => current . filter ( ( entry ) => entry . slug !== response . job . slug ) ) ;
200199 return ;
201200 }
202201
203202 if ( ! isTauriRuntime ( ) ) {
204- throw new Error ( t ( "automations.desktop_required" ) ) ;
203+ throw new Error ( "Scheduled tasks require the desktop app." ) ;
205204 }
206205 const root = options . selectedWorkspaceRoot ( ) . trim ( ) ;
207206 const job = await schedulerDeleteJob ( name , root || undefined ) ;
0 commit comments