Skip to content

Commit

Permalink
add a translation delay
Browse files Browse the repository at this point in the history
  • Loading branch information
microstudi committed Apr 9, 2024
1 parent 66ec464 commit 994f250
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/initializers/decidim.rb
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@
# Enable machine translations
config.enable_machine_translations = Rails.application.secrets.translator[:api_key].present?
config.machine_translation_service = "DeeplTranslator"
config.machine_translation_delay = Rails.application.secrets.translator[:delay].to_i.seconds

# If you want to enable machine translation you can create your own service
# to interact with third party service to translate the user content.
Expand Down
1 change: 1 addition & 0 deletions config/secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ default: &default
translator:
api_key: <%= ENV["TRANSLATOR_API_KEY"] %>
host: <%= ENV["TRANSLATOR_HOST"] %>
delay: <%= Decidim::Env.new("TRANSLATOR_DELAY", "1").to_i %>
elections:
<<: *elections_default
storage:
Expand Down

0 comments on commit 994f250

Please sign in to comment.