import { Framework } from './base' ; import { LanguageId } from '~/utils' ; class GlobalizeFramework extends Framework { id = 'globalize' ; display = 'Globalize' ; detection = { packageJSON : [ 'globalize' , ] , } ; languageIds : LanguageId [ ] = [ 'javascript' , 'typescript' , 'javascriptreact' , 'typescriptreact' , ] ; usageMatchRegex = [ '.(?:messageFormatter|formatMessage)\\(\\s*[\'"`]({key})[\'"`]' , ] ; refactorTemplates ( keypath ) { return [ `Globalize.messageFormatter('${ keypath }')` , `Globalize.formatMessage('${ keypath }')` , keypath , ] ; } rewriteKeys ( keypath ) { return keypath . replace ( /\//g , '.' ) ; } } export default GlobalizeFramework ;