feat(webui): integrate i18n into fields-manager and manage-fields-dialog components

This commit is contained in:
yiling
2026-06-27 14:41:47 +08:00
parent e8058a2292
commit 7182c00c7d
17 changed files with 320 additions and 66 deletions
+23 -20
View File
@@ -11,6 +11,7 @@ import { DragDropProvider, KeyboardSensor, PointerSensor, type DragEndEvent } fr
import { useSortable } from '@dnd-kit/react/sortable'
import { useMutation, useQueryClient } from '@tanstack/react-query'
import { InferRequestType, InferResponseType } from 'hono/client'
import { m } from '@/ui/paraglide/messages.js'
import { Button } from '@/ui/components/ui/button'
import {
@@ -165,7 +166,7 @@ export function FieldsManager({ projectId, onManageFields, onSave }: FieldsManag
>({
mutationFn: async (request) => {
const res = await $patchOrder(request)
if (!res.ok) throw new Error('Failed to update fields order')
if (!res.ok) throw new Error(m.failed_update_fields_order())
return null as unknown as InferResponseType<typeof $patchOrder>
},
})
@@ -177,7 +178,7 @@ export function FieldsManager({ projectId, onManageFields, onSave }: FieldsManag
>({
mutationFn: async (request) => {
const res = await $post(request)
if (!res.ok) throw new Error('Failed to create field')
if (!res.ok) throw new Error(m.failed_create_field())
return (await res.json()) as MetadataFieldInfo
},
onSuccess: (data) => {
@@ -268,10 +269,10 @@ export function FieldsManager({ projectId, onManageFields, onSave }: FieldsManag
<div className="w-80 p-4">
<div className="space-y-4">
<div className="space-y-2">
<Label htmlFor="field-name">Name</Label>
<Label htmlFor="field-name">{m.field_name()}</Label>
<Input
id="field-name"
placeholder="New Field"
placeholder={m.new_field_placeholder()}
value={newFieldName}
onChange={(e) => setNewFieldName(e.target.value)}
autoFocus
@@ -279,14 +280,16 @@ export function FieldsManager({ projectId, onManageFields, onSave }: FieldsManag
</div>
<div className="space-y-2">
<Label>Type</Label>
<Label>{m.field_type()}</Label>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="outline" className="w-full justify-between font-normal">
{newFieldType ? (
<span className="capitalize">{newFieldType.replace(/_/g, ' ')}</span>
) : (
<span className="text-muted-foreground border-dashed">Select field type</span>
<span className="text-muted-foreground border-dashed">
{m.select_field_type()}
</span>
)}
<ChevronDown className="ml-2 h-4 w-4 opacity-50" />
</Button>
@@ -309,10 +312,10 @@ export function FieldsManager({ projectId, onManageFields, onSave }: FieldsManag
</div>
<div className="space-y-2">
<Label htmlFor="field-desc">Description</Label>
<Label htmlFor="field-desc">{m.description()}</Label>
<Input
id="field-desc"
placeholder="Description (Optional)"
placeholder={m.description_optional_placeholder()}
value={newDescription}
onChange={(e) => setNewDescription(e.target.value)}
/>
@@ -320,13 +323,13 @@ export function FieldsManager({ projectId, onManageFields, onSave }: FieldsManag
<div className="flex items-center space-x-2">
<Switch id="ai-autofill" checked={newAiAutofill} onCheckedChange={setNewAiAutofill} />
<Label htmlFor="ai-autofill">AI Autofill</Label>
<Label htmlFor="ai-autofill">{m.ai_autofill()}</Label>
</div>
{(newFieldType === FieldType.select || newFieldType === FieldType.selectMulti) && (
<div className="space-y-2">
<div className="flex items-center justify-between">
<Label className="text-sm font-medium">Options</Label>
<Label className="text-sm font-medium">{m.options()}</Label>
<Button
variant="ghost"
size="sm"
@@ -334,13 +337,13 @@ export function FieldsManager({ projectId, onManageFields, onSave }: FieldsManag
onClick={() => {
const newOption: SelectOption = {
id: ulid(),
displayName: 'New Option',
displayName: m.new_option(),
color: '#808080',
}
setNewOptions([...newOptions, newOption])
}}
>
<Plus className="h-4 w-4 mr-1" /> Add Option
<Plus className="h-4 w-4 mr-1" /> {m.add_option()}
</Button>
</div>
<div className="space-y-2 max-h-40 overflow-y-auto pr-1">
@@ -353,7 +356,7 @@ export function FieldsManager({ projectId, onManageFields, onSave }: FieldsManag
updated[idx] = { ...opt, displayName: e.target.value }
setNewOptions(updated)
}}
placeholder="Option name"
placeholder={m.option_name_placeholder()}
className="h-8 flex-1"
/>
<Popover>
@@ -414,14 +417,14 @@ export function FieldsManager({ projectId, onManageFields, onSave }: FieldsManag
setNewOptions([])
}}
>
Cancel
{m.cancel()}
</Button>
<Button
className="flex-1"
onClick={handleCreateField}
disabled={!newFieldName || !newFieldType}
>
Save
{m.save()}
</Button>
</div>
</div>
@@ -433,16 +436,16 @@ export function FieldsManager({ projectId, onManageFields, onSave }: FieldsManag
<div className="w-80 p-4">
<div className="flex items-center justify-between mb-4">
<h3 className="font-semibold">
Fields{' '}
{m.fields()}{' '}
<span className="text-muted-foreground text-sm font-normal">
({visibleCount} visible)
{m.visible_count({ count: visibleCount })}
</span>
</h3>
</div>
<div className="relative mb-4">
<Search className="absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" />
<Input
placeholder="Search fields"
placeholder={m.search_fields_placeholder()}
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
className="pl-8"
@@ -474,11 +477,11 @@ export function FieldsManager({ projectId, onManageFields, onSave }: FieldsManag
<div className="mt-4 space-y-2">
<Button variant="secondary" className="w-full" onClick={onManageFields}>
<Settings className="h-4 w-4 mr-2" />
Manage Fields
{m.manage_fields()}
</Button>
<Button className="w-full" onClick={() => setView('create')}>
<Plus className="h-4 w-4 mr-2" />
New Field
{m.new_field()}
</Button>
</div>
)}
@@ -1,9 +1,8 @@
import type { AssetInfo } from '@shumai/dtos'
import type { CollectionInfo } from '@shumai/dtos'
import { type FieldInfo as MetadataFieldInfo } from '@shumai/dtos'
import type { SearchCondition, SearchSort } from '@shumai/dtos'
import { client } from '@/ui/api/client'
import { usePermissions } from '@/ui/hooks/use-permissions'
import { m } from '@/ui/paraglide/messages.js'
import type { AssetInfo, CollectionInfo, SearchCondition, SearchSort } from '@shumai/dtos'
import { type FieldInfo as MetadataFieldInfo } from '@shumai/dtos'
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
import type { InferRequestType, InferResponseType } from 'hono/client'
import { useState } from 'react'
@@ -228,7 +227,7 @@ export function FileBrowserToolbar({
<PopoverTrigger asChild>
<div>
<Button variant="ghost" size="sm">
Fields
{m.field()}
</Button>
</div>
</PopoverTrigger>
@@ -341,7 +340,7 @@ export function FileBrowserToolbar({
size="sm"
className="inline-flex items-center gap-2 px-4 py-2 hover:bg-primary/10 font-semibold rounded-xl cursor-pointer h-8"
>
<span>Search</span>
<span>{m.search()}</span>
{activeFiltersCount > 0 && (
<span className="ml-1 px-1.5 py-0.5 rounded-full text-[10px] font-mono font-bold bg-primary/50 border border-primary-foreground/20">
{activeFiltersCount}
@@ -26,6 +26,7 @@ import {
import { useMemo, useState, useEffect } from 'react'
import { toast } from 'sonner'
import { Popover, PopoverTrigger, PopoverContent } from '@/ui/components/ui/popover'
import { m } from '@/ui/paraglide/messages.js'
import { FIELD_TYPE_ICONS, PREDEFINED_COLORS, COLOR_MAP } from './fields-manager'
import { Button } from '@/ui/components/ui/button'
@@ -59,12 +60,6 @@ const SCOPE_GROUPS = {
PROJECT: 'project',
}
const GROUP_LABELS: Record<string, string> = {
[SCOPE_GROUPS.SYSTEM]: 'Essentials',
[SCOPE_GROUPS.TEAM]: 'Team Attributes', // Assuming this, user screenshot said "File Attributes" but maybe that's system?
[SCOPE_GROUPS.PROJECT]: 'Custom Fields',
}
// Icons for groups
const GROUP_ICONS: Record<string, React.ElementType> = {
[SCOPE_GROUPS.SYSTEM]: FileText, // Placeholder
@@ -151,7 +146,7 @@ export function ManageFieldsDialog({ projectId, open, onOpenChange }: ManageFiel
>({
mutationFn: async (request) => {
const res = await $patchOrder(request)
if (!res.ok) throw new Error('Failed to update fields order')
if (!res.ok) throw new Error(m.failed_update_fields_order())
return null as unknown as InferResponseType<typeof $patchOrder>
},
})
@@ -163,7 +158,7 @@ export function ManageFieldsDialog({ projectId, open, onOpenChange }: ManageFiel
>({
mutationFn: async (request) => {
const res = await $post(request)
if (!res.ok) throw new Error('Failed to create field')
if (!res.ok) throw new Error(m.failed_create_field())
return (await res.json()) as MetadataFieldInfo
},
onSuccess: (data) => {
@@ -172,7 +167,7 @@ export function ManageFieldsDialog({ projectId, open, onOpenChange }: ManageFiel
setIsCreating(false)
setSelectedFieldId(data.id!)
resetEditor(data)
toast.success('Field created successfully')
toast.success(m.field_created_successfully())
},
})
const $put = client.api.fields[':fieldId'].$put
@@ -183,7 +178,7 @@ export function ManageFieldsDialog({ projectId, open, onOpenChange }: ManageFiel
>({
mutationFn: async (request) => {
const res = await $put(request)
if (!res.ok) throw new Error('Failed to update field')
if (!res.ok) throw new Error(m.failed_update_field())
return (await res.json()) as MetadataFieldInfo
},
onSuccess: (data) => {
@@ -191,7 +186,7 @@ export function ManageFieldsDialog({ projectId, open, onOpenChange }: ManageFiel
f.id === data.id ? { ...f, ...(data as MetadataFieldInfo) } : f,
)
updateFields(newFields)
toast.success('Field updated successfully')
toast.success(m.field_updated_successfully())
},
})
const $delete = client.api.fields[':fieldId'].$delete
@@ -202,14 +197,14 @@ export function ManageFieldsDialog({ projectId, open, onOpenChange }: ManageFiel
>({
mutationFn: async (request) => {
const res = await $delete(request)
if (!res.ok) throw new Error('Failed to delete field')
if (!res.ok) throw new Error(m.failed_delete_field())
return null as unknown as InferResponseType<typeof $delete>
},
onSuccess: (_, variables) => {
const newFields = fields.filter((f) => f.id !== variables.param.fieldId)
updateFields(newFields)
setSelectedFieldId(null)
toast.success('Field deleted successfully')
toast.success(m.field_deleted_successfully())
},
})
@@ -225,7 +220,14 @@ export function ManageFieldsDialog({ projectId, open, onOpenChange }: ManageFiel
return presentScopes.map((scope) => ({
id: scope,
label: GROUP_LABELS[scope] || scope.charAt(0).toUpperCase() + scope.slice(1),
label:
scope === SCOPE_GROUPS.SYSTEM
? m.essentials()
: scope === SCOPE_GROUPS.TEAM
? m.team_attributes()
: scope === SCOPE_GROUPS.PROJECT
? m.custom_fields()
: scope.charAt(0).toUpperCase() + scope.slice(1),
icon: GROUP_ICONS[scope] || FileText,
}))
}, [fields])
@@ -325,7 +327,7 @@ export function ManageFieldsDialog({ projectId, open, onOpenChange }: ManageFiel
const handleDelete = () => {
if (!selectedField) return
if (confirm('Are you sure you want to delete this field?')) {
if (confirm(m.confirm_delete_field())) {
deleteField({ param: { fieldId: selectedField.id! } })
}
}
@@ -337,22 +339,22 @@ export function ManageFieldsDialog({ projectId, open, onOpenChange }: ManageFiel
return (
<div className="space-y-4">
<div className="space-y-2">
<Label>Field Name</Label>
<Label>{m.field_name()}</Label>
<Input
value={newName}
onChange={(e) => setNewName(e.target.value)}
placeholder="e.g. Status"
placeholder={m.field_name_placeholder()}
/>
</div>
<div className="space-y-2">
<Label>Field Type</Label>
<Label>{m.field_type()}</Label>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="outline" className="w-full justify-between">
{newType ? (
<span className="capitalize">{newType.replace(/_/g, ' ')}</span>
) : (
<span className="text-muted-foreground">Select type</span>
<span className="text-muted-foreground">{m.select_type()}</span>
)}
<ChevronDown className="h-4 w-4 opacity-50" />
</Button>
@@ -371,23 +373,23 @@ export function ManageFieldsDialog({ projectId, open, onOpenChange }: ManageFiel
</DropdownMenu>
</div>
<div className="space-y-2">
<Label>Description</Label>
<Label>{m.description()}</Label>
<Input
value={newDescription}
onChange={(e) => setNewDescription(e.target.value)}
placeholder="Description (Optional)"
placeholder={m.description_optional_placeholder()}
/>
</div>
<div className="flex items-center space-x-2">
<Switch checked={newAiAutofill} onCheckedChange={setNewAiAutofill} />
<Label>AI Autofill</Label>
<Label>{m.ai_autofill()}</Label>
</div>
</div>
)
}
if (!selectedField) {
return <div className="text-muted-foreground text-sm">Select a field to edit options</div>
return <div className="text-muted-foreground text-sm">{m.select_field_to_edit()}</div>
}
const isReadOnly = selectedField.readOnly
@@ -411,15 +413,16 @@ export function ManageFieldsDialog({ projectId, open, onOpenChange }: ManageFiel
{/* Generic placeholder for options */}
<div className="text-sm text-muted-foreground">
Type: <span className="capitalize">{selectedField.config?.type?.replace(/_/g, ' ')}</span>
{m.type_label()}{' '}
<span className="capitalize">{selectedField.config?.type?.replace(/_/g, ' ')}</span>
</div>
<div className="space-y-2">
<Label>Description</Label>
<Label>{m.description()}</Label>
<Input
value={editDescription}
onChange={(e) => setEditDescription(e.target.value)}
placeholder="Description (Optional)"
placeholder={m.description_optional_placeholder()}
disabled={isReadOnly}
/>
</div>
@@ -430,7 +433,7 @@ export function ManageFieldsDialog({ projectId, open, onOpenChange }: ManageFiel
onCheckedChange={setEditAiAutofill}
disabled={isReadOnly}
/>
<Label>AI Autofill</Label>
<Label>{m.ai_autofill()}</Label>
</div>
{/* TODO: Add specific option editors here */}
@@ -439,7 +442,7 @@ export function ManageFieldsDialog({ projectId, open, onOpenChange }: ManageFiel
selectedField.config?.type === 'selectMulti') && (
<div className="space-y-2">
<div className="flex items-center justify-between">
<label className="text-sm font-medium">Options</label>
<label className="text-sm font-medium">{m.options()}</label>
<Button
variant="ghost"
size="sm"
@@ -447,7 +450,7 @@ export function ManageFieldsDialog({ projectId, open, onOpenChange }: ManageFiel
// Logic to add option
const newOption = {
id: ulid(),
displayName: 'New Option',
displayName: m.new_option(),
color: '#808080',
}
const currentOptions =
@@ -464,7 +467,7 @@ export function ManageFieldsDialog({ projectId, open, onOpenChange }: ManageFiel
})
}}
>
<Plus className="h-4 w-4 mr-2" /> Add option
<Plus className="h-4 w-4 mr-2" /> {m.add_option()}
</Button>
</div>
<div className="space-y-2">
@@ -566,7 +569,7 @@ export function ManageFieldsDialog({ projectId, open, onOpenChange }: ManageFiel
onClick={handleDelete}
className="text-destructive hover:bg-destructive/10"
>
Delete field
{m.delete_field()}
</Button>
</div>
)}
@@ -580,12 +583,12 @@ export function ManageFieldsDialog({ projectId, open, onOpenChange }: ManageFiel
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="!max-w-[50rem] h-[70vh] flex flex-col p-0 gap-0">
<div className="p-4 border-b flex items-center justify-between">
<DialogTitle>Manage Fields</DialogTitle>
<DialogTitle>{m.manage_fields()}</DialogTitle>
</div>
<div className="flex overflow-hidden h-full">
{/* Left Column: Groups */}
<div className="w-60 border-r bg-muted/30 p-4 space-y-1">
<div className="font-semibold mb-4 px-2">Groups</div>
<div className="font-semibold mb-4 px-2">{m.groups()}</div>
{groups.map((group) => (
<button
key={group.id}
@@ -613,7 +616,7 @@ export function ManageFieldsDialog({ projectId, open, onOpenChange }: ManageFiel
</span>
{selectedGroup === SCOPE_GROUPS.PROJECT && (
<Button size="sm" variant="outline" className="h-8" onClick={handleCreateClick}>
New <Plus className="ml-1 h-3 w-3" />
{m.new_label()} <Plus className="ml-1 h-3 w-3" />
</Button>
)}
</div>
@@ -642,7 +645,7 @@ export function ManageFieldsDialog({ projectId, open, onOpenChange }: ManageFiel
</DragDropProvider>
{filteredFields.length === 0 && (
<div className="text-center text-muted-foreground text-sm py-8">
No fields found
{m.no_fields_found()}
</div>
)}
</div>
@@ -660,9 +663,11 @@ export function ManageFieldsDialog({ projectId, open, onOpenChange }: ManageFiel
if (selectedFieldId && selectedField) resetEditor(selectedField)
}}
>
Cancel
{m.cancel()}
</Button>
<Button onClick={isCreating ? handleSaveCreation : handleSaveEdit}>
{m.save()}
</Button>
<Button onClick={isCreating ? handleSaveCreation : handleSaveEdit}>Save</Button>
</div>
)}
</div>
+7 -1
View File
@@ -776,5 +776,11 @@
"failed_delete_collection": "Failed to delete collection",
"failed_rename_share_link": "Failed to rename share link",
"failed_delete_share_link": "Failed to delete share link",
"failed_to_fetch_folder_children": "Failed to fetch folder children"
"failed_to_fetch_folder_children": "Failed to fetch folder children",
"failed_update_fields_order": "Failed to update fields order",
"failed_create_field": "Failed to create field",
"failed_update_field": "Failed to update field",
"failed_delete_field": "Failed to delete field",
"new_label": "New"
}
+7 -1
View File
@@ -776,5 +776,11 @@
"failed_delete_collection": "删除收藏集失败",
"failed_rename_share_link": "重命名分享链接失败",
"failed_delete_share_link": "删除分享链接失败",
"failed_to_fetch_folder_children": "获取子文件夹失败"
"failed_to_fetch_folder_children": "获取子文件夹失败",
"failed_update_fields_order": "更新字段排序失败",
"failed_create_field": "创建字段失败",
"failed_update_field": "更新字段失败",
"failed_delete_field": "删除字段失败",
"new_label": "新建"
}
+5
View File
@@ -727,4 +727,9 @@ export * from "./failed_delete_collection.js";
export * from "./failed_rename_share_link.js";
export * from "./failed_delete_share_link.js";
export * from "./failed_to_fetch_folder_children.js";
export * from "./failed_update_fields_order.js";
export * from "./failed_create_field.js";
export * from "./failed_update_field.js";
export * from "./failed_delete_field.js";
export * from "./new_label.js";
export type LocalizedString = import("../runtime.js").LocalizedString;
+6 -1
View File
@@ -728,4 +728,9 @@ export * from './failed_rename_collection.js'
export * from './failed_delete_collection.js'
export * from './failed_rename_share_link.js'
export * from './failed_delete_share_link.js'
export * from './failed_to_fetch_folder_children.js'
export * from './failed_to_fetch_folder_children.js'
export * from './failed_update_fields_order.js'
export * from './failed_create_field.js'
export * from './failed_update_field.js'
export * from './failed_delete_field.js'
export * from './new_label.js'
@@ -0,0 +1,16 @@
/**
* | output |
* | --- |
* | "Failed to create field" |
*
* @param {Failed_Create_FieldInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const failed_create_field: ((inputs?: Failed_Create_FieldInputs, options?: {
locale?: "en" | "zh";
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Failed_Create_FieldInputs, {
locale?: "en" | "zh";
}, {}>;
export type LocalizedString = import("../runtime.js").LocalizedString;
export type Failed_Create_FieldInputs = {};
@@ -0,0 +1,29 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js';
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} Failed_Create_FieldInputs */
const en_failed_create_field = /** @type {(inputs: Failed_Create_FieldInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`Failed to create field`)
};
const zh_failed_create_field = /** @type {(inputs: Failed_Create_FieldInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`创建字段失败`)
};
/**
* | output |
* | --- |
* | "Failed to create field" |
*
* @param {Failed_Create_FieldInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const failed_create_field = /** @type {((inputs?: Failed_Create_FieldInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Failed_Create_FieldInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === "en") return en_failed_create_field(inputs)
return zh_failed_create_field(inputs)
});
@@ -0,0 +1,16 @@
/**
* | output |
* | --- |
* | "Failed to delete field" |
*
* @param {Failed_Delete_FieldInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const failed_delete_field: ((inputs?: Failed_Delete_FieldInputs, options?: {
locale?: "en" | "zh";
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Failed_Delete_FieldInputs, {
locale?: "en" | "zh";
}, {}>;
export type LocalizedString = import("../runtime.js").LocalizedString;
export type Failed_Delete_FieldInputs = {};
@@ -0,0 +1,29 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js';
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} Failed_Delete_FieldInputs */
const en_failed_delete_field = /** @type {(inputs: Failed_Delete_FieldInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`Failed to delete field`)
};
const zh_failed_delete_field = /** @type {(inputs: Failed_Delete_FieldInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`删除字段失败`)
};
/**
* | output |
* | --- |
* | "Failed to delete field" |
*
* @param {Failed_Delete_FieldInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const failed_delete_field = /** @type {((inputs?: Failed_Delete_FieldInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Failed_Delete_FieldInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === "en") return en_failed_delete_field(inputs)
return zh_failed_delete_field(inputs)
});
@@ -0,0 +1,16 @@
/**
* | output |
* | --- |
* | "Failed to update field" |
*
* @param {Failed_Update_FieldInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const failed_update_field: ((inputs?: Failed_Update_FieldInputs, options?: {
locale?: "en" | "zh";
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Failed_Update_FieldInputs, {
locale?: "en" | "zh";
}, {}>;
export type LocalizedString = import("../runtime.js").LocalizedString;
export type Failed_Update_FieldInputs = {};
@@ -0,0 +1,29 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js';
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} Failed_Update_FieldInputs */
const en_failed_update_field = /** @type {(inputs: Failed_Update_FieldInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`Failed to update field`)
};
const zh_failed_update_field = /** @type {(inputs: Failed_Update_FieldInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`更新字段失败`)
};
/**
* | output |
* | --- |
* | "Failed to update field" |
*
* @param {Failed_Update_FieldInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const failed_update_field = /** @type {((inputs?: Failed_Update_FieldInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Failed_Update_FieldInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === "en") return en_failed_update_field(inputs)
return zh_failed_update_field(inputs)
});
@@ -0,0 +1,16 @@
/**
* | output |
* | --- |
* | "Failed to update fields order" |
*
* @param {Failed_Update_Fields_OrderInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const failed_update_fields_order: ((inputs?: Failed_Update_Fields_OrderInputs, options?: {
locale?: "en" | "zh";
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Failed_Update_Fields_OrderInputs, {
locale?: "en" | "zh";
}, {}>;
export type LocalizedString = import("../runtime.js").LocalizedString;
export type Failed_Update_Fields_OrderInputs = {};
@@ -0,0 +1,29 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js';
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} Failed_Update_Fields_OrderInputs */
const en_failed_update_fields_order = /** @type {(inputs: Failed_Update_Fields_OrderInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`Failed to update fields order`)
};
const zh_failed_update_fields_order = /** @type {(inputs: Failed_Update_Fields_OrderInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`更新字段排序失败`)
};
/**
* | output |
* | --- |
* | "Failed to update fields order" |
*
* @param {Failed_Update_Fields_OrderInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const failed_update_fields_order = /** @type {((inputs?: Failed_Update_Fields_OrderInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Failed_Update_Fields_OrderInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === "en") return en_failed_update_fields_order(inputs)
return zh_failed_update_fields_order(inputs)
});
+16
View File
@@ -0,0 +1,16 @@
/**
* | output |
* | --- |
* | "New" |
*
* @param {New_LabelInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const new_label: ((inputs?: New_LabelInputs, options?: {
locale?: "en" | "zh";
}) => LocalizedString) & import("../runtime.js").MessageMetadata<New_LabelInputs, {
locale?: "en" | "zh";
}, {}>;
export type LocalizedString = import("../runtime.js").LocalizedString;
export type New_LabelInputs = {};
@@ -0,0 +1,29 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js';
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} New_LabelInputs */
const en_new_label = /** @type {(inputs: New_LabelInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`New`)
};
const zh_new_label = /** @type {(inputs: New_LabelInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`新建`)
};
/**
* | output |
* | --- |
* | "New" |
*
* @param {New_LabelInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const new_label = /** @type {((inputs?: New_LabelInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<New_LabelInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === "en") return en_new_label(inputs)
return zh_new_label(inputs)
});