diff --git a/studio/frontend/package.json b/studio/frontend/package.json index 83b1fd96f9..b43e174889 100644 --- a/studio/frontend/package.json +++ b/studio/frontend/package.json @@ -12,6 +12,7 @@ "lint": "eslint .", "preview": "vite preview", "typecheck": "tsc -b --pretty false", + "i18n:check": "node --experimental-strip-types --no-warnings src/i18n/check-parity.ts", "biome:check": "biome check", "biome:fix": "biome check --write" }, diff --git a/studio/frontend/src/app/router.tsx b/studio/frontend/src/app/router.tsx index c7bc0440bd..f0a417638d 100644 --- a/studio/frontend/src/app/router.tsx +++ b/studio/frontend/src/app/router.tsx @@ -3,6 +3,7 @@ import { Link, createRouter, useRouterState } from "@tanstack/react-router"; import { Button } from "@/components/ui/button"; +import { useT } from "@/i18n"; import { Route as rootRoute } from "./routes/__root"; import { Route as dataRecipesRoute } from "./routes/data-recipes"; import { Route as dataRecipeRoute } from "./routes/data-recipes.$recipeId"; @@ -31,7 +32,9 @@ const routeTree = rootRoute.addChildren([ ]); function DefaultNotFound() { + const t = useT(); const pathname = useRouterState({ select: (s) => s.location.pathname }); + return (
- {pathname} does not exist. + {t("shell.notFound.description", { path: pathname })}
- BETA
+ {t("shell.beta")}
{!isMobile && (
@@ -387,7 +406,7 @@ export function AppSidebar() {
type="button"
onClick={togglePinned}
className="inline-flex h-[35px] w-[32px] items-center justify-center rounded-[10px] text-nav-icon-idle dark:text-nav-fg-muted transition-colors hover:bg-nav-surface-hover hover:text-black dark:hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
- aria-label="Close sidebar"
+ aria-label={t("shell.aria.closeSidebar")}
>
{rawKey}
@@ -55,7 +61,7 @@ export function KeyRevealCard({
- Copy now — this won't be shown again. + {t("settings.apiKeys.copyNow")}
- Update Unsloth Studio + {t("settings.about.update.title")}
) : null}- Checking how Studio was installed… + {t("settings.about.update.checkingInstall")}
) : localInstallSource ? ( <>- Source or local install detected. To avoid replacing it with PyPI, - update from the checkout or source you originally installed from. + {t("settings.about.update.localInstallDetected")}
{checkoutInstallSource ? ( <>- Pull latest changes from your Unsloth repo checkout, then update - Studio locally: + {t("settings.about.update.pullThenUpdate")}
- If the Studio update command is unavailable, run the local - installer from that checkout: + {t("settings.about.update.localInstallerFallback")}
- This looks like a source or VCS package install. Reinstall from - the original local path or Git URL you used. + {t("settings.about.update.sourceInstallDetected")}
- If you still have the Unsloth repo checkout, run the local - installer from that checkout: + {t("settings.about.update.repoCheckoutFallback")}
- Restart Studio after updating for changes to take effect. + {t("settings.about.update.restartAfterUpdate")}
> ) : unknownInstallSource ? ( <>- Studio could not detect how it was installed. Check how you - installed Studio first, then choose the matching update path. + {t("settings.about.update.unknownInstall")}
- For curl or PyPI installs, run: + {t("settings.about.update.curlOrPypi")}
- For local checkout installs, update from that checkout instead and - use the local update command: + {t("settings.about.update.localCheckout")}
- Restart Studio after updating for changes to take effect. + {t("settings.about.update.restartAfterUpdate")}
> ) : ( @@ -309,15 +317,15 @@ export function UpdateStudioInstructions({ transition={fadeTransition} className="text-xs text-muted-foreground leading-relaxed" > - {getStudioUpdateInstructionLine(shell)} + {getStudioUpdateInstructionLine(shell, t)}- If that fails or unsloth studio update is unavailable, run: + {t("settings.about.update.fallbackInstruction")}
- Restart Studio after updating for changes to take effect. + {t("settings.about.update.restartAfterUpdate")}
> )} diff --git a/studio/frontend/src/features/settings/components/usage-examples.tsx b/studio/frontend/src/features/settings/components/usage-examples.tsx index 0e68237857..96437b4840 100644 --- a/studio/frontend/src/features/settings/components/usage-examples.tsx +++ b/studio/frontend/src/features/settings/components/usage-examples.tsx @@ -3,6 +3,7 @@ import { cn } from "@/lib/utils"; import { copyToClipboard } from "@/lib/copy-to-clipboard"; +import { useT } from "@/i18n"; import { ArrowUpRight01Icon, Copy01Icon, @@ -78,6 +79,7 @@ for chunk in response: } export function UsageExamples() { + const t = useT(); const [lang, setLang] = useState
{snippets[lang]}