Remove unused `discourse_imgur` plugin.
This commit is contained in:
parent
a338a7a53e
commit
6af40a6ade
|
@ -26,12 +26,6 @@ source_file = plugins/poll/config/locales/server.en.yml
|
|||
source_lang = en
|
||||
type = YML
|
||||
|
||||
[discourse-org.imgurserverenyml]
|
||||
file_filter = vendor/gems/discourse_imgur/lib/discourse_imgur/locale/server.<lang>.yml
|
||||
source_file = vendor/gems/discourse_imgur/lib/discourse_imgur/locale/server.en.yml
|
||||
source_lang = en
|
||||
type = YML
|
||||
|
||||
[discourse-org.narrativeclientenyml]
|
||||
file_filter = plugins/discourse-narrative-bot/config/locales/client.<lang>.yml
|
||||
source_file = plugins/discourse-narrative-bot/config/locales/client.en.yml
|
||||
|
|
|
@ -439,7 +439,6 @@
|
|||
test/javascripts/models/post-stream-test.js.es6 | 2 +-
|
||||
test/javascripts/test_helper.js | 3 +
|
||||
test/stylesheets/test_helper.css | 8 +
|
||||
.../lib/discourse_imgur/locale/server.ar.yml | 4 +-
|
||||
vendor/gems/rails_multisite/.gitignore | 17 -
|
||||
vendor/gems/rails_multisite/Gemfile | 14 -
|
||||
vendor/gems/rails_multisite/Guardfile | 9 -
|
||||
|
|
|
@ -62,8 +62,7 @@ END
|
|||
|
||||
YML_DIRS = ['config/locales',
|
||||
'plugins/poll/config/locales',
|
||||
'plugins/discourse-narrative-bot/config/locales',
|
||||
'vendor/gems/discourse_imgur/lib/discourse_imgur/locale']
|
||||
'plugins/discourse-narrative-bot/config/locales']
|
||||
YML_FILE_PREFIXES = ['server', 'client']
|
||||
|
||||
def yml_path(dir, prefix, language)
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
source 'https://rubygems.org'
|
||||
|
||||
group :test do
|
||||
gem 'rails'
|
||||
gem 'rspec'
|
||||
gem 'mocha'
|
||||
end
|
||||
|
||||
# TODO: We need our own gem server
|
||||
gem 'discourse_plugin', path: '../discourse_plugin'
|
||||
|
||||
# Specify your gem's dependencies in rails_multisite.gemspec
|
||||
gemspec
|
|
@ -1,22 +0,0 @@
|
|||
Copyright (c) 2013 Régis Hanol
|
||||
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -1,3 +0,0 @@
|
|||
# DiscourseImgur
|
||||
|
||||
Add support for Imgur storage
|
|
@ -1,7 +0,0 @@
|
|||
#!/usr/bin/env rake
|
||||
require "bundler/gem_tasks"
|
||||
require "rspec/core/rake_task"
|
||||
|
||||
RSpec::Core::RakeTask.new(:test) do |spec|
|
||||
spec.pattern = 'spec/*_spec.rb'
|
||||
end
|
|
@ -1,23 +0,0 @@
|
|||
# coding: utf-8
|
||||
lib = File.expand_path('../lib', __FILE__)
|
||||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
||||
require 'discourse_imgur/version'
|
||||
|
||||
Gem::Specification.new do |spec|
|
||||
spec.name = "discourse_imgur"
|
||||
spec.version = DiscourseImgur::VERSION
|
||||
spec.authors = ["Régis Hanol"]
|
||||
spec.email = ["regis@hanol.fr"]
|
||||
spec.description = %q{Add support for Imgur}
|
||||
spec.summary = %q{Add support for Imgur}
|
||||
spec.homepage = ""
|
||||
spec.license = "MIT"
|
||||
|
||||
spec.files = `git ls-files`.split($/)
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_development_dependency "bundler", "~> 1.3"
|
||||
spec.add_development_dependency "rake"
|
||||
end
|
|
@ -1,2 +0,0 @@
|
|||
require "discourse_imgur/version"
|
||||
require 'discourse_imgur/engine' if defined?(Rails) && (!Rails.env.test?)
|
|
@ -1,19 +0,0 @@
|
|||
require 'discourse_imgur/plugin'
|
||||
|
||||
module DiscourseImgur
|
||||
|
||||
class Engine < Rails::Engine
|
||||
|
||||
engine_name 'discourse_imgur'
|
||||
|
||||
initializer "discourse_imgur.configure_rails_initialization" do |app|
|
||||
|
||||
app.config.after_initialize do
|
||||
DiscoursePluginRegistry.setup(DiscourseImgur::Plugin)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
|
@ -1,28 +0,0 @@
|
|||
# /!\ WARNING /!\
|
||||
# This plugin has been extracted from the Discourse source code and has not been tested.
|
||||
# It really needs some love <3
|
||||
# /!\ WARNING /!\
|
||||
|
||||
|
||||
module Imgur
|
||||
|
||||
def self.store_file(file, image_info, upload_id)
|
||||
raise Discourse::SiteSettingMissing.new("imgur_endpoint") if SiteSetting.imgur_endpoint.blank?
|
||||
raise Discourse::SiteSettingMissing.new("imgur_client_id") if SiteSetting.imgur_client_id.blank?
|
||||
|
||||
@imgur_loaded = require 'imgur' unless @imgur_loaded
|
||||
|
||||
blob = file.read
|
||||
|
||||
response = Excon.post(SiteSetting.imgur_endpoint,
|
||||
body: { image: Base64.encode64(blob) },
|
||||
headers: { 'Authorization' => "ClientID #{SiteSetting.imgur_client_id}" }
|
||||
)
|
||||
|
||||
json = JSON.parse(response.body)['data'] rescue nil
|
||||
|
||||
return nil if json.blank?
|
||||
return json['link']
|
||||
end
|
||||
|
||||
end
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
ar:
|
||||
site_settings:
|
||||
enable_imgur: "فعّل واجهة برمجة التطبيقات لموقع Imgur للرفع، لا تستضف الملفات محلّيّا"
|
||||
imgur_client_id: "معرّفك على imgur.com مطلوب لرفع الصور"
|
||||
imgur_client_secret: "سرّ العميل (Client secret) على imgur.com. ليس مطلوبا حاليا لرفع الصور، ولكن قد يكون كذلك لاحقا."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
bs_BA:
|
||||
site_settings:
|
||||
enable_imgur: "Enable imgur api for uploading, don't host files locally"
|
||||
imgur_client_id: "Your imgur.com client ID, required for image upload to function"
|
||||
imgur_client_secret: "Your imgur.com client secret. Not currently required for image upload to function, but may be at some point."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
cs:
|
||||
site_settings:
|
||||
enable_imgur: "Používat imgur pro ukládání obrázků, nehostovat obrázky lokálně"
|
||||
imgur_client_id: "Přístupový klíč 'client ID' pro imgur.com - vyžadováno pro upload obrázků"
|
||||
imgur_client_secret: "Přístupový klíč 'client secret' pro imgur.com - vyžadováno pro upload obrázků"
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
da:
|
||||
site_settings:
|
||||
enable_imgur: "Slå imgur api til for upload, gem ikke filer lokalt"
|
||||
imgur_client_id: "Dit imgur.com klient ID, nødvendigt for billed upload funktionen"
|
||||
imgur_client_secret: "Din imgur.com client secret. ikke nødvendig i øjeblikket for billed upload funktionen, men måske nødvendig i fremtiden."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
de:
|
||||
site_settings:
|
||||
enable_imgur: "Aktiviere die imgur API zum Hochladen, sodass Dateien nicht lokal gehostet werden."
|
||||
imgur_client_id: "Deine imgur.com Client-ID. Diese wird benötigt, um Bilder hochladen zu können."
|
||||
imgur_client_secret: "Dein imgur.com Client-Secret. Dieses wird zurzeit für das Hochladen von Bildern nicht benötigt, könnte aber in Zukunft benötigt werden."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
el:
|
||||
site_settings:
|
||||
enable_imgur: "Να ενεργοποιηθεί το API του imgur για το ανέβασμα εικόνων. Έτσι τα αρχεία δε θα φιλοξενούνται τοπικά στο διακομιστή."
|
||||
imgur_client_id: "Το αναγνωριστικό ID του imgur.com απαιτείται για να λειτουργήσει το ανέβασμα εικόνων."
|
||||
imgur_client_secret: "Ο μυστικός κωδικός για το imgur.com. Δεν απαιτείται για την λειτουργία ανεβάσματος των εικόνων, αλλά μπορεί να χρειαστεί στο μέλλον."
|
|
@ -1,22 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# This file contains content for the server portion of Discourse used by Ruby
|
||||
#
|
||||
# To work with us on translations, see:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
#
|
||||
# This is a "source" file, which is used by Transifex to get translations for other languages.
|
||||
# After this file is changed, it needs to be pushed by a maintainer to Transifex:
|
||||
#
|
||||
# tx push -s
|
||||
#
|
||||
# Read more here: https://meta.discourse.org/t/contribute-a-translation-to-discourse/14882
|
||||
#
|
||||
# To validate this YAML file after you change it, please paste it into
|
||||
# http://yamllint.com/
|
||||
|
||||
en:
|
||||
site_settings:
|
||||
enable_imgur: "Enable imgur api for uploading, don't host files locally"
|
||||
imgur_client_id: "Your imgur.com client ID, required for image upload to function"
|
||||
imgur_client_secret: "Your imgur.com client secret. Not currently required for image upload to function, but may be at some point."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
es:
|
||||
site_settings:
|
||||
enable_imgur: "Activar la api de imgur para subir imágenes, no almacenarlas como archivos en local"
|
||||
imgur_client_id: "Tu ID de cliente en imgur.com - requerido para la función de subida de imágenes"
|
||||
imgur_client_secret: "Tu clave secreta de cliente en imgur.com - actualmente no requerido para la función de subida de imágenes, pero podría requerirse en algún momento"
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
et:
|
||||
site_settings:
|
||||
enable_imgur: "Luba imgur api üleslaadimiseks, ära hoia faile lokaalselt"
|
||||
imgur_client_id: "Sinu imgur.com kliendi-ID, vaja piltide üleslaadimiseks"
|
||||
imgur_client_secret: "Sinu imgur.com kliendi saladus. Ei ole hetkel vaja piltide üleslaadimise toimimiseks aga võib tulevikus vajalikuks osutuda."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
fa_IR:
|
||||
site_settings:
|
||||
enable_imgur: "API Iimgur را برای بارگذاری فعال کنید. فایل ها را بصورت محلی میزبانی نکنید."
|
||||
imgur_client_id: "شناسه مشتری imgur.com شما٬ برای آپلود تصویر به عملکرد مورد نیاز است "
|
||||
imgur_client_secret: "مقدال client secret خود در سایت imgur.com شاید برای کارکرد آپلود عکس نیاز نباشد، ولی ممکن است برای قسمتهای دیگر نیاز باشد."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
fi:
|
||||
site_settings:
|
||||
enable_imgur: "Lataa kuvat imguriin käyttäen apia, älä tallenna kuvia paikallisesti palvelimelle"
|
||||
imgur_client_id: "Imgur.com client ID, vaaditaan kuvien lataamiseksi"
|
||||
imgur_client_secret: "Client secret -salausavaimesi Imgur.comissa. Ei tällä hetkellä pakollinen kuvien lataamiseksi, mutta saattaa tulla pakolliseksi tulevaisuudessa."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
fr:
|
||||
site_settings:
|
||||
enable_imgur: "Activer l'envoi des images avec l'API imgur, ne stockera pas les fichiers localement"
|
||||
imgur_client_id: "Votre ID client imgur.com, requis pour que l'envoi d'images fonctionne."
|
||||
imgur_client_secret: "Votre secret imgur.com. Pas nécessaire pour que l'envoi d'image fonctionne, mais pourrais le devenir."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
gl:
|
||||
site_settings:
|
||||
enable_imgur: "Activar a api de imgur para enviar, non gardar ficheiros localmente"
|
||||
imgur_client_id: "ID do teu cliente de imgur.com, requirido para que funcione o envío de imaxes"
|
||||
imgur_client_secret: "O teu secreto para o cliente de imgur.com. Non requirido neste intre para enviar imaxes pero quizais posteriormente."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
he:
|
||||
site_settings:
|
||||
enable_imgur: "אפשר להעלות imgur API, אל תאכסן קבצים באופן מקומי."
|
||||
imgur_client_id: "זהות הלקוח (Client ID) שלך ב-imgur.com נדרשת לשם העלאת התמונה."
|
||||
imgur_client_secret: "סיסמת הלקוח (client secret) שלך לא נדרשת כרגע כדי לאפשר העלאת התמונה, אבל עשוייה להידרש בשלב כלשהו בהמשך."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
id:
|
||||
site_settings:
|
||||
enable_imgur: "Aktifkan api imgur untuk pengunggahan, jangan menghost berkas secara lokal"
|
||||
imgur_client_id: "Client ID imgur.com Anda, diperlukan untuk unggah gambar"
|
||||
imgur_client_secret: "Klien imgur.com anda rahasia. Tidak dibutuhkan untuk fungsi mengungggah gambar, tapi bisa juga dibutuhkan pada titik tertentu."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
it:
|
||||
site_settings:
|
||||
enable_imgur: "Utilizza le api imgur per l'upload, non salvare file in locale"
|
||||
imgur_client_id: "Il tuo ID utente imgur.com, necessario affinché funzioni il caricamento immagini"
|
||||
imgur_client_secret: "La tua password imgur.com. Attualmente non richiesta affinché funzioni il caricamento immagini, ma potrebbe esserlo in futuro."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
ja:
|
||||
site_settings:
|
||||
enable_imgur: "アップロードするため、imgur apiを有効にしています、ファイルはローカルにホストされません"
|
||||
imgur_client_id: "画像をアップロードするためには、imgur.comのアカウントが必要です。"
|
||||
imgur_client_secret: "あなたのimgur.comクライアントは秘密です。今は使用されていない画像アップロードに必要です、しかしいずれは必要になるでしょう。"
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
ko:
|
||||
site_settings:
|
||||
enable_imgur: "로컬에 이미지를 저장하지 않고 imgur api를 통해 이미지 업로드 활성화. "
|
||||
imgur_client_id: "이미지 업로드를 위해 imgur.com의 client ID 가 필요합니다."
|
||||
imgur_client_secret: "imgur.com의 클라이언트 secret 키. 현재 이미지 업로드 기능에선 필수가 아니지만 언젠가 필요합니다."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
nb_NO:
|
||||
site_settings:
|
||||
enable_imgur: "Aktiver imgurs API for opplasting, ikke lagre filene lokalt"
|
||||
imgur_client_id: "Din klient-ID for imgur.com, påkrevet for at bildeopplasting skal fungere"
|
||||
imgur_client_secret: "Din client secret for imgur.com. Denne er for øyeblikket ikke påkrevet for opplasting av bilder, men kan bli det i fremtiden."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
nl:
|
||||
site_settings:
|
||||
enable_imgur: "De imgur-API voor uploaden inschakelen, bestanden niet lokaal hosten"
|
||||
imgur_client_id: "Je client-ID voor imgur.com, nodig om afbeeldingen te kunnen uploaden"
|
||||
imgur_client_secret: "Je clientgeheim voor imgur.com. Op dit moment nog niet nodig voor het uploaden van afbeeldingen, mogelijk later wel."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
pl_PL:
|
||||
site_settings:
|
||||
enable_imgur: "Włącz Imgur API, aby przesyłać pliki - nie przechowuj plików lokalnie."
|
||||
imgur_client_id: "Twój \"client_id\" z imgur.com, wymagany przez funkcję przesyłania plików."
|
||||
imgur_client_secret: "Twój parametr \"client_secret\" z Imgur.com. Aktualnie nie wymagany dla funkcji przesyłania obrazów, jednak może stać się wymagany w przyszłości."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
pt:
|
||||
site_settings:
|
||||
enable_imgur: "Ativar a API do imgur para carregamento, não armazenar ficheiros localmente"
|
||||
imgur_client_id: "O seu ID de cliente do imgur.com, necessário para ativar o carregamento de imagens"
|
||||
imgur_client_secret: "A sua chave privada de cliente do imgur.com. Não é necessária de momento para o carregamento de imagens, mas pode vir a ser no futuro."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
pt_BR:
|
||||
site_settings:
|
||||
enable_imgur: "Ligar a api do imgur para upload, para não hospedar arquivos localmente"
|
||||
imgur_client_id: "Seu client ID do imgur.com, necessário para a função de upload de imagem"
|
||||
imgur_client_secret: "Seu client secret do imgur.com. Não é necessário para upload de imagem, mas pode ser em algum momento."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
ro:
|
||||
site_settings:
|
||||
enable_imgur: "Activează API-ul imgur pentru încărcare, nu găzdui fişiere local"
|
||||
imgur_client_id: "ID-ul de client imgur.com este necesar pentru ca încărcarea de imagini să funcționeze"
|
||||
imgur_client_secret: "Cheia secretă de client imgur.com. Nu este necesar în mod curent pentru ca încărcarea de imagini să funcționeze, dar ar putea fi la un moment dat."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
ru:
|
||||
site_settings:
|
||||
enable_imgur: "Загружать картинки на imgur.com с помощью API, чтобы не хранить их локально на своем сервере"
|
||||
imgur_client_id: "ID клиента на imgur.com для загрузки картинок"
|
||||
imgur_client_secret: "Секретный код imgur.com для загрузки картинок. На данном этапе не используется, но может быть задействован со временем."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
sk:
|
||||
site_settings:
|
||||
enable_imgur: "Zapnúť imgur api pre upload, nehostujte súbory lokálne"
|
||||
imgur_client_id: "Vaše imgur.com klientské ID potrebné pre funkčnosť uploadu obrázku"
|
||||
imgur_client_secret: "Váš imgur.com klientský kľúč. Nie je aktuálne potrebný pre funkčnosť uploadu obrázkov, ale je možné že v budúcnosti bude."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
sq:
|
||||
site_settings:
|
||||
enable_imgur: "Aktivizo api-n e imgur për ngarkimin, skedarët nuk mbarten lokalisht"
|
||||
imgur_client_id: "Për ngarkimit e fileve në imgur.com kërkohet ID-ja juaj e klientit"
|
||||
imgur_client_secret: "Kyçi juaj sekret për imgur.com. Nuk është e domosdoshme për ngarkimin e imazheve, por mund të nevojitet në të ardhmen."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
sv:
|
||||
site_settings:
|
||||
enable_imgur: "Använd imgur för uppladdning istället för att spara lokalt"
|
||||
imgur_client_id: "Ditt klient-ID på imgur.com, krävs för uppladdning av bilder ska fungera"
|
||||
imgur_client_secret: "Din klient-hemlighet på imgur.com. Ej obligatorisk för uppladdning av bilder just nu, men kan komma att bli i framtiden."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
te:
|
||||
site_settings:
|
||||
enable_imgur: "దస్త్రాలు స్థానికంగా ఉంచవద్దు. imgur ను చేతనం చేయి"
|
||||
imgur_client_id: "మీ imgur.com క్లైంట్ ఐడీ. బొమ్మ ఎగుమతి ప్రమేయానికి కావాలి."
|
||||
imgur_client_secret: "మీ imgur.com క్లైంట్ రహస్యం. ప్రస్తుతం బొమ్మ ఎగుమతించు ప్రమేయానికి అవసరం లేదు, కానీ భవిష్యత్తులో అవసరం కావచ్చు."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
tr_TR:
|
||||
site_settings:
|
||||
enable_imgur: "Yükleme için imgur api'sini etkinleştirin, dosyaları yerel olarak barındırmayın"
|
||||
imgur_client_id: "Imgur.com kullanıcı ID'niz, fotoğraf yükleme işlevi için gerekli"
|
||||
imgur_client_secret: "Imgur.com kullanıcı anahtarınız. Fotoğraf yükleme işlevi için şu an gerekli değil, ama ileride bazı durumlarda gerekli olabilir."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
uk:
|
||||
site_settings:
|
||||
enable_imgur: "Завантажувати зображення на imgur замість того, щоб зберігати їх локально"
|
||||
imgur_client_id: "Ваше client ID imgur.com. Необхідне для завантаження зображень"
|
||||
imgur_client_secret: "Ваш секретний ключ imgur.com. Зараз його можна не вказувати, але він може знадобитися."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
ur:
|
||||
site_settings:
|
||||
enable_imgur: " اپلوڈنگ کیلئے imgur API فعال کریں، مقامی طور پر فائلوں کو سٹور نہ کریں۔"
|
||||
imgur_client_id: "آپ کی imgur.com کلائنٹ ID، تصویر اّپلوڈ کرنے کے لئے درکار ہے۔"
|
||||
imgur_client_secret: "آپ کا imgur.com کلائنٹ سیکرٹ۔ فی الحالل تصویر اپ لوڈ کرنے کے لئے ضروری نہیں، لیکن مستقبل میں ضرورت پر سکتی ہے۔"
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
vi:
|
||||
site_settings:
|
||||
enable_imgur: "Kích hoạt Imgur API để tải file lên, ảnh của bạn sẽ được lưu trữ bởi dịch vụ của Imgur."
|
||||
imgur_client_id: "Bạn cần Client ID của imgur.com cho chức năng tải file lên."
|
||||
imgur_client_secret: "Client secret của bạn tại imgur.com chưa cần để kích hoạt chức năng tải file lên, nhưng nó sẽ cần trong tương lai khi bạn sử dụng chức năng này."
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
zh_CN:
|
||||
site_settings:
|
||||
enable_imgur: "上传文件到 imgur,不在本地存储"
|
||||
imgur_client_id: "你的 imgur.com client ID,启用图片上传必填"
|
||||
imgur_client_secret: "你的 imgur.com 客户密钥。目前不需要此密钥即可使用上传图片功能,但可能在以后会用到。"
|
|
@ -1,12 +0,0 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Never edit this file. It will be overwritten when translations are pulled from Transifex.
|
||||
#
|
||||
# To work with us on translations, join this project:
|
||||
# https://www.transifex.com/projects/p/discourse-org/
|
||||
|
||||
zh_TW:
|
||||
site_settings:
|
||||
enable_imgur: "啟用 imgur API 來上傳檔案,檔案不保存於伺服器上"
|
||||
imgur_client_id: "你的 imgur.com 的客戶端 ID,以便圖片上傳能正常運作。"
|
||||
imgur_client_secret: "你的 imgur.com 的客戶端 secret。目前圖片上傳功能並不需要這項資訊,但將來可能需要。"
|
|
@ -1,23 +0,0 @@
|
|||
require 'discourse_plugin'
|
||||
|
||||
# /!\ WARNING /!\
|
||||
# This plugin has been extracted from the Discourse source code and has not been tested.
|
||||
# It really needs some love <3
|
||||
# /!\ WARNING /!\
|
||||
|
||||
module DiscourseImgur
|
||||
|
||||
class Plugin < DiscoursePlugin
|
||||
|
||||
def setup
|
||||
# add_setting(:enable_imgur, false)
|
||||
# add_setting(:imgur_client_id, '')
|
||||
# add_setting(:imgur_endpoint, "https://api.imgur.com/3/image.json")
|
||||
|
||||
# TODO: Mix the following logic in Upload#store_file
|
||||
# return Imgur.store_file(file, image_info, upload_id) if SiteSetting.enable_imgur?
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
|
@ -1,3 +0,0 @@
|
|||
module DiscourseImgur
|
||||
VERSION = "0.0.1"
|
||||
end
|
|
@ -1,55 +0,0 @@
|
|||
require 'rails_helper'
|
||||
require_relative 'discourse_imgur/imgur'
|
||||
|
||||
# /!\ WARNING /!\
|
||||
# This plugin has been extracted from the Discourse source code and has not been tested.
|
||||
# It really needs some love <3
|
||||
# /!\ WARNING /!\
|
||||
|
||||
describe Imgur do
|
||||
|
||||
describe "store_file" do
|
||||
|
||||
let(:file) { Rails.root.join('app', 'assets', 'images', 'logo.png') }
|
||||
let(:image_info) { FastImage.new(file) }
|
||||
let(:params) { [SiteSetting.imgur_endpoint, { image: Base64.encode64(file.read) }, { 'Authorization' => "ClientID #{SiteSetting.imgur_client_id}" }] }
|
||||
|
||||
before do
|
||||
SiteSetting.imgur_endpoint = "imgur_endpoint"
|
||||
SiteSetting.imgur_client_id = "imgur_client_id"
|
||||
end
|
||||
|
||||
it 'returns the url of the Imgur upload if successful' do
|
||||
json = {
|
||||
data: {
|
||||
id: 'fake',
|
||||
link: 'http://imgur.com/fake.png',
|
||||
deletehash: 'a3kaoad30'
|
||||
},
|
||||
success: true,
|
||||
status: 200
|
||||
}.to_json
|
||||
|
||||
response = mock
|
||||
response.expects(:body).returns(json)
|
||||
RestClient.expects(:post).with(*params).returns(response)
|
||||
|
||||
Imgur.store_file(file, image_info, 1).should == 'http://imgur.com/fake.png'
|
||||
end
|
||||
|
||||
it 'returns nil if the request fails' do
|
||||
json = {
|
||||
success: false,
|
||||
status: 400
|
||||
}.to_json
|
||||
|
||||
response = mock
|
||||
response.expects(:body).returns(json)
|
||||
RestClient.expects(:post).with(*params).returns(response)
|
||||
|
||||
Imgur.store_file(file, image_info, 1).should be_nil
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
|
@ -1,11 +0,0 @@
|
|||
require 'rubygems'
|
||||
require 'rails'
|
||||
|
||||
ENV["RAILS_ENV"] ||= 'test'
|
||||
|
||||
RSpec.configure do |config|
|
||||
|
||||
config.mock_framework = :mocha
|
||||
config.color_enabled = true
|
||||
|
||||
end
|
Loading…
Reference in New Issue