Search in sources :

Example 6 with HTMLFilter2

use of org.omegat.filters2.html2.HTMLFilter2 in project omegat by omegat-org.

the class HTMLFilter2Test method testTranslate.

@Test
public void testTranslate() throws Exception {
    HTMLFilter2 filter = new HTMLFilter2();
    translateText(filter, "test/data/filters/html/file-HTMLFilter2.html");
    translateText(filter, "test/data/filters/html/file-HTMLFilter2-SMP.html");
}
Also used : HTMLFilter2(org.omegat.filters2.html2.HTMLFilter2) Test(org.junit.Test)

Example 7 with HTMLFilter2

use of org.omegat.filters2.html2.HTMLFilter2 in project omegat by omegat-org.

the class HTMLFilter2Test method testTagsOptimization.

@Test
public void testTagsOptimization() throws Exception {
    String f = "test/data/filters/html/file-HTMLFilter2-tags-optimization.html";
    HTMLFilter2 filter = new HTMLFilter2();
    Core.getFilterMaster().getConfig().setRemoveTags(false);
    filter.isFileSupported(new File(f), Collections.emptyMap(), new FilterContext(new Language("en"), new Language("be"), false));
    IProject.FileInfo fi = loadSourceFiles(filter, f);
    checkMultiStart(fi, f);
    checkMultiNoPrevNext("<i0/><b1><c2>This</c2> is <i3>first</i3> line.</b1>", null, null, null);
    translateXML(filter, f);
    Core.getFilterMaster().getConfig().setRemoveTags(true);
    filter.isFileSupported(new File(f), Collections.emptyMap(), new FilterContext(new Language("en"), new Language("be"), false));
    fi = loadSourceFiles(filter, f);
    checkMultiStart(fi, f);
    checkMultiNoPrevNext("<c0>This</c0> is <i1>first</i1> line.", null, null, null);
    translateXML(filter, f);
}
Also used : Language(org.omegat.util.Language) HTMLFilter2(org.omegat.filters2.html2.HTMLFilter2) File(java.io.File) IProject(org.omegat.core.data.IProject) FilterContext(org.omegat.filters2.FilterContext) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)7 HTMLFilter2 (org.omegat.filters2.html2.HTMLFilter2)7 File (java.io.File)4 TreeMap (java.util.TreeMap)3 FilterContext (org.omegat.filters2.FilterContext)3 IProject (org.omegat.core.data.IProject)2 HTMLOptions (org.omegat.filters2.html2.HTMLOptions)2 Language (org.omegat.util.Language)1