Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Enumerate filtered segments.
console.println 'Enumerate filtered segments.'
def entries = project.allEntries
def filter = editor.filter ?: [allowed: {true}]
def found = entries.findAll { filter.allowed it }
// Do something for each SourceTextEntry here
found.each {
// get translation info
def info = project.getTranslationInfo(it)
console.println "\n#${it.entryNum()}\t${it.srcText}"
console.println "\t${info.translation}"
console.println info.defaultTranslation ? '\t- Default' : "\t- Alternative\n\t $it.key" // key has more detail
"${found.size()} segments found."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment