Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * #Purpose: Replace current target with tag-free source
- * #Details: http: // wp.me/p3fHEs-4W
- *
- * @author Kos Ivantsov
- * @date 2013-06-26
- * @version 0.1
- */
- import static javax.swing.JOptionPane.*
- import static org.omegat.util.Platform.*
- // abort if a project is not opened yet
- def prop = project.projectProperties
- if (!prop) {
- final def title = 'Replace with Source (no tags)'
- final def msg = 'Please try again after you open a project.'
- showMessageDialog null, msg, title, INFORMATION_MESSAGE
- return
- }
- def stext = editor.currentEntry.getSrcText().replaceAll(/<\/?[a-z]+[0-9]* ?\/?>/, '')
- editor.replaceEditText(stext)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement