Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env ruby
$: << ENV['TM_SUPPORT_PATH'] + '/lib'
require 'escape'
def esc(str)
e_sn(str).gsub(/\}/, '\\}').gsub(/"/, '\\\\"')
end
s = STDIN.read
if ENV.has_key? 'TM_SELECTED_TEXT'
print "${1:{{ __(\"#{esc s}\") \\}\\}}"
else
print "{{ __(\"#{e_sn s}\") }}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.