Skip to content

Commit 861cdf9

Browse files
committed
🐛 Repair English error message shows up under chinese language when model is not connected #1513
Comments revision
1 parent a38a54e commit 861cdf9

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

frontend/app/[locale]/setup/models/components/model/ModelAddDialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ export const ModelAddDialog = ({
298298
if (result.error) {
299299
const translatedError = translateError(result.error, t)
300300
// Ensure translatedError is a valid string, fallback to original error if needed
301-
const errorText = (translatedError && typeof translatedError === 'string' && translatedError.length > 0)
301+
const errorText = (translatedError && translatedError.length > 0)
302302
? translatedError
303303
: (result.error || 'Unknown error')
304304
message.error(t('model.dialog.error.connectivityFailed', { error: errorText }))
@@ -313,7 +313,7 @@ export const ModelAddDialog = ({
313313
// Show error message using internationalized component (same as add failure)
314314
const translatedError = translateError(errorMessage || t('model.dialog.connectivity.status.unavailable'), t)
315315
// Ensure translatedError is a valid string
316-
const errorText = translatedError && typeof translatedError === 'string' ? translatedError : (errorMessage || t("model.dialog.connectivity.status.unavailable"))
316+
const errorText = translatedError ? translatedError : (errorMessage || t("model.dialog.connectivity.status.unavailable"))
317317
message.error(t('model.dialog.error.connectivityFailed', { error: errorText }))
318318
} finally {
319319
setVerifyingConnectivity(false);

frontend/public/locales/en/common.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,6 @@
567567
"model.dialog.error.nameAlreadyInUse": "Name '{{name}}' is already in use, please choose another display name",
568568
"model.dialog.error.modelNotFound": "Model not found: {{name}}",
569569
"model.dialog.error.failedToConnect": "Failed to connect to model '{{modelName}}' at {{url}}. Please verify the URL, API key, and network connection.",
570-
"model.dialog.error.failedToConnectGeneric": "Connection failed: {{error}}",
571570
"model.dialog.error.unsupportedModelType": "Unsupported model type: {{type}}",
572571
"model.dialog.error.invalidConfiguration": "Invalid configuration: {{error}}",
573572
"model.dialog.error.addFailedLog": "Failed to add model",

frontend/public/locales/zh/common.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,6 @@
567567
"model.dialog.error.nameAlreadyInUse": "名称 '{{name}}' 已被使用,请选择其他显示名称",
568568
"model.dialog.error.modelNotFound": "模型未找到:{{name}}",
569569
"model.dialog.error.failedToConnect": "无法连接到模型 '{{modelName}}'({{url}})。请检查URL、API密钥和网络连接。",
570-
"model.dialog.error.failedToConnectGeneric": "连接失败:{{error}}",
571570
"model.dialog.error.unsupportedModelType": "不支持的模型类型:{{type}}",
572571
"model.dialog.error.invalidConfiguration": "配置无效:{{error}}",
573572
"model.dialog.error.addFailedLog": "添加模型失败",

0 commit comments

Comments
 (0)