<%= # UTF-8 (Fix for Sprockets UTF-8 AutoDetect: รก) locale_directory = "#{File.expand_path(File.dirname(__FILE__))}/locale" files = Dir.glob("#{locale_directory}/*.json") content = "var AVAILABLE_LOCALES = Array();\r\n" files.each do |filename| language_name = File.basename(filename, ".json") contents = File.open(filename,"r:UTF-8").read content += "AVAILABLE_LOCALES['#{language_name}'] = #{contents}\r\n" end content %>