Skip to content

Commit 2a3abab

Browse files
committed
feat: validate source_locale in localize_raw
1 parent 14bd4d2 commit 2a3abab

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/lingodotdev.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,7 @@ def make_request(url, json: nil, method: :post)
817817
end
818818

819819
def localize_raw(payload, target_locale:, source_locale:, fast: nil, reference: nil, concurrent: false, &progress_callback)
820+
raise ValidationError, 'Source locale is required' if source_locale.nil? || (source_locale.is_a?(String) && source_locale.empty?)
820821
chunked_payload = extract_payload_chunks(payload)
821822

822823
processed_chunks = if concurrent && !progress_callback

0 commit comments

Comments
 (0)