React-intl define messages outside of react
问题 I have utils.js file. export function categoryIdToCategoryName(categoryId) { let name; switch (categoryId) { case constants.RISK_CATEGORY_LOW: name = 'low'; break; case constants.RISK_CATEGORY_MEDIUM: name = 'medium'; break; case constants.RISK_CATEGORY_HIGH: name = 'high'; break; case constants.RISK_CATEGORY_CRITICAL: name = 'critical'; break; default: console.warn('see: /utils/risk.js', 'categoryIdToCategoryName:', categoryId); name = 'unknown'; } return name; } I would like to translate