<commit_before># Configure your SMS API settings
require 'net/http'
require 'yaml'

class SmsManager
  attr_accessor :recipients, :message

  def initialize(message, recipients)
    @recipients = recipients
    @message = URI.encode(message)
    if File.exists?("#{RAILS_ROOT}/config/sms_settings.yml")
      @config = YAML.load_file(File.join(RAILS_ROOT,"config","sms_settings.yml"))
    end
    unless @config.blank?
      @sendername = @config['sms_settings']['sendername']
      @sms_url = @config['sms_settings']['host_url']
      @username = @config['sms_settings']['username']
      @password = @config['sms_settings']['password']
      @success_code = @config['sms_settings']['success_code']
    end
  end

  def send_sms
    return "#{t('sent_to_selected_department')}" if @config.blank?

    request = "#{@sms_url}?username=#{@username}&password=#{<PASSWORD>}&sendername=#{@sendername}&message=#{@message}&mobileno="

    cur_request = request
    @recipients.each do |recipient|
      if cur_request.length > 1000
        response = Net::HTTP.get_response(URI.parse(cur_request))
        cur_request = request
      end
      cur_request += ",#{recipient}"
    end

    if request.length < cur_request.length
      response = Net::HTTP.get_response(URI.parse(cur_request))
    end<commit_msg>translation fix in sms manager<commit_after># Configure your SMS API settings
require 'net/http'
require 'yaml'
require 'translator'

class SmsManager
  attr_accessor :recipients, :message

  def initialize(message, recipients)
    @recipients = recipients
    @message = URI.encode(message)
    if File.exists?("#{RAILS_ROOT}/config/sms_settings.yml")
      @config = YAML.load_file(File.join(RAILS_ROOT,"config","sms_settings.yml"))
    end
    unless @config.blank?
      @sendername = @config['sms_settings']['sendername']
      @sms_url = @config['sms_settings']['host_url']
      @username = @config['sms_settings']['username']
      @password = @config['sms_settings']['password']
      @success_code = @config['sms_settings']['success_code']
    end
  end

  def send_sms
    return "#{t('sms_configuration_not_found')}" if @config.blank?

    request = "#{@sms_url}?username=#{@username}&password=#{@password}&sendername=#{@sendername}&message=#{@message}&mobileno="

    cur_request = request
    @recipients.each do |recipient|
      if cur_request.length > 1000
        response = Net::HTTP.get_response(URI.parse(cur_request))
        cur_request = request
      end
      cur_request += ",#{recipient}"
    end

    if request.length < cur_request.length
      response = Net::HTTP.get_response(URI.parse(cur_request))
    end
{'fraction_non_alphanumeric': 0.1441543700340522, 'fraction_numerical': 0.003026863412788498, 'mean_word_length': 4.277445109780439, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3664751', 'n_tokens_mistral': 877, 'n_tokens_neox': 837, 'n_words': 147}