feat(i18n): add localized provider labels for certificate management

This commit is contained in:
GitHub Actions
2026-03-23 05:45:23 +00:00
parent 3cacecde5a
commit a707d8e67e
6 changed files with 31 additions and 11 deletions

View File

@@ -21,11 +21,11 @@ interface BulkDeleteCertificateDialogProps {
isDeleting: boolean
}
function providerLabel(cert: Certificate): string {
if (cert.provider === 'letsencrypt-staging') return 'Staging'
if (cert.provider === 'custom') return 'Custom'
if (cert.status === 'expired') return 'Expired LE'
if (cert.status === 'expiring') return 'Expiring LE'
function providerLabel(cert: Certificate, t: (key: string) => string): string {
if (cert.provider === 'letsencrypt-staging') return t('certificates.providerStaging')
if (cert.provider === 'custom') return t('certificates.providerCustom')
if (cert.status === 'expired') return t('certificates.providerExpiredLE')
if (cert.status === 'expiring') return t('certificates.providerExpiringLE')
return cert.provider
}
@@ -68,7 +68,7 @@ export default function BulkDeleteCertificateDialog({
className="flex items-center justify-between px-4 py-2"
>
<span className="text-sm text-white">{cert.name || cert.domain}</span>
<span className="text-xs text-gray-500">{providerLabel(cert)}</span>
<span className="text-xs text-gray-500">{providerLabel(cert, t)}</span>
</li>
))}
</ul>