Created
July 30, 2012 09:29
-
-
Save venj/3205856 to your computer and use it in GitHub Desktop.
Process language string file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
f = open ARGV[0] | |
o = open "out.strings", "w+" | |
lines = f.readlines | |
lines.each_slice(3) do |para| | |
regex = /\/\* (.*) \*\//i | |
chn = para[0].strip.match(regex)[1] | |
i = para[1].index("=") + 1 | |
trans = para[1].strip[0..i] + '"' + chn + '";' | |
o.puts para[0].strip | |
o.puts trans | |
o.puts | |
end | |
f.close | |
o.close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment