28 lines
605 B
TypeScript
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'
|
|
}
|