i18n: translate SPF/DKIM/DMARC tooltips

This commit is contained in:
Linus Rath
2026-05-01 17:25:52 +02:00
parent e9c9be84ad
commit 683fe75864
2 changed files with 41 additions and 13 deletions
+27 -12
View File
@@ -4116,7 +4116,21 @@ export function EmailViewer({
</div>
<div className="bg-background p-4 space-y-3">
{/* Authentication Results */}
{email.authenticationResults && (
{email.authenticationResults && (() => {
const translateAuthResult = (result?: string) => {
const r = (result || '').toLowerCase();
switch (r) {
case 'pass': return t('authentication.result.pass');
case 'fail': return t('authentication.result.fail');
case 'softfail': return t('authentication.result.softfail');
case 'neutral': return t('authentication.result.neutral');
case 'permerror': return t('authentication.result.permerror');
case 'temperror': return t('authentication.result.temperror');
case 'none': return t('authentication.result.none');
default: return result || '';
}
};
return (
<div className="grid grid-cols-2 lg:grid-cols-4 gap-3">
{/* SPF Check */}
{email.authenticationResults.spf && (
@@ -4137,10 +4151,10 @@ export function EmailViewer({
<div className="flex-1">
<div className="text-xs font-medium text-gray-900 dark:text-gray-100 flex items-center gap-1">
SPF
<InfoTooltip text="Sender Policy Framework: Verifies that the sending server is authorized to send email on behalf of the domain" />
<InfoTooltip text={t('authentication.tooltip_spf')} />
</div>
<div className={cn("text-xs capitalize", getSecurityStatus(email.authenticationResults.spf.result).color)}>
{email.authenticationResults.spf.result}
<div className={cn("text-xs", getSecurityStatus(email.authenticationResults.spf.result).color)}>
{translateAuthResult(email.authenticationResults.spf.result)}
</div>
</div>
</div>
@@ -4171,10 +4185,10 @@ export function EmailViewer({
<div className="flex-1">
<div className="text-xs font-medium text-gray-900 dark:text-gray-100 flex items-center gap-1">
DKIM
<InfoTooltip text="DomainKeys Identified Mail: Confirms the email was not altered in transit using a cryptographic signature" />
<InfoTooltip text={t('authentication.tooltip_dkim')} />
</div>
<div className={cn("text-xs capitalize", getSecurityStatus(email.authenticationResults.dkim.result).color)}>
{email.authenticationResults.dkim.result}
<div className={cn("text-xs", getSecurityStatus(email.authenticationResults.dkim.result).color)}>
{translateAuthResult(email.authenticationResults.dkim.result)}
</div>
</div>
</div>
@@ -4205,16 +4219,16 @@ export function EmailViewer({
<div className="flex-1">
<div className="text-xs font-medium text-gray-900 dark:text-gray-100 flex items-center gap-1">
DMARC
<InfoTooltip text="Domain-based Message Authentication, Reporting & Conformance: Ensures SPF and DKIM align with the sender's domain and sets a policy for failures" />
<InfoTooltip text={t('authentication.tooltip_dmarc')} />
</div>
<div className={cn("text-xs capitalize", getSecurityStatus(email.authenticationResults.dmarc.result).color)}>
{email.authenticationResults.dmarc.result}
<div className={cn("text-xs", getSecurityStatus(email.authenticationResults.dmarc.result).color)}>
{translateAuthResult(email.authenticationResults.dmarc.result)}
</div>
</div>
</div>
{email.authenticationResults.dmarc.policy && (
<div className="text-xs text-gray-600 dark:text-gray-400 mt-1">
Policy: {email.authenticationResults.dmarc.policy}
{t('authentication.policy')}: {email.authenticationResults.dmarc.policy}
</div>
)}
</div>
@@ -4258,7 +4272,8 @@ export function EmailViewer({
</div>
)}
</div>
)}
);
})()}
{/* AI Analysis (X-Spam-LLM) - Full width card */}
{email.spamLLM && (
+14 -1
View File
@@ -306,7 +306,20 @@
"fail": "DMARC Fail",
"none": "No DMARC"
},
"spam_score": "Spam Score"
"spam_score": "Spam Score",
"tooltip_spf": "Sender Policy Framework: Verifies that the sending server is authorized to send email on behalf of the domain",
"tooltip_dkim": "DomainKeys Identified Mail: Confirms the email was not altered in transit using a cryptographic signature",
"tooltip_dmarc": "Domain-based Message Authentication, Reporting & Conformance: Ensures SPF and DKIM align with the sender's domain and sets a policy for failures",
"policy": "Policy",
"result": {
"pass": "Pass",
"fail": "Fail",
"softfail": "Soft fail",
"neutral": "Neutral",
"permerror": "Permanent error",
"temperror": "Temporary error",
"none": "None"
}
},
"headers": {
"routing": "Routing",