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
@@ -1,6 +1,7 @@
'use client'
import { client } from '@/ui/api/client'
import type { InferRequestType, InferResponseType } from 'hono/client'
import { m } from '@/ui/src/paraglide/messages.js'
import { usePermissions } from '@/ui/hooks/use-permissions'
import { getAllFilesFromEntries } from '@/ui/lib/dnd-utils'
@@ -972,7 +973,7 @@ export function FileBrowser({
<div className="flex items-center justify-between px-4 py-2.5 bg-muted/20 border-b border-border text-sm shrink-0 animate-in fade-in slide-in-from-top-2 duration-300">
<div className="flex items-center gap-2 text-muted-foreground">
<AlertTriangle className="h-4 w-4 text-amber-500 shrink-0" />
<span>Items are automatically deleted after 30 days.</span>
<span>{m.recently_deleted_notice()}</span>
</div>
{canAdmin && (
<Button
@@ -6,6 +6,7 @@ import { client } from '@/ui/api/client'
import { usePermissions } from '@/ui/hooks/use-permissions'
import { useMutation } from '@tanstack/react-query'
import { InferRequestType, InferResponseType } from 'hono/client'
import { m } from '@/ui/src/paraglide/messages.js'
import { useFieldStore } from '@/ui/stores/fields'
import { useMemberStore } from '@/ui/stores/members'
@@ -519,7 +520,7 @@ export default function FileSystemManager({
/>
) : (
<div className="flex h-full items-center justify-center p-4 text-center text-sm text-muted-foreground">
Select an asset to view details
{m.select_asset_to_view_details()}
</div>
)}
</div>
@@ -2,6 +2,7 @@
import { client } from '@/ui/api/client'
import { useTopNavStore } from '@/ui/stores/top-nav'
import { m } from '@/ui/src/paraglide/messages.js'
import { useInfiniteQuery, useQuery } from '@tanstack/react-query'
import { useEffect, useState, useMemo, useRef } from 'react'
import { TopNav } from './top-nav'
@@ -386,7 +387,7 @@ export function PublicShareManager({
<div className="mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-primary/10">
<Lock className="h-6 w-6 text-primary" />
</div>
<CardTitle>Password Protected</CardTitle>
<CardTitle>{m.password_protected()}</CardTitle>
</CardHeader>
<CardContent>
<form onSubmit={handlePasswordSubmit} className="space-y-4">
@@ -1,5 +1,6 @@
import { ShareLinkInfo, UpdateShareLinkRequest } from '@shumai/dtos'
import { type FieldInfo as MetadataFieldInfo } from '@shumai/dtos'
import { m } from '@/ui/src/paraglide/messages.js'
import { client } from '@/ui/api/client'
import { Button } from '@/ui/components/ui/button'
import { Input } from '@/ui/components/ui/input'
@@ -113,7 +114,7 @@ export function ShareSettingsSidebar({
<div className="p-4 space-y-6">
<div className="space-y-4">
<div className="flex items-center justify-between">
<h3 className="text-sm font-medium">Link Visibility</h3>
<h3 className="text-sm font-medium">{m.link_visibility()}</h3>
<Switch
checked={!shareLink.isDisabled}
onCheckedChange={(checked) => updateShare({ isDisabled: !checked })}
+2 -1
View File
@@ -8,6 +8,7 @@ import {
} from '@/ui/components/ui/dialog'
import { useQuery } from '@tanstack/react-query'
import { useNavigate } from '@tanstack/react-router'
import { m } from '@/ui/src/paraglide/messages.js'
export function TeamSelector() {
const navigate = useNavigate()
@@ -37,7 +38,7 @@ export function TeamSelector() {
<Dialog open={true}>
<DialogContent>
<DialogHeader>
<DialogTitle>Select a Team</DialogTitle>
<DialogTitle>{m.select_a_team()}</DialogTitle>
<DialogDescription>
You are a member of multiple teams. Please select one to continue.
</DialogDescription>