Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

extract strings from m's and xib's

View gist:1828817
1 2 3 4 5
#!/bin/sh
 
find . -name *.xib | xargs ruby -ne '$_.match(/<string key="(.*)">(.*)<\/string>/){|m|puts "\"#{m[2]}\" = \"#{m[2]}\";" if m[1] =~ /IB.*Title/}'
find . -name *.m | xargs ruby -ne '$_.scan(/NSLocalizedString\s*\(\s*@"([^"]*)"\s*,[^)]*\)/){|m|puts "\"#{m[0]}\" = \"#{m[0]}\";"}'
find . -name *.m | xargs ruby -ne '$_.scan(/__\(\s*@"([^"]*)"\s*\)/){|m|puts "\"#{m[0]}\" = \"#{m[0]}\";"}'
Owner
find . -name *.m | xargs ruby -ne '$_.scan(/__\(\s*@"([^"]*)"\s*\)/){|m|puts "\"#{m[0]}\" = \"#{m[0]}\""}'
find . -name *.m | xargs ruby -ne '$_.scan(/NSLocalizedString\s*\(\s*@"([^"]*)"\s*,[^)]*\)/){|m|puts "\"#{m[0]}\" = \"#{m[0]}\""}'

.scan is used instead of .match so it matches multiple times in a single line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.