Sha256: fd2f6386ac29e593de317fc227a3108610b0034634e2cc298c4deeb4f5270da1
Contents?: true
Size: 450 Bytes
Versions: 8
Compression:
Stored size: 450 Bytes
Contents
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
8 entries across 8 versions & 1 rubygems