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.
14 lines
334 B
Ruby
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
|