Search in sources :

Example 1 with XHTMLFilter

use of org.omegat.filters3.xml.xhtml.XHTMLFilter in project omegat by omegat-org.

the class XHTMLFilterTest method testTranslate.

@Test
public void testTranslate() throws Exception {
    String f = "test/data/filters/xhtml/file-XHTMLFilter.html";
    XHTMLFilter filter = new XHTMLFilter();
    filter.isFileSupported(new File(f), new TreeMap<String, String>(), new FilterContext(new Language("en"), new Language("be"), false));
    translateXML(filter, f);
}
Also used : XHTMLFilter(org.omegat.filters3.xml.xhtml.XHTMLFilter) Language(org.omegat.util.Language) File(java.io.File) FilterContext(org.omegat.filters2.FilterContext) Test(org.junit.Test)

Example 2 with XHTMLFilter

use of org.omegat.filters3.xml.xhtml.XHTMLFilter in project omegat by omegat-org.

the class XHTMLFilterTest method testParse.

@Test
public void testParse() throws Exception {
    String f = "test/data/filters/xhtml/file-XHTMLFilter.html";
    XHTMLFilter filter = new XHTMLFilter();
    filter.isFileSupported(new File(f), new TreeMap<String, String>(), new FilterContext(new Language("en"), new Language("be"), false));
    parse(filter, f);
}
Also used : XHTMLFilter(org.omegat.filters3.xml.xhtml.XHTMLFilter) Language(org.omegat.util.Language) File(java.io.File) FilterContext(org.omegat.filters2.FilterContext) Test(org.junit.Test)

Example 3 with XHTMLFilter

use of org.omegat.filters3.xml.xhtml.XHTMLFilter in project omegat by omegat-org.

the class XHTMLFilterTest method testLoad.

@Test
public void testLoad() throws Exception {
    String f = "test/data/filters/xhtml/file-XHTMLFilter.html";
    XHTMLFilter filter = new XHTMLFilter();
    filter.isFileSupported(new File(f), new TreeMap<String, String>(), new FilterContext(new Language("en"), new Language("be"), false));
    IProject.FileInfo fi = loadSourceFiles(filter, f);
    checkMultiStart(fi, f);
    checkMulti("en", null, null, "", "en", null);
    checkMulti("en", null, null, "en", "XHTML 1.0 Example", null);
    checkMulti("XHTML 1.0 Example", null, null, "en", "Extensible HyperText Markup Language", null);
    checkMulti("Extensible HyperText Markup Language", null, null, "XHTML 1.0 Example", "http://www.w3.org/Icons/valid-xhtml10", null);
}
Also used : XHTMLFilter(org.omegat.filters3.xml.xhtml.XHTMLFilter) Language(org.omegat.util.Language) File(java.io.File) IProject(org.omegat.core.data.IProject) FilterContext(org.omegat.filters2.FilterContext) Test(org.junit.Test)

Example 4 with XHTMLFilter

use of org.omegat.filters3.xml.xhtml.XHTMLFilter in project omegat by omegat-org.

the class XHTMLFilterTest method testTagsOptimization.

@Test
public void testTagsOptimization() throws Exception {
    String f = "test/data/filters/xhtml/file-XHTMLFilter-tags-optimization.html";
    XHTMLFilter filter = new XHTMLFilter();
    Core.getFilterMaster().getConfig().setRemoveTags(false);
    filter.isFileSupported(new File(f), new TreeMap<String, String>(), new FilterContext(new Language("en"), new Language("be"), false));
    IProject.FileInfo fi = loadSourceFiles(filter, f);
    checkMultiStart(fi, f);
    checkMultiNoPrevNext("en", null, null, null);
    checkMultiNoPrevNext("en", null, null, null);
    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), new TreeMap<String, String>(), new FilterContext(new Language("en"), new Language("be"), false));
    fi = loadSourceFiles(filter, f);
    checkMultiStart(fi, f);
    checkMultiNoPrevNext("en", null, null, null);
    checkMultiNoPrevNext("en", null, null, null);
    checkMultiNoPrevNext("<c0>This</c0> is <i1>first</i1> line.", null, null, null);
    translateXML(filter, f);
}
Also used : XHTMLFilter(org.omegat.filters3.xml.xhtml.XHTMLFilter) Language(org.omegat.util.Language) File(java.io.File) IProject(org.omegat.core.data.IProject) FilterContext(org.omegat.filters2.FilterContext) Test(org.junit.Test)

Aggregations

File (java.io.File)4 Test (org.junit.Test)4 FilterContext (org.omegat.filters2.FilterContext)4 XHTMLFilter (org.omegat.filters3.xml.xhtml.XHTMLFilter)4 Language (org.omegat.util.Language)4 IProject (org.omegat.core.data.IProject)2