Files
nairobi/app/controllers/concerns/remotely_translatable.rb
Javi Martín fdfdbcbd0d Add and apply Style/ArgumentsForwarding rule
We were using generic names like `args` and `options` which don't really
add anything to `*` or `**` because Ruby required us to.

That's no longer the case in Ruby 3.2, so we can simplify the code a
bit.
2024-04-11 17:59:40 +02:00

14 lines
334 B
Ruby

module RemotelyTranslatable
private
def detect_remote_translations(*)
return [] unless Setting["feature.remote_translations"].present? && api_key_has_been_set_in_secrets?
RemoteTranslation.for(*)
end
def api_key_has_been_set_in_secrets?
Tenant.current_secrets.microsoft_api_key.present?
end
end