Last active
November 28, 2018 14:13
-
-
Save itarato/be77d1751e56668c8a93c82162296cfc to your computer and use it in GitHub Desktop.
Translation finder
This file contains hidden or 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
# USAGE: ruby PATH_TO_SCRIPT/translation.rb "TOKEN_TO_TRANSLATE" | |
require 'yaml' | |
LANG = 'en' | |
subject = ARGV[0].split('.') | |
`find . -name '#{LANG}.yml'` | |
.lines | |
.map { |line| YAML.load(IO.read(line.strip))[LANG] } | |
.each do |translation| | |
res = translation.dig(*subject) | |
puts res if res | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment