Sha256: fb2fbef4360a3d32e04b68ca30b07d67378b881a2f61451eb9968abccca9db4d
Contents?: true
Size: 480 Bytes
Versions: 7
Compression:
Stored size: 480 Bytes
Contents
# -*- encoding : utf-8 -*- module AbAdmin module I18nTools class TranslateApp def self.call(env) if env['warden'].user params = Rack::Request.new(env).params body = {:text => AbAdmin::I18nTools::GoogleTranslate.t(params['q'], params['from'], params['to'])} [200, {'Content-Type' => 'application/json'}, body.to_json] else [401, {'Content-Type' => 'application/json'}, ''] end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems