Created
July 18, 2013 07:05
-
-
Save nacyot/6027265 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
모든 ascii 코드로 이루어진 segment의 소스를 타겟에 복사하는 스크립트.
일본어 문서 번역시 프로그래밍 관련 소스 코드를 자동적으로 translated segment로 만들기 위해서 사용)