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
en: | |
activerecord: | |
errors: | |
full_messages: | |
format: "%{attribute} %{message}" | |
messages: | |
accepted: must be accepted | |
blank: can't be blank | |
confirmation: doesn't match confirmation | |
empty: can't be empty |
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
curl -v -F convert_to=Strings -F [email protected] https:/converter.webtranslateit.com/converter |
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
// At the end of your layouts/application.html.haml file, convert the YAML Hash to a JS Hash: | |
:javascript | |
window.I18n = #{sanitize(js_translations.to_json)} |
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
<?php | |
// Converts a language file from one format to another using the WebTranslateIt converter | |
// http://converter.webtranslateit.com | |
// A ruby version can be found here: https://gist.github.com/edouard/093025ce172d266cc74fa7ab22349878 | |
// initialize the curl request | |
$request = curl_init("http:/converter.webtranslateit.com/converter"); | |
// send a file | |
curl_setopt($request, CURLOPT_POST, true); |
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/proj_pvt_wL2h87YRMpKLXa8OYdnXAw/strings/15452121/locales/en/translations", {"Content-Type" => "application/json" }) | |
request.body = { "text" => { "one" => "one text", "other" => "other text"} }.to_json | |
response = http.request(request) |
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) |
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
# Converts a language file from one format to another using the WebTranslateIt converter | |
# http://converter.webtranslateit.com | |
# A PHP version can be found here: https://gist.github.com/edouard/55a05bc4842da12f5074ab8286e77506 | |
# gem install 'multipart-post' | |
require 'net/http/post/multipart' | |
converter = "Yml" | |
path = "path/to/your/file.resx" |
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" | |
api_key = "your_api_key" | |
WebTranslateIt::Connection.new(api_key) do | |
WebTranslateIt::String.find_all({ key: "key_name" }).each do |string| | |
puts "key: #{string.key}" | |
puts "FR value: #{string.translation_for("fr")}" | |
end |
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
############################################################################### | |
# JSON file "null" to empty string converter | |
# For use with WebTranslateIt and Google Chrome extension i18n files | |
# -WTI will spit out unproofread segments as "null" (without quotes), but | |
# Chrome needs missing segments to be empty strings | |
# -Replace "null" with an empty string so that the target files can still be | |
# properly marked as unproofread in the WTI UI |
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
en: | |
country: | |
es: Spain | |
no: "Norway (doesn’t work)" | |
"no": Norway |
NewerOlder