Remove language detection through cld3 (#17478)
* Remove language detection through cld3 * Update app/helpers/languages_helper.rb Co-authored-by: Yamagishi Kazutoshi <ykzts@desire.sh> Co-authored-by: Yamagishi Kazutoshi <ykzts@desire.sh>
This commit is contained in:
		@@ -120,7 +120,7 @@ class ActivityPub::ProcessStatusUpdateService < BaseService
 | 
			
		||||
    @status.text         = @status_parser.text || ''
 | 
			
		||||
    @status.spoiler_text = @status_parser.spoiler_text || ''
 | 
			
		||||
    @status.sensitive    = @account.sensitized? || @status_parser.sensitive || false
 | 
			
		||||
    @status.language     = @status_parser.language || detected_language
 | 
			
		||||
    @status.language     = @status_parser.language
 | 
			
		||||
    @status.edited_at    = @status_parser.edited_at || Time.now.utc if significant_changes?
 | 
			
		||||
 | 
			
		||||
    @status.save!
 | 
			
		||||
@@ -210,10 +210,6 @@ class ActivityPub::ProcessStatusUpdateService < BaseService
 | 
			
		||||
    { redis: Redis.current, key: "create:#{@uri}", autorelease: 15.minutes.seconds }
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def detected_language
 | 
			
		||||
    LanguageDetector.instance.detect(@status_parser.text, @account)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def create_previous_edit!
 | 
			
		||||
    # We only need to create a previous edit when no previous edits exist, e.g.
 | 
			
		||||
    # when the status has never been edited. For other cases, we always create
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user