import PO from 'pofile' ; import { Parser } from './base' ; export class PoParser extends Parser { id = 'po' ; constructor ( ) { super ( [ 'po' ] , 'po(?:t|tx)?' ) ; } readonly = true ; async parse ( text ) { const items = PO . parse ( text ) . items ; const result = { } ; for ( const item of items ) { if ( item . msgstr . length ) result [ item . msgid ] = item . msgstr [ 0 ] ; } return result ; } async dump ( object ) { return '' ; } }