Skip to content

Commit 4f217f6

Browse files
Revert "feat(i18n): extract en translations — context/lib/misc (#1251)"
This reverts commit c349413.
1 parent 61153af commit 4f217f6

5 files changed

Lines changed: 59 additions & 114 deletions

File tree

apps/app/src/app/components/mcp-auth-modal.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export default function McpAuthModal(props: McpAuthModalProps) {
168168
statusPoll = window.setInterval(async () => {
169169
if (Date.now() - startedAt >= MCP_AUTH_TIMEOUT_MS) {
170170
stopStatusPolling();
171-
setError(translate("mcp.auth.request_timed_out"));
171+
setError("Request timed out.");
172172
return;
173173
}
174174

@@ -694,7 +694,7 @@ export default function McpAuthModal(props: McpAuthModalProps) {
694694
<CheckCircle2 size={24} class="text-green-11" />
695695
</div>
696696
<div>
697-
<p class="text-sm font-medium text-gray-12">{translate("mcp.auth.already_connected")}</p>
697+
<p class="text-sm font-medium text-gray-12">Already Connected</p>
698698
<p class="text-xs text-gray-11">
699699
{translate("mcp.auth.already_connected_description", { server: serverName() })}
700700
</p>
@@ -804,7 +804,7 @@ export default function McpAuthModal(props: McpAuthModalProps) {
804804
</div>
805805
<div class="rounded-xl border border-gray-6/70 bg-gray-2/40 px-3 py-2 flex items-center gap-3">
806806
<div class="flex-1 min-w-0">
807-
<div class="text-[10px] uppercase tracking-wide text-gray-8">{translate("mcp.auth.authorization_link")}</div>
807+
<div class="text-[10px] uppercase tracking-wide text-gray-8">Authorization link</div>
808808
<div class="text-[11px] text-gray-11 font-mono truncate">
809809
{authorizationUrl()}
810810
</div>
@@ -814,7 +814,7 @@ export default function McpAuthModal(props: McpAuthModalProps) {
814814
class="text-xs"
815815
onClick={handleCopyAuthorizationUrl}
816816
>
817-
{authUrlCopied() ? translate("mcp.auth.copied") : translate("mcp.auth.copy_link")}
817+
{authUrlCopied() ? "Copied" : "Copy link"}
818818
</Button>
819819
</div>
820820
<TextInput
@@ -851,7 +851,7 @@ export default function McpAuthModal(props: McpAuthModalProps) {
851851
1
852852
</div>
853853
<div>
854-
<p class="text-sm font-medium text-gray-12">{translate("mcp.auth.step1_title")}</p>
854+
<p class="text-sm font-medium text-gray-12">Opening your browser</p>
855855
<p class="text-xs text-gray-10 mt-1">
856856
{translate("mcp.auth.step1_description", { server: serverName() })}
857857
</p>
@@ -863,7 +863,7 @@ export default function McpAuthModal(props: McpAuthModalProps) {
863863
2
864864
</div>
865865
<div>
866-
<p class="text-sm font-medium text-gray-12">{translate("mcp.auth.step2_title")}</p>
866+
<p class="text-sm font-medium text-gray-12">Authorize OpenWork</p>
867867
<p class="text-xs text-gray-10 mt-1">
868868
{translate("mcp.auth.step2_description")}
869869
</p>
@@ -875,7 +875,7 @@ export default function McpAuthModal(props: McpAuthModalProps) {
875875
3
876876
</div>
877877
<div>
878-
<p class="text-sm font-medium text-gray-12">{translate("mcp.auth.step3_title")}</p>
878+
<p class="text-sm font-medium text-gray-12">Return here when you're done</p>
879879
<p class="text-xs text-gray-10 mt-1">
880880
{translate("mcp.auth.step3_description")}
881881
</p>

apps/app/src/app/components/question-modal.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import type { QuestionInfo } from "@opencode-ai/sdk/v2/client";
44
import { Check, ChevronRight, HelpCircle } from "lucide-solid";
55

66
import Button from "./button";
7-
import { t } from "../../i18n";
87

98
export type QuestionModalProps = {
109
open: boolean;
@@ -139,10 +138,10 @@ export default function QuestionModal(props: QuestionModalProps) {
139138
</div>
140139
<div>
141140
<h3 class="text-lg font-semibold text-gray-12">
142-
{currentQuestion()!.header || t("common.question")}
141+
{currentQuestion()!.header || "Question"}
143142
</h3>
144143
<div class="text-xs text-gray-11 font-medium">
145-
{t("question_modal.question_counter", undefined, { current: currentIndex() + 1, total: props.questions.length })}
144+
Question {currentIndex() + 1} of {props.questions.length}
146145
</div>
147146
</div>
148147
</div>
@@ -187,14 +186,14 @@ export default function QuestionModal(props: QuestionModalProps) {
187186
<Show when={currentQuestion()!.custom}>
188187
<div class="mt-4 pt-4 border-t border-dls-border">
189188
<label class="block text-xs font-semibold text-dls-secondary mb-2 uppercase tracking-wide">
190-
{t("question_modal.custom_answer_label")}
189+
Or type a custom answer
191190
</label>
192191
<input
193192
type="text"
194193
value={customInput()}
195194
onInput={(e) => setCustomInput(e.currentTarget.value)}
196195
class="w-full px-4 py-3 rounded-xl bg-dls-surface border border-dls-border focus:border-dls-accent focus:ring-4 focus:ring-[rgba(var(--dls-accent-rgb),0.2)] focus:outline-none text-sm text-dls-text placeholder:text-dls-secondary transition-shadow"
197-
placeholder={t("question_modal.custom_answer_placeholder")}
196+
placeholder="Type your answer here..."
198197
onKeyDown={(e) => {
199198
if (e.key === "Enter") {
200199
if (e.isComposing || e.keyCode === 229) return;
@@ -210,15 +209,15 @@ export default function QuestionModal(props: QuestionModalProps) {
210209
<div class="p-6 border-t border-dls-border bg-dls-hover flex justify-between items-center">
211210
<div class="text-xs text-dls-secondary flex items-center gap-2">
212211
<span class="px-1.5 py-0.5 rounded border border-dls-border bg-dls-active font-mono">↑↓</span>
213-
<span>{t("common.navigate")}</span>
212+
<span>navigate</span>
214213
<span class="px-1.5 py-0.5 rounded border border-gray-6 bg-gray-3 font-mono ml-2"></span>
215-
<span>{t("common.select")}</span>
214+
<span>select</span>
216215
</div>
217216

218217
<div class="flex gap-2">
219218
<Show when={currentQuestion()?.multiple || currentQuestion()?.custom}>
220219
<Button onClick={handleNext} disabled={!canProceed() || props.busy} class="!px-6">
221-
{isLastQuestion() ? t("common.submit") : t("common.next")}
220+
{isLastQuestion() ? "Submit" : "Next"}
222221
<Show when={!isLastQuestion()}>
223222
<ChevronRight size={16} class="ml-1 -mr-1 opacity-60" />
224223
</Show>

apps/app/src/app/context/automations.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { schedulerDeleteJob, schedulerListJobs } from "../lib/tauri";
55
import { isTauriRuntime } from "../utils";
66
import { createWorkspaceContextKey } from "./workspace-context";
77
import type { OpenworkServerStore } from "../connections/openwork-server-store";
8-
import { t } from "../../i18n";
98

109
export 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

Comments
 (0)