import { Framework } from './base' ; import { LanguageId } from '~/utils' ; class LaravelFramework extends Framework { id = 'laravel' ; display = 'Laravel' ; monopoly = true ; detection = { composerJSON : [ 'laravel/framework' , ] , } ; languageIds : LanguageId [ ] = [ 'php' , 'blade' , ] ; enabledParsers = [ 'php' ] ; usageMatchRegex = [ '[^\\w\\d](?:__|trans|@lang|trans_choice)\\([\'"`]({key})[\'"`]' , ] ; refactorTemplates ( keypath ) { return [ `__('${ keypath }')` , `trans_choice('${ keypath }')` , `trans('${ keypath }')` , `@lang('${ keypath }')` , keypath , ] ; } enableFeatures = { namespace : true , } ; pathMatcher = ( ) => '{locale}/**/{namespace}.{ext}' ; rewriteKeys ( keypath ) { return keypath . replace ( /\//g , '.' ) ; } } export default LaravelFramework ;