feat(i18n): extract strings from navigation, dialogs, onboarding, settings, and login
- Add useTranslation() to TopNav, BottomTabBar, FabMenu, UserMenu - Internationalize ConfirmDialog, AuthPromptModal, ExternalLinkDialog - Extract all onboarding flow strings (Welcome, HobbyPicker, ItemBrowser, Review, Done) - Internationalize settings page (weight unit, currency, API keys, import/export) - Internationalize login page and root error boundary - All dialogs in __root.tsx use t() for UI chrome Phase 34, Plan 02 (core navigation and global UI)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { createFileRoute, useNavigate } from "@tanstack/react-router";
|
||||
import { useEffect } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useAuth } from "../hooks/useAuth";
|
||||
|
||||
export const Route = createFileRoute("/login")({
|
||||
@@ -7,6 +8,7 @@ export const Route = createFileRoute("/login")({
|
||||
});
|
||||
|
||||
function LoginPage() {
|
||||
const { t } = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
const { data: auth, isLoading } = useAuth();
|
||||
|
||||
@@ -19,7 +21,7 @@ function LoginPage() {
|
||||
if (isLoading) {
|
||||
return (
|
||||
<div className="min-h-screen bg-gray-50 flex items-center justify-center">
|
||||
<p className="text-gray-500 text-sm">Loading...</p>
|
||||
<p className="text-gray-500 text-sm">{t("actions.loading")}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -28,11 +30,11 @@ function LoginPage() {
|
||||
<div className="min-h-screen bg-gray-50 flex items-center justify-center px-4">
|
||||
<div className="w-full max-w-sm">
|
||||
<h1 className="text-xl font-semibold text-gray-900 text-center mb-6">
|
||||
Sign in to GearBox
|
||||
{t("auth.signInToGearBox")}
|
||||
</h1>
|
||||
<div className="bg-white rounded-xl border border-gray-100 p-6 space-y-4">
|
||||
<p className="text-sm text-gray-500 text-center">
|
||||
You will be redirected to sign in with your account.
|
||||
{t("auth.redirectDescription")}
|
||||
</p>
|
||||
<button
|
||||
type="button"
|
||||
@@ -41,7 +43,7 @@ function LoginPage() {
|
||||
}}
|
||||
className="w-full py-2 px-4 text-sm font-medium text-white bg-gray-700 hover:bg-gray-800 rounded-lg transition-colors"
|
||||
>
|
||||
Sign In
|
||||
{t("auth.signIn")}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user