Skip to content

Instantly share code, notes, and snippets.

View kosivantsov's full-sized avatar
💭
Not even trying to work...

Kos Ivantsov kosivantsov

💭
Not even trying to work...
View GitHub Profile
@yu-tang
yu-tang / adapt_tags_to_match_target.groovy
Last active July 10, 2017 20:57
adapt_tags_to_match_target.groovy
/* :name=Adapt standard tags :description=Adapt standard tags when Replace with Match command invoked
*
* The workaround by script for RFE #841:
* Adapt tags to match target
* http://sourceforge.net/p/omegat/feature-requests/841/
*
* | Editor | Match
* -------+--------------+--------------
* Source | <a1>foo</a1> | <a9>foo</a9>
* -------+--------------+--------------
@yu-tang
yu-tang / enumFilteredSegments.groovy
Last active November 19, 2015 20:16
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)