feat(www): locale specific urls (#12508)
This commit is contained in:
@@ -3,10 +3,12 @@ import { Title } from "@solidjs/meta"
|
||||
import { createMemo, createSignal, For, Match, onMount, Show, Switch } from "solid-js"
|
||||
import { PlanIcon, plans } from "./common"
|
||||
import { useI18n } from "~/context/i18n"
|
||||
import { useLanguage } from "~/context/language"
|
||||
|
||||
export default function Black() {
|
||||
const [params] = useSearchParams()
|
||||
const i18n = useI18n()
|
||||
const language = useLanguage()
|
||||
const [selected, setSelected] = createSignal<string | null>((params.plan as string) || null)
|
||||
const [mounted, setMounted] = createSignal(false)
|
||||
const selectedPlan = createMemo(() => plans.find((p) => p.id === selected()))
|
||||
@@ -104,7 +106,7 @@ export default function Black() {
|
||||
</Switch>
|
||||
<p data-slot="fine-print" style={{ "view-transition-name": "fine-print" }}>
|
||||
{i18n.t("black.finePrint.beforeTerms")} ·{" "}
|
||||
<A href="/legal/terms-of-service">{i18n.t("black.finePrint.terms")}</A>
|
||||
<A href={language.route("/legal/terms-of-service")}>{i18n.t("black.finePrint.terms")}</A>
|
||||
</p>
|
||||
</section>
|
||||
</>
|
||||
|
||||
@@ -15,6 +15,7 @@ import { Modal } from "~/component/modal"
|
||||
import { BillingTable } from "@opencode-ai/console-core/schema/billing.sql.js"
|
||||
import { Billing } from "@opencode-ai/console-core/billing.js"
|
||||
import { useI18n } from "~/context/i18n"
|
||||
import { useLanguage } from "~/context/language"
|
||||
import { formError } from "~/lib/form-error"
|
||||
|
||||
const plansMap = Object.fromEntries(plans.map((p) => [p.id, p])) as Record<PlanID, (typeof plans)[number]>
|
||||
@@ -267,6 +268,7 @@ function IntentForm(props: { plan: PlanID; workspaceID: string; onSuccess: (data
|
||||
export default function BlackSubscribe() {
|
||||
const params = useParams()
|
||||
const i18n = useI18n()
|
||||
const language = useLanguage()
|
||||
const planData = plansMap[(params.plan as PlanID) ?? "20"] ?? plansMap["20"]
|
||||
const plan = planData.id
|
||||
|
||||
@@ -467,7 +469,7 @@ export default function BlackSubscribe() {
|
||||
</Modal>
|
||||
<p data-slot="fine-print">
|
||||
{i18n.t("black.finePrint.beforeTerms")} ·{" "}
|
||||
<A href="/legal/terms-of-service">{i18n.t("black.finePrint.terms")}</A>
|
||||
<A href={language.route("/legal/terms-of-service")}>{i18n.t("black.finePrint.terms")}</A>
|
||||
</p>
|
||||
</section>
|
||||
</>
|
||||
|
||||
@@ -220,13 +220,13 @@ export default function BlackWorkspace() {
|
||||
<a href={config.github.repoUrl} target="_blank">
|
||||
{i18n.t("nav.github")} <span data-slot="github-stars">[{starCount()}]</span>
|
||||
</a>
|
||||
<a href="/docs">{i18n.t("nav.docs")}</a>
|
||||
<a href={language.route("/docs")}>{i18n.t("nav.docs")}</a>
|
||||
<LanguagePicker align="right" />
|
||||
<span>
|
||||
<A href="/legal/privacy-policy">{i18n.t("legal.privacy")}</A>
|
||||
<A href={language.route("/legal/privacy-policy")}>{i18n.t("legal.privacy")}</A>
|
||||
</span>
|
||||
<span>
|
||||
<A href="/legal/terms-of-service">{i18n.t("legal.terms")}</A>
|
||||
<A href={language.route("/legal/terms-of-service")}>{i18n.t("legal.terms")}</A>
|
||||
</span>
|
||||
</div>
|
||||
<span data-slot="anomaly-alt">
|
||||
|
||||
Reference in New Issue
Block a user