-
-
Notifications
You must be signed in to change notification settings - Fork 535
feat: LibreTranslate Integration #6263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/main/kotlin/net/ccbluex/liquidbounce/api/thirdparty/LibreTranslateApi.kt
Fixed
Show fixed
Hide fixed
suspend fun translate( | ||
text: String, | ||
sourceLanguage: String, | ||
targetLanguage: String, | ||
format: String = "text", | ||
alternatives: Int = 0, | ||
apiKey: String? = null, | ||
): TranslationResponse = post( |
Check warning
Code scanning / detekt
The more parameters a function has the more complex it is. Long parameter lists are often used to control complex algorithms and violate the Single Responsibility Principle. Prefer functions with short parameter lists. Warning library
src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/client/ModuleLibreTranslate.kt
Fixed
Show fixed
Hide fixed
src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/client/ModuleLibreTranslate.kt
Fixed
Show fixed
Hide fixed
src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/client/ModuleLibreTranslate.kt
Fixed
Show fixed
Hide fixed
val language = languages.find { it.code == lang } | ||
if (language == null) { | ||
targetLanguage = "" | ||
notification("Invalid Language", "Language '$lang' is invalid.", NotificationEvent.Severity.ERROR) |
Check warning
Code scanning / detekt
Line detected, which is longer than the defined maximum line length in the code style. Warning
src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/client/ModuleLibreTranslate.kt
Fixed
Show fixed
Hide fixed
src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/client/ModuleLibreTranslate.kt
Fixed
Show fixed
Hide fixed
src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/client/ModuleLibreTranslate.kt
Fixed
Show fixed
Hide fixed
src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/client/ModuleLibreTranslate.kt
Fixed
Show fixed
Hide fixed
I will close this because we need to deploy the docker image if we want to use it without API key (although it's very easy) |
closes #6262
If you have any other idea about this feature, I can add it here.
Note: file translation might be not implemented.