@Override protected Event handleStartBatch(final Event event) { // Start TMX writer (one for all input documents) if (tmx == null && params.getGenerateTMX()) { File outFile = new File(params.getTmxOutputPath()); if ( outFile.exists() ) promptShouldOverwrite(); tmx = new TMXWriter(outFile.getAbsolutePath()); tmx.writeStartDocument(sourceLocale, targetLocale, getClass().getName(), null, "paragraph", null, null); } return event; }
protected void initializeTMXWriters () { if ( tmxPathApproved != null ) { tmxWriterApproved = new TMXWriter(tempTmxPathApproved); tmxWriterApproved.setLetterCodedMode(useLetterCodes, zeroBasedLetterCodes); tmxWriterApproved.writeStartDocument(manifest.getSourceLocale(), manifest.getTargetLocale(), getClass().getName(), null, null, null, null); } if ( tmxPathUnApproved != null ) { tmxWriterUnApproved = new TMXWriter(tempTmxPathUnApproved); tmxWriterUnApproved.setLetterCodedMode(useLetterCodes, zeroBasedLetterCodes); tmxWriterUnApproved.writeStartDocument(manifest.getSourceLocale(), manifest.getTargetLocale(), getClass().getName(), null, null, null, null); } if ( tmxPathAlternates != null ) { tmxWriterAlternates = new TMXWriter(tempTmxPathAlternates); tmxWriterAlternates.setLetterCodedMode(useLetterCodes, zeroBasedLetterCodes); tmxWriterAlternates.writeStartDocument(manifest.getSourceLocale(), manifest.getTargetLocale(), getClass().getName(), null, null, null, null); } if ( tmxPathLeverage != null ) { tmxWriterLeverage = new TMXWriter(tempTmxPathLeverage); tmxWriterLeverage.setLetterCodedMode(useLetterCodes, zeroBasedLetterCodes); tmxWriterLeverage.writeStartDocument(manifest.getSourceLocale(), manifest.getTargetLocale(), getClass().getName(), null, null, null, null); } }
TMXWriter writer = null; try { writer = new TMXWriter(outputPath); writer.writeStartDocument(sourceLocale, targetLocale, null, null, "sentence", "simpleTM", null);
tmxWriter = new TMXWriter(tmxOutputPath); tmxWriter.writeStartDocument(sourceLocale, targetLocale, getClass().getCanonicalName(), "1", "sentence", null, "unknown");
private void processStartDocument (Event event) { StartDocument sd = (StartDocument)event.getResource(); // Create the output if ( outputStream == null ) { if (writer == null) { writer = new TMXWriter(outputPath); } else { writer.setPath(outputPath); } } else if ( outputStream != null ) { if (writer == null) { writer = new TMXWriter(new XMLWriter( new OutputStreamWriter(outputStream, StandardCharsets.UTF_8))); } else { writer.setXmlWriter(new XMLWriter( new OutputStreamWriter(outputStream, StandardCharsets.UTF_8))); } } writer.setWriteAllPropertiesAsAttributes(params.isWriteAllPropertiesAsAttributes()); writer.setExpandDuplicateProps(params.isEnableDuplicateProps()); writer.setPropValueSep(params.getPropValueSep()); writer.setGenerateUUID(params.isGenerateUUID()); writer.setNormalizeCodeIds(params.isNormalizeInlineIDs()); writer.writeStartDocument(sd, sd.getLocale(), locale, null, null, segType, "unknown", "text"); }
resolvedPath = Util.fillInputRootDirectoryVariable(resolvedPath, inputRootDir); resolvedPath = LocaleId.replaceVariables(resolvedPath, sourceLocale, targetLocale); tmx = new TMXWriter(resolvedPath); tmx.writeStartDocument(sourceLocale, targetLocale, getClass().getName(), null, null, null, null);
tmxOutputPath = Util.fillInputRootDirectoryVariable(tmxOutputPath, inputRootDir); tmxOutputPath = LocaleId.replaceVariables(tmxOutputPath, sourceLocale, targetLocale); tmxWriter = new TMXWriter(tmxOutputPath); tmxWriter.writeStartDocument(sourceLocale, targetLocale, getClass().getCanonicalName(), "1", "sentence", null, "unknown");
tmxRawDoc = new RawDocument(tmxOutputURI, "UTF-8", srcLoc, trgLoc, "okf_tmx"); File tmxOutputFile = tmxRawDoc.createOutputFile(tmxOutputURI); tmxWriter = new TMXWriter(tmxOutputFile.getAbsolutePath());
realPath = LocaleId.replaceVariables(realPath, sourceLocale, targetLocale); tmxWriter = new TMXWriter(realPath); tmxWriter.setUseMTPrefix(params.getUseMTPrefix()); tmxWriter.writeStartDocument(sourceLocale, targetLocale,