feat(webui): integrate i18n into share-manager component

This commit is contained in:
yiling
2026-06-27 14:50:17 +08:00
parent 2d5b4a3753
commit 0fd826b973
15 changed files with 261 additions and 13 deletions
+5
View File
@@ -737,4 +737,9 @@ export * from "./n_assets_plural.js";
export * from "./n_folders_singular.js";
export * from "./n_folders_plural.js";
export * from "./failed_upload_file.js";
export * from "./failed_fetch_share_link.js";
export * from "./failed_fetch_folders.js";
export * from "./failed_fetch_files.js";
export * from "./failed_remove.js";
export * from "./failed_update.js";
export type LocalizedString = import("../runtime.js").LocalizedString;
+6 -1
View File
@@ -738,4 +738,9 @@ export * from './n_assets_singular.js'
export * from './n_assets_plural.js'
export * from './n_folders_singular.js'
export * from './n_folders_plural.js'
export * from './failed_upload_file.js'
export * from './failed_upload_file.js'
export * from './failed_fetch_share_link.js'
export * from './failed_fetch_folders.js'
export * from './failed_fetch_files.js'
export * from './failed_remove.js'
export * from './failed_update.js'
@@ -0,0 +1,16 @@
/**
* | output |
* | --- |
* | "Failed to fetch files" |
*
* @param {Failed_Fetch_FilesInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const failed_fetch_files: ((inputs?: Failed_Fetch_FilesInputs, options?: {
locale?: "en" | "zh";
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Failed_Fetch_FilesInputs, {
locale?: "en" | "zh";
}, {}>;
export type LocalizedString = import("../runtime.js").LocalizedString;
export type Failed_Fetch_FilesInputs = {};
@@ -0,0 +1,29 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js';
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} Failed_Fetch_FilesInputs */
const en_failed_fetch_files = /** @type {(inputs: Failed_Fetch_FilesInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`Failed to fetch files`)
};
const zh_failed_fetch_files = /** @type {(inputs: Failed_Fetch_FilesInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`获取文件失败`)
};
/**
* | output |
* | --- |
* | "Failed to fetch files" |
*
* @param {Failed_Fetch_FilesInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const failed_fetch_files = /** @type {((inputs?: Failed_Fetch_FilesInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Failed_Fetch_FilesInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === "en") return en_failed_fetch_files(inputs)
return zh_failed_fetch_files(inputs)
});
@@ -0,0 +1,16 @@
/**
* | output |
* | --- |
* | "Failed to fetch folders" |
*
* @param {Failed_Fetch_FoldersInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const failed_fetch_folders: ((inputs?: Failed_Fetch_FoldersInputs, options?: {
locale?: "en" | "zh";
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Failed_Fetch_FoldersInputs, {
locale?: "en" | "zh";
}, {}>;
export type LocalizedString = import("../runtime.js").LocalizedString;
export type Failed_Fetch_FoldersInputs = {};
@@ -0,0 +1,29 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js';
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} Failed_Fetch_FoldersInputs */
const en_failed_fetch_folders = /** @type {(inputs: Failed_Fetch_FoldersInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`Failed to fetch folders`)
};
const zh_failed_fetch_folders = /** @type {(inputs: Failed_Fetch_FoldersInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`获取文件夹失败`)
};
/**
* | output |
* | --- |
* | "Failed to fetch folders" |
*
* @param {Failed_Fetch_FoldersInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const failed_fetch_folders = /** @type {((inputs?: Failed_Fetch_FoldersInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Failed_Fetch_FoldersInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === "en") return en_failed_fetch_folders(inputs)
return zh_failed_fetch_folders(inputs)
});
@@ -0,0 +1,16 @@
/**
* | output |
* | --- |
* | "Failed to fetch share link" |
*
* @param {Failed_Fetch_Share_LinkInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const failed_fetch_share_link: ((inputs?: Failed_Fetch_Share_LinkInputs, options?: {
locale?: "en" | "zh";
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Failed_Fetch_Share_LinkInputs, {
locale?: "en" | "zh";
}, {}>;
export type LocalizedString = import("../runtime.js").LocalizedString;
export type Failed_Fetch_Share_LinkInputs = {};
@@ -0,0 +1,29 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js';
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} Failed_Fetch_Share_LinkInputs */
const en_failed_fetch_share_link = /** @type {(inputs: Failed_Fetch_Share_LinkInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`Failed to fetch share link`)
};
const zh_failed_fetch_share_link = /** @type {(inputs: Failed_Fetch_Share_LinkInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`获取分享链接失败`)
};
/**
* | output |
* | --- |
* | "Failed to fetch share link" |
*
* @param {Failed_Fetch_Share_LinkInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const failed_fetch_share_link = /** @type {((inputs?: Failed_Fetch_Share_LinkInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Failed_Fetch_Share_LinkInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === "en") return en_failed_fetch_share_link(inputs)
return zh_failed_fetch_share_link(inputs)
});
+16
View File
@@ -0,0 +1,16 @@
/**
* | output |
* | --- |
* | "Failed to remove" |
*
* @param {Failed_RemoveInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const failed_remove: ((inputs?: Failed_RemoveInputs, options?: {
locale?: "en" | "zh";
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Failed_RemoveInputs, {
locale?: "en" | "zh";
}, {}>;
export type LocalizedString = import("../runtime.js").LocalizedString;
export type Failed_RemoveInputs = {};
@@ -0,0 +1,29 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js';
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} Failed_RemoveInputs */
const en_failed_remove = /** @type {(inputs: Failed_RemoveInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`Failed to remove`)
};
const zh_failed_remove = /** @type {(inputs: Failed_RemoveInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`移除失败`)
};
/**
* | output |
* | --- |
* | "Failed to remove" |
*
* @param {Failed_RemoveInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const failed_remove = /** @type {((inputs?: Failed_RemoveInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Failed_RemoveInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === "en") return en_failed_remove(inputs)
return zh_failed_remove(inputs)
});
+16
View File
@@ -0,0 +1,16 @@
/**
* | output |
* | --- |
* | "Failed to update" |
*
* @param {Failed_UpdateInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const failed_update: ((inputs?: Failed_UpdateInputs, options?: {
locale?: "en" | "zh";
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Failed_UpdateInputs, {
locale?: "en" | "zh";
}, {}>;
export type LocalizedString = import("../runtime.js").LocalizedString;
export type Failed_UpdateInputs = {};
@@ -0,0 +1,29 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js';
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} Failed_UpdateInputs */
const en_failed_update = /** @type {(inputs: Failed_UpdateInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`Failed to update`)
};
const zh_failed_update = /** @type {(inputs: Failed_UpdateInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`更新失败`)
};
/**
* | output |
* | --- |
* | "Failed to update" |
*
* @param {Failed_UpdateInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const failed_update = /** @type {((inputs?: Failed_UpdateInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Failed_UpdateInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === "en") return en_failed_update(inputs)
return zh_failed_update(inputs)
});