Files
grecia/app/controllers/concerns/remotely_translatable.rb
Javi Martín 2f0327acf8 Use remote translations objects instead of hashes
This way we can simplify the code dealing with the translatable
association.
2023-02-16 17:52:17 +01:00

14 lines
342 B
Ruby

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