use of org.omegat.filters2.html2.HTMLOptions in project omegat by omegat-org.
the class TmxComplianceTests method testExport2A.
/**
* Test Export2A - HTML
*/
@Test
public void testExport2A() throws Exception {
File tmxFile = new File("test/data/tmx/TMXComplianceKit/ExportTest2A.tmx");
File sourceFile = new File("test/data/tmx/TMXComplianceKit/ExportTest2A.htm");
File translatedFile = new File("test/data/tmx/TMXComplianceKit/ExportTest2A_fr.htm");
ProjectProperties props = new TestProjectProperties("EN-US", "FR-CA");
props.setSentenceSegmentingEnabled(true);
FilterContext fc = new FilterContext(props);
fc.setInEncoding("windows-1252");
Map<String, String> config = new TreeMap<String, String>();
new HTMLOptions(config).setSkipMeta("content=en-us,content=fr-ca");
List<String> sources = loadTexts(new HTMLFilter2(), sourceFile, null, fc, config);
List<String> translations = loadTexts(new HTMLFilter2(), translatedFile, null, fc, config);
assertEquals(sources.size(), translations.size());
ProjectTMX tmx = new ProjectTMX(props.getSourceLanguage(), props.getTargetLanguage(), props.isSentenceSegmentingEnabled(), outFile, orphanedCallback);
for (int i = 0; i < sources.size(); i++) {
tmx.defaults.put(sources.get(i), createTMXEntry(sources.get(i), translations.get(i), true));
}
tmx.exportTMX(props, outFile, false, true, true);
compareTMX(tmxFile, outFile, 12);
}
use of org.omegat.filters2.html2.HTMLOptions in project omegat by omegat-org.
the class TmxComplianceTests method testExport1B.
/**
* Test Export1B - HTML
*/
@Test
public void testExport1B() throws Exception {
File tmxFile = new File("test/data/tmx/TMXComplianceKit/ExportTest1B.tmx");
File sourceFile = new File("test/data/tmx/TMXComplianceKit/ExportTest1B.htm");
File translatedFile = new File("test/data/tmx/TMXComplianceKit/ExportTest1B_fr.htm");
ProjectProperties props = new TestProjectProperties("EN-US", "FR-CA");
FilterContext fc = new FilterContext(props);
fc.setInEncoding("windows-1252");
Map<String, String> config = new TreeMap<String, String>();
new HTMLOptions(config).setSkipMeta("content=en-us,content=fr-ca");
List<String> sources = loadTexts(new HTMLFilter2(), sourceFile, null, fc, config);
List<String> translations = loadTexts(new HTMLFilter2(), translatedFile, null, fc, config);
assertEquals(sources.size(), translations.size());
ProjectTMX tmx = new ProjectTMX(props.getSourceLanguage(), props.getTargetLanguage(), props.isSentenceSegmentingEnabled(), outFile, orphanedCallback);
for (int i = 0; i < sources.size(); i++) {
tmx.defaults.put(sources.get(i), createTMXEntry(sources.get(i), translations.get(i), true));
}
tmx.exportTMX(props, outFile, false, false, true);
compareTMX(tmxFile, outFile, 2);
}
Aggregations