Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* :name = Convert Numbers (Western to Arabic-Indic) :description=Transliterates any Western digit, if found, to its Arabic-Indic counterpart
- * @author Manuel Souto Pico
- * @date 2019-05-07
- * @version 0.0.1
- */
- def gui(){
- def segm_count = 0
- def pattern;
- pattern = /[0-9]/
- project.allEntries.each { ste ->
- def target = project.getTranslationInfo(ste) ? project.getTranslationInfo(ste).translation : null;
- if (target.find(pattern) != null)
- {
- segm_count++
- editor.gotoEntry(ste.entryNum())
- def repl = target.tr('0123456789', '٠١٢٣٤٥٦٧٨٩')
- console.println(ste.entryNum() + "\t" + target + " => " + repl)
- editor.replaceEditText(repl)
- }
- }
- console.println(segm_count + " segments modified")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement