Skip to content

Instantly share code, notes, and snippets.

@kasajei
Created May 17, 2013 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kasajei/5597264 to your computer and use it in GitHub Desktop.
Save kasajei/5597264 to your computer and use it in GitHub Desktop.
# encoding:utf-8
require "csv"
require "kconv"
# please set defaults language folder
localizedFolderName = "ja.lproj"
File::open(localizedFolderName + "/Localizable.strings") do |f|
CSV.open("localizable.csv","w") do |csv|
csv << ["key","ja","en","for system →",'=""""&$A1&""""&"="&""""&B1&""";"']
keyAry = []
f.each do |line|
if /^"/ =~ line
lineAry = line.split("\"")
cell = []
cell << lineAry[1].tosjis
cell << lineAry[3].tosjis
csv << cell
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment