mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-04 06:54:28 +00:00
feat(webui): integrate i18n into search and sort control components
This commit is contained in:
@@ -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)
|
||||
});
|
||||
@@ -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)
|
||||
});
|
||||
Reference in New Issue
Block a user