import { Framework } from './base' ; import { LanguageId } from '~/utils' ; class LinguiFramework extends Framework { id = 'lingui' ; display = 'Lingui' ; detection = { packageJSON : [ '@lingui/core' , ] , } ; enabledParsers = [ 'po' , ] ; languageIds : LanguageId [ ] = [ 'javascript' , 'typescript' , 'javascriptreact' , 'typescriptreact' , ] ; usageMatchRegex = [ '\\bt`({key})`' , '<Trans>[\\s]*({key})[\\s]*<\\/Trans>' , ] ; refactorTemplates ( keypath ) { return [ `t\`${ keypath }\`` , `<Trans>${ keypath }</Trans>` , keypath , ] ; } pathMatcher ( ) { return '{locale}/messages.po' ; } } export default LinguiFramework ;