use of org.omegat.filters2.text.bundles.ResourceBundleFilter in project omegat by omegat-org.
the class ResourceBundleFilterTest method testNOI18N.
@Test
public void testNOI18N() throws Exception {
String f = "test/data/filters/resourceBundle/file-ResourceBundleFilter-NOI18N.properties";
ResourceBundleFilter filter = new ResourceBundleFilter();
IProject.FileInfo fi = loadSourceFiles(filter, f);
checkMultiStart(fi, f);
checkMulti("Value", "ID", null, null, null, null);
checkMultiEnd();
translateText(filter, f);
}
use of org.omegat.filters2.text.bundles.ResourceBundleFilter in project omegat by omegat-org.
the class ResourceBundleFilterTest method testAlign.
@Test
public void testAlign() throws Exception {
final AlignResult ar = new AlignResult();
align(new ResourceBundleFilter(), "resourceBundle/file-ResourceBundleFilter.properties", "resourceBundle/file-ResourceBundleFilter_be.properties", new IAlignCallback() {
public void addTranslation(String id, String source, String translation, boolean isFuzzy, String path, IFilter filter) {
ar.found = id.equals("ID") && source.equals("Value") && translation.equals("test");
}
});
assertTrue(ar.found);
}
use of org.omegat.filters2.text.bundles.ResourceBundleFilter in project omegat by omegat-org.
the class ResourceBundleFilterTest method testCommentEscaping.
@Test
public void testCommentEscaping() throws Exception {
String f = "test/data/filters/resourceBundle/file-ResourceBundleFilter-Comments.properties";
ResourceBundleFilter filter = new ResourceBundleFilter();
IProject.FileInfo fi = loadSourceFiles(filter, f);
checkMultiStart(fi, f);
checkMulti("Value", "ID", null, null, null, "# Foo\\");
checkMultiEnd();
translateText(filter, f);
}
use of org.omegat.filters2.text.bundles.ResourceBundleFilter in project omegat by omegat-org.
the class TmxComplianceTests method testExport1C.
/**
* Test Export1C - Java Properties
*/
@Test
public void testExport1C() throws Exception {
File tmxFile = new File("test/data/tmx/TMXComplianceKit/ExportTest1C.tmx");
File sourceFile = new File("test/data/tmx/TMXComplianceKit/ExportTest1C.properties");
File translatedFile = new File("test/data/tmx/TMXComplianceKit/ExportTest1C_fr.properties");
ProjectProperties props = new TestProjectProperties("EN-US", "FR-CA");
align(new ResourceBundleFilter(), sourceFile, null, translatedFile, null, props);
compareTMX(tmxFile, outFile, 6);
}
use of org.omegat.filters2.text.bundles.ResourceBundleFilter in project omegat by omegat-org.
the class ResourceBundleFilterTest method testDoNotEscapeUnicodeLiterals.
@Test
public void testDoNotEscapeUnicodeLiterals() throws Exception {
String f = "test/data/filters/resourceBundle/file-ResourceBundleFilter-UnicodeLiterals.properties";
ResourceBundleFilter filter = new ResourceBundleFilter();
Map<String, String> options = new HashMap<String, String>();
options.put(ResourceBundleFilter.OPTION_DONT_UNESCAPE_U_LITERALS, "true");
IProject.FileInfo fi = loadSourceFiles(filter, f, options);
checkMultiStart(fi, f);
checkMulti("a\nb\\u0020\\ad", "MU", null, null, null, "# \\u00ad");
checkMultiEnd();
translateText(filter, f, options);
}
Aggregations