]> git.openstreetmap.org Git - rails.git/blobdiff - script/locale/yaml2po
Merge remote-tracking branch 'upstream/pull/4753'
[rails.git] / script / locale / yaml2po
diff --git a/script/locale/yaml2po b/script/locale/yaml2po
deleted file mode 100755 (executable)
index 1837b06..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env ruby
-# yaml2po, for converting RoR translation YAML to the standard gettext
-#          for eventual use with a translation site such as Transifex
-# Use:
-#  - To create a 'master' .pot
-#    yaml2po > translations.pot
-#  - To create a language's .po from scratch
-#    yaml2po > de.po
-#  - To create a partucular language's .po from existing translations
-#    yaml2po de > de.po
-
-require "yaml"
-
-LOCALE_DIR = File.dirname(__FILE__) + '/../../config/locales/'
-
-def iterate(hash, fhash={}, path='')
-  hash.each {|key, val|
-    unless fhash.has_key? key
-     fhash[key] = {}
-    end
-    if val.is_a? Hash
-      iterate(val, fhash[key], path+key+':')
-    else
-      puts "msgctxt \"#{path}#{key}\""
-      puts "msgid \"#{val}\""
-      puts "msgstr \"#{fhash[key]}\""
-    end
-  }
-end
-
-language = ARGV[0]
-oth = {}
-if language
-  oth = YAML::load_file(LOCALE_DIR+language+'.yml')
-  oth = oth[language]
-end
-
-en = YAML::load_file(LOCALE_DIR+'en.yml')
-iterate(en['en'], oth)