profit-planet-frontend/src/app/admin/pool-management/utils/poolDescriptionKey.ts
DeathKaioken 646c293bc1 .
Co-authored-by: Copilot <copilot@github.com>
2026-05-04 06:22:10 +02:00

28 lines
605 B
TypeScript

export function resolvePoolDescriptionKey(
poolName?: string,
poolType?: 'coffee' | 'other',
rawDescription?: string
): string {
const raw = (rawDescription || '').trim()
// Keep existing translation keys untouched.
if (raw.includes('.') && /^[A-Za-z0-9_.-]+$/.test(raw)) {
return raw
}
const normalizedName = (poolName || '').trim().toLowerCase()
if (normalizedName === 'core') {
return 'autofix.kcf73e90d'
}
if (poolType === 'coffee') {
return 'autofix.k20f6ac90'
}
if (poolType === 'other') {
return 'autofix.k4bc91d55'
}
return 'autofix.kf0c9a38d'
}