Skip to content
Snippets Groups Projects
Commit 2e4cc800 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

Merge branch 'libre-translate' of github.com:noesya/osuny into libre-translate

parents d486a747 58a37bd1
No related branches found
No related tags found
No related merge requests found
......@@ -48,7 +48,7 @@ gem "jquery-ui-rails", git: "https://github.com/jquery-ui-rails/jquery-ui-rails.
gem "kamifusen"#, path: "../kamifusen"
gem "kaminari"
gem "leaflet-rails"
gem "libretranslate"
gem "libretranslate"#, path: "../libretranslate"
gem "mini_magick"
gem "octokit"
gem "omniauth-rails_csrf_protection", "~> 1.0"
......
class Admin::TranslationController < Admin::ApplicationController
def translate
@target = translation_params[:target]
# @response = LibreTranslate.translate text: translation_params[:text],
# from: translation_params[:from],
# to: translation_params[:to]
# @response = LibreTranslate.translate translation_params[:text],
# source: translation_params[:from],
# target: translation_params[:to]
@response = {
'translatedText' => 'test'
}
......
# frozen_string_literal: true
LibreTranslate.configure do |config|
# Configure the base URL of your LibreTranslate provider.
config.base_url = ENV.fetch("LIBRETRANSLATE_BASE_URL", "https://libretranslate.com")
# Configure the API key that will be used in requests.
config.api_key = ENV["LIBRETRANSLATE_API_KEY"]
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment