refactor(weknoracloud): enhance internationalization and UI feedback for credential management
- Updated the WeKnoraCloud settings and related components to utilize i18n for improved localization. - Replaced hardcoded strings with translation keys for better maintainability and user experience. - Enhanced user feedback messages for credential status, including configuration, expiration, and unconfiguration states. - Improved UI elements to guide users in managing WeKnoraCloud credentials effectively. This update streamlines the user interface and ensures consistent messaging across different languages.
This commit is contained in:
@@ -93,14 +93,12 @@ import { storeToRefs } from 'pinia'
|
||||
const { t } = useI18n()
|
||||
|
||||
function getEngineDisplayName(engineName: string): string {
|
||||
if (engineName === 'weknoracloud') return 'WeKnora Cloud'
|
||||
const key = `kbSettings.parser.engines.${engineName}.name`
|
||||
const translated = t(key)
|
||||
return translated !== key ? translated : engineName
|
||||
}
|
||||
|
||||
function getEngineDisplayDesc(engineName: string, fallback: string): string {
|
||||
if (engineName === 'weknoracloud') return '使用 WeKnora Cloud 进行文档解析'
|
||||
const key = `kbSettings.parser.engines.${engineName}.desc`
|
||||
const translated = t(key)
|
||||
return translated !== key ? translated : fallback
|
||||
|
||||
Reference in New Issue
Block a user