fix(i18n): align PBS fields and omit duplicate English errors

This commit is contained in:
VAIO73
2026-10-20 08:13:34 +00:00
parent c991b8280a
commit f9e36f0b0a
6 changed files with 66 additions and 22 deletions
+4 -3
View File
@@ -1,16 +1,17 @@
"use client"
import { pbsErrorText } from "../lib/pbs-messages"
import { pbsErrorText, pbsIsKnownError } from "../lib/pbs-messages"
import { useT } from "../lib/i18n/provider"
// Keep PBS's original diagnostic available without making it the UI message.
// Known application messages are already explained in the active language.
// Preserve unrecognized external diagnostics as escaped technical details.
export function PBSProblemMessage({ problem, raw, fallback, className = "" }: {
problem?: unknown; raw?: string; fallback?: string; className?: string
}) {
const t = useT()
return <div className={`min-w-0 space-y-1 ${className}`}>
<p>{pbsErrorText(problem, t, fallback)}</p>
{raw && <details className="text-xs">
{raw && !pbsIsKnownError(problem) && <details className="text-xs">
<summary className="cursor-pointer">{t("pbs.technicalDetails")}</summary>
<pre className="mt-1 whitespace-pre-wrap break-words font-mono">{raw}</pre>
</details>}