translate_document states that param can be nil or string
# @param [String, nil] source_lang Source language to use for the translation. `nil` will cause
# automatic source langauge detection to be used. Must be
however when passing in a nil it errors
input_document = Tempfile.new(['deep_l', '.html']).tap do |file|
file.write('<html>Bonjour</html>')
file.rewind
end
output_document_path = ::Dir::Tmpname.create('deep_l') {}
DeepL.document.translate_document(
input_document.path,
output_document_path,
nil,
'EN',
nil,
tag_handling: 'html',
)
Using an empty string does work