feat(webui): integrate i18n into search and sort control components

This commit is contained in:
yiling
2026-06-27 10:30:57 +08:00
parent 4dc53063ea
commit 1b60c8df83
12 changed files with 228 additions and 135 deletions
+2
View File
@@ -128,6 +128,7 @@ export * from "./creator.js";
export * from "./created_date.js";
export * from "./collection_created.js";
export * from "./failed_create_collection.js";
export * from "./failed_save_collection.js";
export * from "./loading_collection.js";
export * from "./untitled_collection.js";
export * from "./collection_saved.js";
@@ -167,6 +168,7 @@ export * from "./list.js";
export * from "./field.js";
export * from "./sort_by.js";
export * from "./sorted_by.js";
export * from "./sorted_by_label.js";
export * from "./order.js";
export * from "./custom.js";
export * from "./date_created.js";
@@ -130,6 +130,7 @@ export * from './creator.js'
export * from './created_date.js'
export * from './collection_created.js'
export * from './failed_create_collection.js'
export * from './failed_save_collection.js'
export * from './loading_collection.js'
export * from './untitled_collection.js'
export * from './collection_saved.js'
@@ -169,6 +170,7 @@ export * from './list.js'
export * from './field.js'
export * from './sort_by.js'
export * from './sorted_by.js'
export * from './sorted_by_label.js'
export * from './order.js'
export * from './custom.js'
export * from './date_created.js'
@@ -0,0 +1,16 @@
/**
* | output |
* | --- |
* | "Failed to save collection" |
*
* @param {Failed_Save_CollectionInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const failed_save_collection: ((inputs?: Failed_Save_CollectionInputs, options?: {
locale?: "en" | "zh";
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Failed_Save_CollectionInputs, {
locale?: "en" | "zh";
}, {}>;
export type LocalizedString = import("../runtime.js").LocalizedString;
export type Failed_Save_CollectionInputs = {};
@@ -0,0 +1,29 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js';
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} Failed_Save_CollectionInputs */
const en_failed_save_collection = /** @type {(inputs: Failed_Save_CollectionInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`Failed to save collection`)
};
const zh_failed_save_collection = /** @type {(inputs: Failed_Save_CollectionInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`保存收藏集失败`)
};
/**
* | output |
* | --- |
* | "Failed to save collection" |
*
* @param {Failed_Save_CollectionInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const failed_save_collection = /** @type {((inputs?: Failed_Save_CollectionInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Failed_Save_CollectionInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === "en") return en_failed_save_collection(inputs)
return zh_failed_save_collection(inputs)
});
+16
View File
@@ -0,0 +1,16 @@
/**
* | output |
* | --- |
* | "Sorted by" |
*
* @param {Sorted_By_LabelInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const sorted_by_label: ((inputs?: Sorted_By_LabelInputs, options?: {
locale?: "en" | "zh";
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Sorted_By_LabelInputs, {
locale?: "en" | "zh";
}, {}>;
export type LocalizedString = import("../runtime.js").LocalizedString;
export type Sorted_By_LabelInputs = {};
@@ -0,0 +1,29 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js';
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} Sorted_By_LabelInputs */
const en_sorted_by_label = /** @type {(inputs: Sorted_By_LabelInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`Sorted by`)
};
const zh_sorted_by_label = /** @type {(inputs: Sorted_By_LabelInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`排序方式`)
};
/**
* | output |
* | --- |
* | "Sorted by" |
*
* @param {Sorted_By_LabelInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const sorted_by_label = /** @type {((inputs?: Sorted_By_LabelInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Sorted_By_LabelInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === "en") return en_sorted_by_label(inputs)
return zh_sorted_by_label(inputs)
});