Skip to content

Instantly share code, notes, and snippets.

@nacyot
Created July 18, 2013 07:05
Show Gist options
  • Save nacyot/6027265 to your computer and use it in GitHub Desktop.
Save nacyot/6027265 to your computer and use it in GitHub Desktop.
/*
* Ascii segment source to target
*
* @author nacyot
* @date 2013-07-18
* @version 0.01
*/
console.println("OmegaT Script Test.\n");
def count = 0
project.allEntries.each { ste ->
source = ste.getSrcText();
target = project.getTranslationInfo(ste) ? project.getTranslationInfo(ste).translation : null;
if ( source ==~ /[[\x00-\x7F]\n]*/ && target == null){
editor.gotoEntry(ste.entryNum())
editor.replaceEditText(source)
console.println(ste.entryNum() + "\t" + ste.srcText + "\t" )
count = count + 1
}
}
console.println("Complete: " + count + " segments");
@nacyot
Copy link
Author

nacyot commented Jul 18, 2013

모든 ascii 코드로 이루어진 segment의 소스를 타겟에 복사하는 스크립트.

일본어 문서 번역시 프로그래밍 관련 소스 코드를 자동적으로 translated segment로 만들기 위해서 사용)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment