feat(web): i18n (#12471)
This commit is contained in:
@@ -5,6 +5,7 @@ import { Key } from "@opencode-ai/console-core/key.js"
|
||||
import { Billing } from "@opencode-ai/console-core/billing.js"
|
||||
import { withActor } from "~/context/auth.withActor"
|
||||
import styles from "./new-user-section.module.css"
|
||||
import { useI18n } from "~/context/i18n"
|
||||
|
||||
const getUsageInfo = query(async (workspaceID: string) => {
|
||||
"use server"
|
||||
@@ -20,6 +21,7 @@ const listKeys = query(async (workspaceID: string) => {
|
||||
|
||||
export function NewUserSection() {
|
||||
const params = useParams()
|
||||
const i18n = useI18n()
|
||||
const [copiedKey, setCopiedKey] = createSignal(false)
|
||||
const keys = createAsync(() => listKeys(params.id!))
|
||||
const usage = createAsync(() => getUsageInfo(params.id!))
|
||||
@@ -42,16 +44,16 @@ export function NewUserSection() {
|
||||
<div class={styles.root}>
|
||||
<div data-component="feature-grid">
|
||||
<div data-slot="feature">
|
||||
<h3>Tested & Verified Models</h3>
|
||||
<p>We've benchmarked and tested models specifically for coding agents to ensure the best performance.</p>
|
||||
<h3>{i18n.t("workspace.newUser.feature.tested.title")}</h3>
|
||||
<p>{i18n.t("workspace.newUser.feature.tested.body")}</p>
|
||||
</div>
|
||||
<div data-slot="feature">
|
||||
<h3>Highest Quality</h3>
|
||||
<p>Access models configured for optimal performance - no downgrades or routing to cheaper providers.</p>
|
||||
<h3>{i18n.t("workspace.newUser.feature.quality.title")}</h3>
|
||||
<p>{i18n.t("workspace.newUser.feature.quality.body")}</p>
|
||||
</div>
|
||||
<div data-slot="feature">
|
||||
<h3>No Lock-in</h3>
|
||||
<p>Use Zen with any coding agent, and continue using other providers with opencode whenever you want.</p>
|
||||
<h3>{i18n.t("workspace.newUser.feature.lockin.title")}</h3>
|
||||
<p>{i18n.t("workspace.newUser.feature.lockin.body")}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -68,17 +70,17 @@ export function NewUserSection() {
|
||||
setCopiedKey(true)
|
||||
setTimeout(() => setCopiedKey(false), 2000)
|
||||
}}
|
||||
title="Copy API key"
|
||||
title={i18n.t("workspace.newUser.copyApiKey")}
|
||||
>
|
||||
<Show
|
||||
when={copiedKey()}
|
||||
fallback={
|
||||
<>
|
||||
<IconCopy style={{ width: "16px", height: "16px" }} /> Copy Key
|
||||
<IconCopy style={{ width: "16px", height: "16px" }} /> {i18n.t("workspace.newUser.copyKey")}
|
||||
</>
|
||||
}
|
||||
>
|
||||
<IconCheck style={{ width: "16px", height: "16px" }} /> Copied!
|
||||
<IconCheck style={{ width: "16px", height: "16px" }} /> {i18n.t("workspace.newUser.copied")}
|
||||
</Show>
|
||||
</button>
|
||||
</div>
|
||||
@@ -88,13 +90,15 @@ export function NewUserSection() {
|
||||
|
||||
<div data-component="next-steps">
|
||||
<ol>
|
||||
<li>Enable billing</li>
|
||||
<li>{i18n.t("workspace.newUser.step.enableBilling")}</li>
|
||||
<li>
|
||||
Run <code>opencode auth login</code> and select opencode
|
||||
{i18n.t("workspace.newUser.step.login.before")} <code>opencode auth login</code>{" "}
|
||||
{i18n.t("workspace.newUser.step.login.after")}
|
||||
</li>
|
||||
<li>Paste your API key</li>
|
||||
<li>{i18n.t("workspace.newUser.step.pasteKey")}</li>
|
||||
<li>
|
||||
Start opencode and run <code>/models</code> to select a model
|
||||
{i18n.t("workspace.newUser.step.models.before")} <code>/models</code>{" "}
|
||||
{i18n.t("workspace.newUser.step.models.after")}
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user