Skip to content

Instantly share code, notes, and snippets.

@xbony2
Created October 24, 2017 17:47
Show Gist options
  • Save xbony2/db3c5efe0af6f826dc75f0f9e1e471f2 to your computer and use it in GitHub Desktop.
Save xbony2/db3c5efe0af6f826dc75f0f9e1e471f2 to your computer and use it in GitHub Desktop.
# Used to crawl Minecraft's index files and generate a list of languages that it supports.
file = "1.12.json" # Feel free to change this to whatever
languages = []
File.open(file, "r").each do |line|
test_match = line.match(/"minecraft\/lang\/(.+)\.lang": {/)
next if test_match.nil?
languages << test_match[1]
end
languages.sort!
languages.each do |language|
puts language
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment