in lib/twitter_cldr/resources/language_codes_importer.rb [109:139]
def import_bcp_47(result = {})
File.open(source_path_for(BCP_47_FILE)) do |file|
lines = file.each_line
lines.next
data = {}
entry = ''
lines.each do |line|
line.chomp!
if line == '%%'
process_bcp_47_entry(entry, data)
process_bcp_47_data(data, result)
else
if line.include?(':')
process_bcp_47_entry(entry, data)
entry = line
else
entry += line
end
end
end
process_bcp_47_entry(entry, data)
process_bcp_47_data(data, result)
end
result
end