Sha256: af9457b57a92f94f62a262b63b13d22952e1f971246e9e864fa1b177b720cffd
Contents?: true
Size: 603 Bytes
Versions: 9
Compression:
Stored size: 603 Bytes
Contents
#encoding: UTF-8 module Termit class UrlConstructor Host = "http://translate.google.com" def initialize options @options = options end def url if @options[:talk] construct_sound_url else construct_text_url end end private def construct_text_url "#{Host}/translate_a/t?client=t&sl=#{@options[:source_lang]}&tl=#{@options[:target_lang]}&hl=pl&sc=2&ie=UTF-8&oe=UTF-8&prev=enter&ssel=0&tsel=0&" end def construct_sound_url "#{Host}/translate_tts?tl=#{@options[:target_lang]}&ie=UTF-8&oe=UTF-8" end end end
Version data entries
9 entries across 9 versions & 1 rubygems