Search in sources :

Example 1 with MagentoFilter

use of org.omegat.filters2.text.magento.MagentoFilter in project omegat by omegat-org.

the class MagentoFilterTest method testAlign.

@Test
public void testAlign() throws Exception {
    final AlignResultHolder alignResult = new AlignResultHolder();
    align(new MagentoFilter(), "magento/MagentoFilterAlign.csv", "magento/MagentoFilterAlign-tr.csv", new IAlignCallback() {

        public void addTranslation(String id, String source, String translation, boolean isFuzzy, String comment, IFilter filter) {
            alignResult.aligned = id.equals("code") && source.equals("original") && translation.equals("translated");
        }
    });
    assertTrue(alignResult.aligned);
}
Also used : IFilter(org.omegat.filters2.IFilter) MagentoFilter(org.omegat.filters2.text.magento.MagentoFilter) IAlignCallback(org.omegat.filters2.IAlignCallback) Test(org.junit.Test)

Example 2 with MagentoFilter

use of org.omegat.filters2.text.magento.MagentoFilter in project omegat by omegat-org.

the class MagentoFilterTest method testParse.

@Test
public void testParse() throws Exception {
    List<String> entries = parse(new MagentoFilter(), "test/data/filters/magento/MagentoFilter.csv");
    assertEquals(5, entries.size());
    int i = 0;
    assertEquals("Tr: %s", entries.get(i++));
    assertEquals("Tr: There are <a href=\"\"%s\"\">%s items</a> in your cart.", entries.get(i++));
    assertEquals("Tr: Separate by \"\",\"\".", entries.get(i++));
    assertEquals("Tr: After selecting a new media storage location, press the Synchronize button", entries.get(i++));
    assertEquals("Tr: The reader repaired", entries.get(i++));
}
Also used : MagentoFilter(org.omegat.filters2.text.magento.MagentoFilter) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 MagentoFilter (org.omegat.filters2.text.magento.MagentoFilter)2 IAlignCallback (org.omegat.filters2.IAlignCallback)1 IFilter (org.omegat.filters2.IFilter)1