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