From 83708c295c0cdff32ec155d81813ad346b232e35 Mon Sep 17 00:00:00 2001 From: Adam <2363879+adamdotdevin@users.noreply.github.com> Date: Mon, 9 Feb 2026 12:16:26 -0600 Subject: chore: cleanup --- packages/console/app/src/routes/docs/[...path].ts | 7 ++++--- packages/console/app/src/routes/docs/index.ts | 7 ++++--- packages/console/app/src/routes/download/index.tsx | 14 +++++++------- packages/console/app/src/routes/s/[id].ts | 7 ++++--- packages/console/app/src/routes/workspace/[id]/index.tsx | 4 +++- 5 files changed, 22 insertions(+), 17 deletions(-) (limited to 'packages/console/app/src/routes') diff --git a/packages/console/app/src/routes/docs/[...path].ts b/packages/console/app/src/routes/docs/[...path].ts index 81c4fc3e9..c4baebbfb 100644 --- a/packages/console/app/src/routes/docs/[...path].ts +++ b/packages/console/app/src/routes/docs/[...path].ts @@ -1,13 +1,14 @@ import type { APIEvent } from "@solidjs/start/server" -import { localeFromRequest, tag } from "~/lib/language" +import { docs, localeFromRequest, tag } from "~/lib/language" async function handler(evt: APIEvent) { const req = evt.request.clone() const url = new URL(req.url) - const targetUrl = `https://docs.opencode.ai${url.pathname}${url.search}` + const locale = localeFromRequest(req) + const targetUrl = `https://docs.opencode.ai${docs(locale, url.pathname)}${url.search}` const headers = new Headers(req.headers) - headers.set("accept-language", tag(localeFromRequest(req))) + headers.set("accept-language", tag(locale)) const response = await fetch(targetUrl, { method: req.method, diff --git a/packages/console/app/src/routes/docs/index.ts b/packages/console/app/src/routes/docs/index.ts index 81c4fc3e9..c4baebbfb 100644 --- a/packages/console/app/src/routes/docs/index.ts +++ b/packages/console/app/src/routes/docs/index.ts @@ -1,13 +1,14 @@ import type { APIEvent } from "@solidjs/start/server" -import { localeFromRequest, tag } from "~/lib/language" +import { docs, localeFromRequest, tag } from "~/lib/language" async function handler(evt: APIEvent) { const req = evt.request.clone() const url = new URL(req.url) - const targetUrl = `https://docs.opencode.ai${url.pathname}${url.search}` + const locale = localeFromRequest(req) + const targetUrl = `https://docs.opencode.ai${docs(locale, url.pathname)}${url.search}` const headers = new Headers(req.headers) - headers.set("accept-language", tag(localeFromRequest(req))) + headers.set("accept-language", tag(locale)) const response = await fetch(targetUrl, { method: req.method, diff --git a/packages/console/app/src/routes/download/index.tsx b/packages/console/app/src/routes/download/index.tsx index 04c3ab0d0..e5e4e9750 100644 --- a/packages/console/app/src/routes/download/index.tsx +++ b/packages/console/app/src/routes/download/index.tsx @@ -294,7 +294,7 @@ export default function Download() { VS Code - + {i18n.t("download.action.install")} @@ -318,7 +318,7 @@ export default function Download() { Cursor - + {i18n.t("download.action.install")} @@ -335,7 +335,7 @@ export default function Download() { Zed - + {i18n.t("download.action.install")} @@ -352,7 +352,7 @@ export default function Download() { Windsurf - + {i18n.t("download.action.install")} @@ -369,7 +369,7 @@ export default function Download() { VSCodium - + {i18n.t("download.action.install")} @@ -393,7 +393,7 @@ export default function Download() { GitHub - + {i18n.t("download.action.install")} @@ -410,7 +410,7 @@ export default function Download() { GitLab - + {i18n.t("download.action.install")} diff --git a/packages/console/app/src/routes/s/[id].ts b/packages/console/app/src/routes/s/[id].ts index eaf89328c..7f32c7d9d 100644 --- a/packages/console/app/src/routes/s/[id].ts +++ b/packages/console/app/src/routes/s/[id].ts @@ -1,13 +1,14 @@ import type { APIEvent } from "@solidjs/start/server" -import { localeFromRequest, tag } from "~/lib/language" +import { docs, localeFromRequest, tag } from "~/lib/language" async function handler(evt: APIEvent) { const req = evt.request.clone() const url = new URL(req.url) - const targetUrl = `https://docs.opencode.ai/docs${url.pathname}${url.search}` + const locale = localeFromRequest(req) + const targetUrl = `https://docs.opencode.ai${docs(locale, `/docs${url.pathname}`)}${url.search}` const headers = new Headers(req.headers) - headers.set("accept-language", tag(localeFromRequest(req))) + headers.set("accept-language", tag(locale)) const response = await fetch(targetUrl, { method: req.method, diff --git a/packages/console/app/src/routes/workspace/[id]/index.tsx b/packages/console/app/src/routes/workspace/[id]/index.tsx index 408f6a113..c91cfd2bc 100644 --- a/packages/console/app/src/routes/workspace/[id]/index.tsx +++ b/packages/console/app/src/routes/workspace/[id]/index.tsx @@ -9,10 +9,12 @@ import { GraphSection } from "./graph-section" import { IconLogo } from "~/component/icon" import { querySessionInfo, queryBillingInfo, createCheckoutUrl, formatBalance } from "../common" import { useI18n } from "~/context/i18n" +import { useLanguage } from "~/context/language" export default function () { const params = useParams() const i18n = useI18n() + const language = useLanguage() const userInfo = createAsync(() => querySessionInfo(params.id!)) const billingInfo = createAsync(() => queryBillingInfo(params.id!)) const checkoutAction = useAction(createCheckoutUrl) @@ -38,7 +40,7 @@ export default function () {
{i18n.t("workspace.home.banner.beforeLink")}{" "} - + {i18n.t("common.learnMore")} . -- cgit v1.2.3