Prompt file imported from Zynapses/Radiant (
.windsurf/workflows/no-hardcoded-ui-text.md). Copyright stays with the author.
No Hardcoded UI Text Policy
MANDATORY: All user-facing text in Radiant and Think Tank must be localized through the localization registry. No hardcoded strings are permitted.
Rules
- NEVER hardcode UI text - All user-visible strings must use the localization system
- Register all strings - Every new UI string must be registered in the localization registry
- Use translation keys - Reference strings by their localization key, not raw text
- Include all languages - Translations must be provided for all supported languages
Supported Languages
- English (en) - Primary
- Spanish (es)
- French (fr)
- German (de)
- Italian (it)
- Portuguese (pt)
- Japanese (ja)
- Korean (ko)
- Chinese Simplified (zh-CN)
- Chinese Traditional (zh-TW)
- Arabic (ar)
- Hebrew (he)
- Russian (ru)
- Dutch (nl)
- Polish (pl)
- Turkish (tr)
Implementation
1. Register String in Backend
import { localizationService } from '@/services/localization';
// Register the string
await localizationService.registerString({
key: 'thinktank.chat.send_button',
defaultText: 'Send Message',
context: 'Button label for sending chat messages',
category: 'thinktank',
});
2. Use in React Components
import { useTranslation } from '@/hooks/useTranslation';
function ChatInput() {
const { t } = useTranslation();
return (
<button>{t('thinktank.chat.send_button')}</button>
);
}
3. Add Translations via Admin Dashboard
Navigate to: Admin Dashboard → Localization → Add Translation
Or use the API:
await localizationService.setTranslation(
'thinktank.chat.send_button',
'es',
'Enviar Mensaje'
);
String Key Naming Convention
Use dot-notation with these prefixes:
common.*- Shared across all appsadmin.*- Admin dashboard specificthinktank.*- Think Tank specificdeployer.*- Swift Deployer specificerrors.*- Error messagesvalidation.*- Form validation messages
Examples:
common.buttons.savecommon.buttons.cancelthinktank.chat.placeholderthinktank.settings.language_labelerrors.network.connection_failed
Categories
buttons- Button labelslabels- Form labelsplaceholders- Input placeholdersmessages- User-facing messageserrors- Error messagestooltips- Tooltip textheadings- Page/section headingsnavigation- Nav menu items
Code Review Checklist
Before approving any PR, verify:
- No hardcoded strings in JSX/TSX
- No hardcoded strings in Swift UI
- All new strings registered with
registerString() - Translation keys follow naming convention
- Context provided for translators
- Translations added for at least English + Spanish
Exceptions
The ONLY exceptions are:
- Brand names: "Radiant", "Think Tank"
- Technical identifiers shown to developers
- Log messages (not user-facing)
- Test fixtures
Enforcement
This policy is enforced by:
- ESLint rule:
no-hardcoded-strings(custom) - Code review checklist
- CI/CD pipeline checks
