UNPKG

@criticalmanufacturing/dev-i18n-transform

Version:
52 lines (51 loc) 1.42 kB
import { Parser } from "./parser.interface"; import { Package } from "../model/package"; /** * PO (Portable Object) parser. * Parses a set of PO files into a {@see Package} */ export declare class PortableObjectParser implements Parser { /** * File paths to analyse */ private _filePaths; /** * Utility instance */ private _util; /** * Resulting package after parser is run. */ private _package; /** * PortableObject (PO) File(s) Analyser * @param packagePath Absolute package path * @param filePaths File paths to analyse */ constructor(packagePath: string, filePaths: string[]); private parseFile; private parseEntry; private extractFileInformation; /** * * @param entry Translation entry to parse */ private extractTranslation; /** * Extract translators notes from the translation entry. * Translation notes currently supported: * - 001 | Automated Translation * * @param entry Translation entry to extract the notes from * @return An array of translator notes. */ private extractNotesForTranslators; /** * Parses the header of the PO file. * * @param header Header of the file to parse * @return Information about the package */ private parseHeader; run(): Package; }