import { Framework } from './base' ; import { LanguageId } from '~/utils' ; class PolyglotFramework extends Framework { id = 'polyglot' ; display = 'Polyglot' ; detection = { packageJSON : [ 'node-polyglot' , ] , } ; languageIds : LanguageId [ ] = [ 'javascript' , 'typescript' , 'javascriptreact' , 'typescriptreact' , 'ruby' , ] ; usageMatchRegex = [ '(?:polyglot|I18n)\\.t\\(\\s*[\'"`]({key})[\'"`]' , ] ; refactorTemplates ( keypath ) { return [ `polyglot.t('${ keypath }')` , `I18N.t('${ keypath }')` , keypath , ] ; } } export default PolyglotFramework ;