feat(webui): add i18n text keys and translate one static text element per page for verification

This commit is contained in:
yiling
2026-06-26 11:24:32 +08:00
parent 6e2e5bdbc2
commit 4fd27ab147
14 changed files with 47 additions and 14 deletions
+2 -1
View File
@@ -13,6 +13,7 @@ import { ArrowRight, Loader2, Lock, LogIn, Mail } from 'lucide-react'
import { useEffect, useState } from 'react'
import { useForm } from 'react-hook-form'
import { z } from 'zod'
import { m } from '@/ui/src/paraglide/messages.js'
const loginSchema = z.object({
email: z.string().email('Invalid email address'),
@@ -83,7 +84,7 @@ function LoginPage() {
<AuthLayout>
<div className="mb-8">
<h1 className="text-2xl font-bold tracking-tight text-zinc-900 dark:text-zinc-50">
Welcome Back
{m.welcome_back()}
</h1>
<p className="text-zinc-500 dark:text-zinc-400 text-sm mt-1">
Enter your credentials to access your account.
@@ -1,6 +1,7 @@
import { client } from '@/ui/api/client'
import { FolderTree } from '@/ui/components/folder-tree'
import { ResizeHandle } from '@/ui/components/resize-handle'
import { m } from '@/ui/src/paraglide/messages.js'
import {
Table,
TableBody,
@@ -135,7 +136,7 @@ function CollectionsPage() {
<header className="h-14 border-b flex items-center justify-between px-6 shrink-0 bg-background/50 backdrop-blur-sm sticky top-0 z-10">
<div className="flex items-center gap-2">
<Bookmark className="h-5 w-5 text-primary" />
<h1 className="font-bold text-lg text-foreground">All Collections</h1>
<h1 className="font-bold text-lg text-foreground">{m.all_collections()}</h1>
</div>
</header>
@@ -1,6 +1,7 @@
import { client } from '@/ui/api/client'
import { FileViewer } from '@/ui/components/file-viewer'
import { FileViewerLeftSidebar } from '@/ui/components/file-viewer-left-sidebar'
import { m } from '@/ui/src/paraglide/messages.js'
import { FileViewerRightSidebar } from '@/ui/components/file-viewer-right-sidebar'
import { ResizeHandle } from '@/ui/components/resize-handle'
import { FileDetailSkeleton } from '@/ui/components/loading-skeletons'
@@ -268,7 +269,7 @@ function FileViewPage() {
}
if (isError || !fileData || !projectInfo || !teamId) {
return <div>File not found.</div>
return <div>{m.file_not_found()}</div>
}
const handleSaveField = (fieldId: string, value: unknown) => {
@@ -1,6 +1,7 @@
import { client } from '@/ui/api/client'
import { FolderTree } from '@/ui/components/folder-tree'
import { ResizeHandle } from '@/ui/components/resize-handle'
import { m } from '@/ui/src/paraglide/messages.js'
import { Switch } from '@/ui/components/ui/switch'
import { Button } from '@/ui/components/ui/button'
import {
@@ -165,7 +166,7 @@ function SharesPage() {
<header className="h-14 border-b flex items-center justify-between px-6 shrink-0 bg-background/50 backdrop-blur-sm sticky top-0 z-10">
<div className="flex items-center gap-2">
<Share2 className="h-5 w-5 text-primary" />
<h1 className="font-bold text-lg text-foreground">All Share Links</h1>
<h1 className="font-bold text-lg text-foreground">{m.all_share_links()}</h1>
</div>
</header>
+2 -1
View File
@@ -14,6 +14,7 @@ import { signUp } from '@/ui/lib/auth-client'
import { useState } from 'react'
import { ShumaiLogo } from '@/ui/components/ui/icons'
import { AuthLayout } from '@/ui/components/auth-layout'
import { m } from '@/ui/src/paraglide/messages.js'
const signupSchema = z.object({
email: z.string().email('Invalid email address'),
@@ -139,7 +140,7 @@ function SignupPage() {
<AuthLayout>
<div className="mb-8">
<h1 className="text-2xl font-bold tracking-tight text-zinc-900 dark:text-zinc-50">
Create Account
{m.create_account()}
</h1>
<p className="text-zinc-500 dark:text-zinc-400 text-sm mt-1 mb-4">
Start building and organizing your space.
@@ -4,6 +4,7 @@ import { client } from '@/ui/api/client'
import { MembersDialog } from '@/ui/components/members-dialog'
import { ProjectDialog } from '@/ui/components/project-dialog'
import { SortDropdown } from '@/ui/components/sort-dropdown'
import { m } from '@/ui/src/paraglide/messages.js'
import {
AlertDialog,
AlertDialogAction,
@@ -256,7 +257,7 @@ function TeamPage() {
return (
<div className="flex-1 overflow-y-auto p-4">
<div className="flex flex-wrap items-center justify-between mb-4 gap-4">
<h1 className="text-2xl font-bold">Projects</h1>
<h1 className="text-2xl font-bold">{m.projects()}</h1>
<div className="flex flex-wrap items-center gap-4">
<div
className="flex items-center -space-x-2 cursor-pointer hover:opacity-90"
@@ -242,7 +242,7 @@ function TeamSettingsPage() {
<div className="w-full h-full md:w-72 bg-sidebar border-b md:border-b-0 md:border-r border-sidebar-border z-10 md:left-16 overflow-y-auto transition-colors duration-300">
<nav className="p-4 space-y-1 mt-4">
<div className="mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider">
Settings
{m.settings()}
</div>
<button