Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 2813c3a

Browse files
committed
DEV: No need to split content as we're streaming responses
1 parent e2d7ca0 commit 2813c3a

File tree

3 files changed

+1
-211
lines changed

3 files changed

+1
-211
lines changed

lib/translation/content_splitter.rb

Lines changed: 0 additions & 109 deletions
This file was deleted.

lib/translation/post_localizer.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ def self.localize(post, target_locale = I18n.locale)
1111
return if post.raw.length > SiteSetting.ai_translation_max_post_length
1212
target_locale = target_locale.to_s.sub("-", "_")
1313

14-
translated_raw =
15-
ContentSplitter
16-
.split(post.raw)
17-
.map { |text| PostRawTranslator.new(text:, target_locale:, post:).translate }
18-
.join("")
14+
translated_raw = PostRawTranslator.new(text: post.raw, target_locale:, post:).translate
1915

2016
localization =
2117
PostLocalization.find_or_initialize_by(post_id: post.id, locale: target_locale)

spec/lib/translation/content_splitter_spec.rb

Lines changed: 0 additions & 97 deletions
This file was deleted.

0 commit comments

Comments
 (0)