Created
December 26, 2017 13:28
-
-
Save edouard/b55f733a7e4bec141b41c8af2fa21ad8 to your computer and use it in GitHub Desktop.
Create a plural segment on WebTranslateIt using the API
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
require "net/http" | |
require "json" | |
http = Net::HTTP.new("webtranslateit.com", 443) | |
http.use_ssl = true | |
request = Net::HTTP::Post.new("/api/projects/:api_key/strings", {"Content-Type" => "application/json" }) | |
request.body = { "key" => "test_plural", "plural" => true, "translations" => [ { "locale" => "en", "text" => { "one" => "dksjdksjd", "other" => "dksjdskdj"} }] }.to_json | |
response = http.request(request) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment