Search in sources :

Example 1 with AlignFilePickerController

use of org.omegat.gui.align.AlignFilePickerController in project omegat by omegat-org.

the class MainWindowMenuHandler method toolsAlignFilesMenuItemActionPerformed.

public void toolsAlignFilesMenuItemActionPerformed() {
    AlignFilePickerController picker = new AlignFilePickerController();
    if (Core.getProject().isProjectLoaded()) {
        String srcRoot = Core.getProject().getProjectProperties().getSourceRoot();
        String curFile = Core.getEditor().getCurrentFile();
        if (curFile != null) {
            picker.setSourceFile(srcRoot + curFile);
        }
        picker.setSourceDefaultDir(srcRoot);
        picker.setDefaultSaveDir(Core.getProject().getProjectProperties().getTMRoot());
        picker.setSourceLanguage(Core.getProject().getProjectProperties().getSourceLanguage());
        picker.setTargetLanguage(Core.getProject().getProjectProperties().getTargetLanguage());
    } else {
        String srcLang = Preferences.getPreference(Preferences.SOURCE_LOCALE);
        if (!StringUtil.isEmpty(srcLang)) {
            picker.setSourceLanguage(new Language(srcLang));
        }
        String trgLang = Preferences.getPreference(Preferences.TARGET_LOCALE);
        if (!StringUtil.isEmpty(trgLang)) {
            picker.setTargetLanguage(new Language(trgLang));
        }
    }
    picker.show(mainWindow);
}
Also used : AlignFilePickerController(org.omegat.gui.align.AlignFilePickerController) Language(org.omegat.util.Language) NearString(org.omegat.core.matching.NearString)

Aggregations

NearString (org.omegat.core.matching.NearString)1 AlignFilePickerController (org.omegat.gui.align.AlignFilePickerController)1 Language (org.omegat.util.Language)1