diff options
author | Jochen Topf <jochen@topf.org> | 2014-09-05 13:51:31 +0200 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2014-09-05 13:51:31 +0200 |
commit | 64e47592b0ea6de3660e60b9d6875eb028cfef35 (patch) | |
tree | 4b7b34f738e2c67d877543eb756878c35cf85dc1 /bin | |
parent | af129af70f5a49bf3cee0d5278a3938f3533b458 (diff) | |
download | taginfo-64e47592b0ea6de3660e60b9d6875eb028cfef35.tar taginfo-64e47592b0ea6de3660e60b9d6875eb028cfef35.tar.gz |
Extent check-translations script to better find missing translations.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/check-translations.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bin/check-translations.rb b/bin/check-translations.rb index 9f76638..16e9b28 100755 --- a/bin/check-translations.rb +++ b/bin/check-translations.rb @@ -19,6 +19,20 @@ lang = ARGV[1] i18n_en = YAML.load_file("#{dir}/en.yml") i18n_lang = YAML.load_file("#{dir}/#{lang}.yml") +def look_for_error(path, data) + if data.nil? + puts "No data for #{path.sub(/^\./, '')}" + return true + elsif data.class == Hash + data.keys.sort.each do |key| + if look_for_error(path + '.' + key, data[key]) + return true + end + end + end + return false +end + def walk(path, en, other) en.keys.sort.each do |key| name = path.sub(/^\./, '') + '.' + key @@ -37,5 +51,10 @@ def walk(path, en, other) end end + +if look_for_error('', i18n_lang) + exit 1 +end + walk('', i18n_en, i18n_lang) |