Add MicrososftTranslateClient to new namespace
- Rename to Client - Add to new namespace RemoteTranslations::Microsoft - Update references to new namespace
This commit is contained in:
@@ -2,7 +2,7 @@ require "translator-text"
|
||||
include SentencesParser
|
||||
include RemoteAvailableLocales
|
||||
|
||||
class MicrosoftTranslateClient
|
||||
class RemoteTranslations::Microsoft::Client
|
||||
CHARACTERS_LIMIT_PER_REQUEST = 5000
|
||||
PREVENTING_TRANSLATION_KEY = "notranslate"
|
||||
|
||||
@@ -35,7 +35,7 @@ class RemoteTranslationsCaller
|
||||
end
|
||||
|
||||
def translations
|
||||
@translations ||= MicrosoftTranslateClient.new.call(fields_values, locale)
|
||||
@translations ||= RemoteTranslations::Microsoft::Client.new.call(fields_values, locale)
|
||||
end
|
||||
|
||||
def fields_values
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module SentencesParser
|
||||
|
||||
def detect_split_position(text)
|
||||
minimum_valid_index = text.size - MicrosoftTranslateClient::CHARACTERS_LIMIT_PER_REQUEST
|
||||
minimum_valid_index = text.size - RemoteTranslations::Microsoft::Client::CHARACTERS_LIMIT_PER_REQUEST
|
||||
valid_point = text[minimum_valid_index..text.size].index(".")
|
||||
valid_whitespace = text[minimum_valid_index..text.size].index(" ")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user