diff --git a/src/uni_modules/wot-design-uni/components/composables/useTranslate.ts b/src/uni_modules/wot-design-uni/components/composables/useTranslate.ts index bd2881c6..79aa7953 100644 --- a/src/uni_modules/wot-design-uni/components/composables/useTranslate.ts +++ b/src/uni_modules/wot-design-uni/components/composables/useTranslate.ts @@ -1,13 +1,4 @@ -/* - * @Author: weisheng - * @Date: 2024-01-25 23:06:48 - * @LastEditTime: 2025-02-14 11:20:02 - * @LastEditors: 810505339 - * @Description: - * @FilePath: \wot-design-uni\src\uni_modules\wot-design-uni\components\composables\useTranslate.ts - * 记得注释 - */ -import { camelCase, getPropByPath, isFunction } from '../common/util' +import { camelCase, getPropByPath, isDef, isFunction } from '../common/util' import Locale from '../../locale' export const useTranslate = (name?: string) => { @@ -15,8 +6,7 @@ export const useTranslate = (name?: string) => { const translate = (key: string, ...args: unknown[]) => { const currentMessages = Locale.messages() const message = getPropByPath(currentMessages, prefix + key) - return isFunction(message) ? message(...args) : message + return isFunction(message) ? message(...args) : isDef(message) ? message : `${prefix}${key}` } - return { translate } } diff --git a/src/uni_modules/wot-design-uni/locale/lang/en-US.ts b/src/uni_modules/wot-design-uni/locale/lang/en-US.ts index eede2605..d354723a 100644 --- a/src/uni_modules/wot-design-uni/locale/lang/en-US.ts +++ b/src/uni_modules/wot-design-uni/locale/lang/en-US.ts @@ -79,8 +79,8 @@ export default { pagination: { prev: 'Previous', next: 'Next', - page: (value: number) => `Page:${value}`, - total: (total: number) => `Total:${total}`, + page: (value: number) => `Page: ${value}`, + total: (total: number) => `Total: ${total}`, size: (size: number) => `${size}/page` }, picker: { diff --git a/src/uni_modules/wot-design-uni/locale/lang/fr-FR.ts b/src/uni_modules/wot-design-uni/locale/lang/fr-FR.ts index 3f32a7bd..ead98545 100644 --- a/src/uni_modules/wot-design-uni/locale/lang/fr-FR.ts +++ b/src/uni_modules/wot-design-uni/locale/lang/fr-FR.ts @@ -75,8 +75,8 @@ export default { pagination: { prev: 'Précédent', next: 'Suivant', - page: (value: number) => `Page : ${value}`, - total: (total: number) => `Total : ${total}`, + page: (value: number) => `Page: ${value}`, + total: (total: number) => `Total: ${total}`, size: (size: number) => `${size}/Page` }, picker: {