Created
August 8, 2012 07:17
-
-
Save edouard/3293057 to your computer and use it in GitHub Desktop.
Output a WebTranslateIt project’s translations to a .yml file
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
# before using: gem install web_translate_it | |
require 'web_translate_it' | |
file = File.new("fr.yml", "w") | |
file.puts "fr:\n" | |
WebTranslateIt::Connection.new('api_key') do | |
puts "Fetching all strings in project..." | |
WebTranslateIt::String.find_all.each do |string| | |
puts string.key | |
translation = string.translation_for("fr") | |
file.puts " #{string.key}: \"#{translation.text}\"\n" | |
end | |
end | |
file.close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment