File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -39,16 +39,21 @@ module ::DiscourseTranslator
3939 end
4040
4141 on ( :post_process_cooked ) do |_ , post |
42- return if SiteSetting . automatic_translation_target_languages . blank?
43- Jobs . enqueue ( :translate_translatable , type : Post , translatable_id : post . id )
42+ if SiteSetting . automatic_translation_target_languages . present?
43+ Jobs . enqueue ( :translate_translatable , type : Post , translatable_id : post . id )
44+ end
4445 end
4546
4647 on ( :topic_created ) do |topic |
47- Jobs . enqueue ( :translate_translatable , type : Topic , translatable_id : topic . id )
48+ if SiteSetting . automatic_translation_target_languages . present?
49+ Jobs . enqueue ( :translate_translatable , type : Topic , translatable_id : topic . id )
50+ end
4851 end
4952
5053 on ( :topic_edited ) do |topic |
51- Jobs . enqueue ( :translate_translatable , type : Topic , translatable_id : topic . id )
54+ if SiteSetting . automatic_translation_target_languages . present?
55+ Jobs . enqueue ( :translate_translatable , type : Topic , translatable_id : topic . id )
56+ end
5257 end
5358
5459 add_to_serializer :post , :can_translate do
You can’t perform that action at this time.
0 commit comments