use of net.heartsome.cat.ts.test.ui.dialogs.TS in project translationstudio8 by heartsome.
the class TestDemos method TestFile2.
@Ignore
@Test
public void TestFile2() {
// String filePath = "E:\\My Documents\\junit-workspace\\prjBot-001\\XLIFF\\HSCAT8-3.xlf";
// String filePath = "/home/felix/junit-workspace/prjBot-001/XLIFF/HSCAT8-3.xlf";
String filePath = "/Users/felix_lu/bin/ts.cocoa.macosx.x86_64/Eclipse.app/Contents/MacOS/workspace/testProject/XLIFF/HSCAT8-83.xlf";
TS ts = TS.getInstance();
ts.menuFileOpenFile().click();
OpenFileDialog.openFile(filePath, true, true);
List<String[]> langPairs = XliffUtil.getAllLangPairs(filePath);
for (String[] langPair : langPairs) {
System.err.println(langPair[0] + " -> " + langPair[1] + ": " + XliffUtil.tuCountOfLangPair(filePath, langPair[0], langPair[1], false));
}
}
use of net.heartsome.cat.ts.test.ui.dialogs.TS in project translationstudio8 by heartsome.
the class TestDemos method TestFile.
@Ignore
@Test
public void TestFile() {
String fileName = "HSCAT8-83.xlf";
ProjectTreeItem pTN = ProjectTreeItem.getInstance(prjName);
pTN.ctxMenuOpenFile(fileName);
TS ts = TS.getInstance();
XlfEditor xe = ts.getXlfEditor(fileName);
int segNum = 2;
xe.gotoSeg(segNum);
String rowID = xe.rowIdOfSegNum(segNum);
XliffUtil xu = new XliffUtil(rowID);
assertTrue(!xu.tuIsApproved());
xe.clickContextMenu(xe.ctxMenuApproveStatus(), xe.ctxMenuapproveStatusApproveCurrentSeg());
xu = new XliffUtil(rowID);
assertTrue(xu.tuIsApproved());
}
use of net.heartsome.cat.ts.test.ui.dialogs.TS in project translationstudio8 by heartsome.
the class TestDemos method TestProject.
@Ignore
@Test
public void TestProject() {
// String fileName = "temp.xlf";
String srcLang = "en-US";
String tgtLang = "zh-CN";
// String icon = "E:\\temp\\imgs\\LineNumber.png";
// String menuText = "设置文本段批准状态";
ProjectTreeItem pTN = ProjectTreeItem.getInstance(prjName);
pTN.ctxMenuOpenProjectFiles();
// String filePath = "D:\\Temp\\ts.win32.win32.x86\\workspace\\prjBot-001\\XLIFF\\temp.xlf";
// String fileName = new Path(filePath).lastSegment();
TS ts = TS.getInstance();
// ts.menuFileOpenFile().click();
// OpenFileDialog.openFile(filePath);
XlfEditor xe = ts.getXlfEditor(prjName);
xe.selectLangPair(srcLang, tgtLang);
xe.changeEditorLayout();
xe.selectSourceCell(4);
System.out.println(xe.rowIdOfSelectedSeg());
// String filePath = "D:\\Temp\\TestExcel.xls";
// String column = "password";
// ExcelUtil exl = new ExcelUtil(filePath);
// System.err.println(exl.getNextText(column));
// XLIFFUtil xu = new XLIFFUtil(filePath);
// System.err.println(xu.getSouceLang());
// System.err.println(xu.getTargetLang());
}