mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-06 16:24:17 +00:00
feat(webui): translate formatCount in file-browser and add plural keys
This commit is contained in:
@@ -732,4 +732,8 @@ export * from "./failed_create_field.js";
|
||||
export * from "./failed_update_field.js";
|
||||
export * from "./failed_delete_field.js";
|
||||
export * from "./new_label.js";
|
||||
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 type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
|
||||
@@ -733,4 +733,8 @@ 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 * from './new_label.js'
|
||||
export * from './n_assets_singular.js'
|
||||
export * from './n_assets_plural.js'
|
||||
export * from './n_folders_singular.js'
|
||||
export * from './n_folders_plural.js'
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "{count} Assets" |
|
||||
*
|
||||
* @param {N_Assets_PluralInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const n_assets_plural: ((inputs: N_Assets_PluralInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<N_Assets_PluralInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type N_Assets_PluralInputs = {
|
||||
count: NonNullable<unknown>;
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{ count: NonNullable<unknown> }} N_Assets_PluralInputs */
|
||||
|
||||
const en_n_assets_plural = /** @type {(inputs: N_Assets_PluralInputs) => LocalizedString} */ (i) => {
|
||||
return /** @type {LocalizedString} */ (`${i?.count} Assets`)
|
||||
};
|
||||
|
||||
const zh_n_assets_plural = /** @type {(inputs: N_Assets_PluralInputs) => LocalizedString} */ (i) => {
|
||||
return /** @type {LocalizedString} */ (`${i?.count} 个资源`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "{count} Assets" |
|
||||
*
|
||||
* @param {N_Assets_PluralInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const n_assets_plural = /** @type {((inputs: N_Assets_PluralInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<N_Assets_PluralInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_n_assets_plural(inputs)
|
||||
return zh_n_assets_plural(inputs)
|
||||
});
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "{count} Asset" |
|
||||
*
|
||||
* @param {N_Assets_SingularInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const n_assets_singular: ((inputs: N_Assets_SingularInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<N_Assets_SingularInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type N_Assets_SingularInputs = {
|
||||
count: NonNullable<unknown>;
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{ count: NonNullable<unknown> }} N_Assets_SingularInputs */
|
||||
|
||||
const en_n_assets_singular = /** @type {(inputs: N_Assets_SingularInputs) => LocalizedString} */ (i) => {
|
||||
return /** @type {LocalizedString} */ (`${i?.count} Asset`)
|
||||
};
|
||||
|
||||
const zh_n_assets_singular = /** @type {(inputs: N_Assets_SingularInputs) => LocalizedString} */ (i) => {
|
||||
return /** @type {LocalizedString} */ (`${i?.count} 个资源`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "{count} Asset" |
|
||||
*
|
||||
* @param {N_Assets_SingularInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const n_assets_singular = /** @type {((inputs: N_Assets_SingularInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<N_Assets_SingularInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_n_assets_singular(inputs)
|
||||
return zh_n_assets_singular(inputs)
|
||||
});
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "{count} Folders" |
|
||||
*
|
||||
* @param {N_Folders_PluralInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const n_folders_plural: ((inputs: N_Folders_PluralInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<N_Folders_PluralInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type N_Folders_PluralInputs = {
|
||||
count: NonNullable<unknown>;
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{ count: NonNullable<unknown> }} N_Folders_PluralInputs */
|
||||
|
||||
const en_n_folders_plural = /** @type {(inputs: N_Folders_PluralInputs) => LocalizedString} */ (i) => {
|
||||
return /** @type {LocalizedString} */ (`${i?.count} Folders`)
|
||||
};
|
||||
|
||||
const zh_n_folders_plural = /** @type {(inputs: N_Folders_PluralInputs) => LocalizedString} */ (i) => {
|
||||
return /** @type {LocalizedString} */ (`${i?.count} 个文件夹`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "{count} Folders" |
|
||||
*
|
||||
* @param {N_Folders_PluralInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const n_folders_plural = /** @type {((inputs: N_Folders_PluralInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<N_Folders_PluralInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_n_folders_plural(inputs)
|
||||
return zh_n_folders_plural(inputs)
|
||||
});
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "{count} Folder" |
|
||||
*
|
||||
* @param {N_Folders_SingularInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const n_folders_singular: ((inputs: N_Folders_SingularInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<N_Folders_SingularInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type N_Folders_SingularInputs = {
|
||||
count: NonNullable<unknown>;
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{ count: NonNullable<unknown> }} N_Folders_SingularInputs */
|
||||
|
||||
const en_n_folders_singular = /** @type {(inputs: N_Folders_SingularInputs) => LocalizedString} */ (i) => {
|
||||
return /** @type {LocalizedString} */ (`${i?.count} Folder`)
|
||||
};
|
||||
|
||||
const zh_n_folders_singular = /** @type {(inputs: N_Folders_SingularInputs) => LocalizedString} */ (i) => {
|
||||
return /** @type {LocalizedString} */ (`${i?.count} 个文件夹`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "{count} Folder" |
|
||||
*
|
||||
* @param {N_Folders_SingularInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const n_folders_singular = /** @type {((inputs: N_Folders_SingularInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<N_Folders_SingularInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_n_folders_singular(inputs)
|
||||
return zh_n_folders_singular(inputs)
|
||||
});
|
||||
Reference in New Issue
Block a user