use of org.omegat.core.data.NotLoadedProject in project omegat by omegat-org.
the class GlossaryReaderTBXTest method testRead.
@Test
public void testRead() throws Exception {
Core.setProject(new NotLoadedProject() {
public ProjectProperties getProjectProperties() {
try {
return new ProjectProperties(new File("stub")) {
@Override
public Language getSourceLanguage() {
return new Language("en");
}
@Override
public Language getTargetLanguage() {
return new Language("hu");
}
};
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}
});
List<GlossaryEntry> g = GlossaryReaderTBX.read(new File("test/data/glossaries/sampleTBXfile.tbx"), false);
assertEquals(1, g.size());
assertEquals("alpha smoothing factor", g.get(0).getSrcText());
assertEquals("hu translation", g.get(0).getLocText());
}
use of org.omegat.core.data.NotLoadedProject in project omegat by omegat-org.
the class Core method initializeGUI.
/**
* Initialize application components.
*/
public static void initializeGUI(ClassLoader classLoader, final Map<String, String> params) throws Exception {
cmdLineParams = params;
// 1. Initialize project
currentProject = new NotLoadedProject();
// 2. Initialize theme
UIDesignManager.initialize(classLoader);
// 3. Initialize application frame
MainWindow me = new MainWindow();
mainWindow = me;
Core.registerMarker(new ProtectedPartsMarker());
Core.registerMarker(new RemoveTagMarker());
Core.registerMarker(new NBSPMarker());
Core.registerMarker(new TransTipsMarker());
Core.registerMarker(new WhitespaceMarkerFactory.SpaceMarker());
Core.registerMarker(new WhitespaceMarkerFactory.TabMarker());
Core.registerMarker(new WhitespaceMarkerFactory.LFMarker());
Core.registerMarker(new BidiMarkers());
Core.registerMarker(new ReplaceMarker());
Core.registerMarker(new ComesFromAutoTMMarker());
Core.registerMarker(new FontFallbackMarker());
LanguageToolWrapper.init();
segmenter = new Segmenter(Preferences.getSRX());
filterMaster = new FilterMaster(Preferences.getFilters());
// 4. Initialize other components. They add themselves to the main window.
editor = new EditorController(me);
tagValidation = new TagValidationTool();
issuesWindow = new IssuesPanelController(me);
matcher = new MatchesTextArea(me);
GlossaryTextArea glossaryArea = new GlossaryTextArea(me);
glossary = glossaryArea;
glossaryManager = new GlossaryManager(glossaryArea);
notes = new NotesTextArea(me);
comments = new CommentsTextArea(me);
machineTranslatePane = new MachineTranslateTextArea(me);
dictionaries = new DictionariesTextArea(me);
spellChecker = new SpellChecker();
multiple = new MultipleTransPane(me);
new SegmentPropertiesArea(me);
SaveThread th = new SaveThread();
saveThread = th;
th.start();
new VersionCheckThread(10).start();
}
Aggregations