This commit is contained in:
Bakhai Support 2025-07-10 14:00:53 +05:30
commit c23291b037
5 changed files with 110 additions and 62 deletions

View file

@ -1 +1 @@
1.7.1 1.7.2

View file

@ -490,18 +490,19 @@ def create_app(args):
@limiter.exempt @limiter.exempt
def langs(): def langs():
""" """
Retrieve list of supported languages Get Supported Languages
--- ---
tags: tags:
- translate - translate
responses: responses:
200: 200:
description: List of languages description: List of supported languages
schema: schema:
id: languages id: languages
type: array type: array
items: items:
type: object type: object
description: Supported language
properties: properties:
code: code:
type: string type: string
@ -537,7 +538,7 @@ def create_app(args):
@access_check @access_check
def translate(): def translate():
""" """
Translate text from a language to another Translate Text
--- ---
tags: tags:
- translate - translate
@ -558,7 +559,7 @@ def create_app(args):
type: string type: string
example: en example: en
required: true required: true
description: Source language code description: Source language code or "auto" for auto detection
- in: formData - in: formData
name: target name: target
schema: schema:
@ -595,7 +596,7 @@ def create_app(args):
description: API key description: API key
responses: responses:
200: 200:
description: Translated text description: Translation
schema: schema:
id: translate id: translate
type: object type: object
@ -605,6 +606,47 @@ def create_app(args):
- type: string - type: string
- type: array - type: array
description: Translated text(s) description: Translated text(s)
detectedLanguage:
oneOf:
- type: object
properties:
confidence:
type: number
format: float
minimum: 0
maximum: 100
description: Confidence value
example: 100
language:
type: string
description: Language code
- type: array
items:
type: object
properties:
confidence:
type: number
format: float
minimum: 0
maximum: 100
description: Confidence value
example: 100
language:
type: string
description: Language code
alternatives:
oneOf:
- type: array
items:
type: string
- type: array
items:
type: array
items:
type: string
description: Alternative translations
required:
- translatedText
400: 400:
description: Invalid request description: Invalid request
schema: schema:
@ -793,7 +835,7 @@ def create_app(args):
@access_check @access_check
def translate_file(): def translate_file():
""" """
Translate file from a language to another Translate a File
--- ---
tags: tags:
- translate - translate
@ -811,7 +853,7 @@ def create_app(args):
type: string type: string
example: en example: en
required: true required: true
description: Source language code description: Source language code or "auto" for auto detection
- in: formData - in: formData
name: target name: target
schema: schema:
@ -968,7 +1010,7 @@ def create_app(args):
@access_check @access_check
def detect(): def detect():
""" """
Detect the language of a single text Detect Language of Text
--- ---
tags: tags:
- translate - translate
@ -998,7 +1040,7 @@ def create_app(args):
properties: properties:
confidence: confidence:
type: number type: number
format: integer format: float
minimum: 0 minimum: 0
maximum: 100 maximum: 100
description: Confidence value description: Confidence value
@ -1059,10 +1101,10 @@ def create_app(args):
@limiter.exempt @limiter.exempt
def frontend_settings(): def frontend_settings():
""" """
Retrieve frontend specific settings Retrieve Frontend Settings
--- ---
tags: tags:
- frontend - misc
responses: responses:
200: 200:
description: frontend settings description: frontend settings
@ -1139,10 +1181,10 @@ def create_app(args):
@bp.post("/suggest") @bp.post("/suggest")
def suggest(): def suggest():
""" """
Submit a suggestion to improve a translation Submit a Suggestion to Improve a Translation
--- ---
tags: tags:
- feedback - misc
parameters: parameters:
- in: formData - in: formData
name: q name: q
@ -1238,6 +1280,8 @@ def create_app(args):
swag = swagger(app) swag = swagger(app)
swag["info"]["version"] = get_version() swag["info"]["version"] = get_version()
swag["info"]["title"] = "LibreTranslate" swag["info"]["title"] = "LibreTranslate"
swag["info"]["description"] = "Free and Open Source Machine Translation API."
swag["info"]["license"] = {"name": "AGPL-3.0"}
@app.route(api_url) @app.route(api_url)
@limiter.exempt @limiter.exempt

View file

@ -9,8 +9,8 @@ msgstr ""
"Project-Id-Version: LibreTranslate 1.3.9\n" "Project-Id-Version: LibreTranslate 1.3.9\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2025-04-18 14:43-0400\n" "POT-Creation-Date: 2025-04-18 14:43-0400\n"
"PO-Revision-Date: 2025-05-23 19:28+0000\n" "PO-Revision-Date: 2025-07-07 09:01+0000\n"
"Last-Translator: Marijn Scholtus <linkable@gmail.com>\n" "Last-Translator: Michiel van der Wulp <michiel.vanderwulp@gmail.com>\n"
"Language-Team: Dutch <https://hosted.weblate.org/projects/libretranslate/app/" "Language-Team: Dutch <https://hosted.weblate.org/projects/libretranslate/app/"
"nl/>\n" "nl/>\n"
"Language: nl\n" "Language: nl\n"
@ -18,7 +18,7 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n" "Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n" "Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.12-dev\n" "X-Generator: Weblate 5.13-dev\n"
"Generated-By: Babel 2.12.1\n" "Generated-By: Babel 2.12.1\n"
#: libretranslate/app.py:93 #: libretranslate/app.py:93
@ -27,7 +27,7 @@ msgstr "Onjuist JSON-formaat"
#: libretranslate/app.py:209 libretranslate/templates/app.js.template:473 #: libretranslate/app.py:209 libretranslate/templates/app.js.template:473
msgid "Auto Detect" msgid "Auto Detect"
msgstr "Automatisch Detecteren" msgstr "Automatisch detecteren"
#: libretranslate/app.py:311 #: libretranslate/app.py:311
msgid "Unauthorized" msgid "Unauthorized"
@ -351,7 +351,7 @@ msgstr "Vertraag"
#: libretranslate/locales/.swag.py:9 #: libretranslate/locales/.swag.py:9
msgid "Banned" msgid "Banned"
msgstr "Geband" msgstr "Verbannen"
#: libretranslate/locales/.swag.py:10 #: libretranslate/locales/.swag.py:10
msgid "Hello world!" msgid "Hello world!"
@ -393,7 +393,7 @@ msgstr "Voorkeursaantal alternatieve vertalingen"
#: libretranslate/locales/.swag.py:18 #: libretranslate/locales/.swag.py:18
msgid "API key" msgid "API key"
msgstr "API sleutel" msgstr "API-sleutel"
#: libretranslate/locales/.swag.py:19 #: libretranslate/locales/.swag.py:19
msgid "Translate file from a language to another" msgid "Translate file from a language to another"
@ -409,7 +409,7 @@ msgstr "Bestand om te vertalen"
#: libretranslate/locales/.swag.py:22 #: libretranslate/locales/.swag.py:22
msgid "Detect the language of a single text" msgid "Detect the language of a single text"
msgstr "Vernietig de taal van een enkele sms" msgstr "Detecteer de taal op basis van een tekst"
#: libretranslate/locales/.swag.py:23 #: libretranslate/locales/.swag.py:23
msgid "Detections" msgid "Detections"
@ -445,11 +445,11 @@ msgstr "Succes"
#: libretranslate/locales/.swag.py:31 #: libretranslate/locales/.swag.py:31
msgid "Not authorized" msgid "Not authorized"
msgstr "Niet goedgekeurd" msgstr "Niet gemachtigd"
#: libretranslate/locales/.swag.py:32 #: libretranslate/locales/.swag.py:32
msgid "Original text" msgid "Original text"
msgstr "Originele sms" msgstr "Originele tekst"
#: libretranslate/locales/.swag.py:33 #: libretranslate/locales/.swag.py:33
msgid "Suggested translation" msgid "Suggested translation"
@ -481,7 +481,7 @@ msgstr "Codes van ondersteunde doeltalen"
#: libretranslate/locales/.swag.py:40 #: libretranslate/locales/.swag.py:40
msgid "Translated text(s)" msgid "Translated text(s)"
msgstr "Vertaald bericht" msgstr "Vertaald tekst"
#: libretranslate/locales/.swag.py:41 #: libretranslate/locales/.swag.py:41
msgid "Error message" msgid "Error message"
@ -501,7 +501,8 @@ msgstr "Vertrouwelijke waarde"
#: libretranslate/locales/.swag.py:45 #: libretranslate/locales/.swag.py:45
msgid "Character input limit for this language (-1 indicates no limit)" msgid "Character input limit for this language (-1 indicates no limit)"
msgstr "Character input limiet voor deze taal" msgstr ""
"Maximum aantal in te geven tekens voor deze taal (-1 betekent geen limiet)"
#: libretranslate/locales/.swag.py:46 #: libretranslate/locales/.swag.py:46
msgid "Frontend translation timeout" msgid "Frontend translation timeout"
@ -517,7 +518,7 @@ msgstr "Of een API-sleutel nodig is."
#: libretranslate/locales/.swag.py:49 #: libretranslate/locales/.swag.py:49
msgid "Whether submitting suggestions is enabled." msgid "Whether submitting suggestions is enabled."
msgstr "Of het indienen van suggesties in staat is." msgstr "Of het indienen van suggesties mogelijk is."
#: libretranslate/locales/.swag.py:50 #: libretranslate/locales/.swag.py:50
msgid "Supported files format" msgid "Supported files format"
@ -578,12 +579,12 @@ msgstr "druk op de \"Get API Key\" link."
#: libretranslate/templates/app.js.template:536 #: libretranslate/templates/app.js.template:536
msgid "contact the server operator." msgid "contact the server operator."
msgstr "neem contact op met de server." msgstr "neem contact op met de beheerder."
#: libretranslate/templates/index.html:9 libretranslate/templates/index.html:27 #: libretranslate/templates/index.html:9 libretranslate/templates/index.html:27
#: libretranslate/templates/index.html:347 #: libretranslate/templates/index.html:347
msgid "Free and Open Source Machine Translation API" msgid "Free and Open Source Machine Translation API"
msgstr "Vrij en open source Machine Vertaling" msgstr "Een vrije en open source vertalingsmachine"
#: libretranslate/templates/index.html:10 #: libretranslate/templates/index.html:10
#: libretranslate/templates/index.html:31 #: libretranslate/templates/index.html:31
@ -591,9 +592,9 @@ msgid ""
"Free and Open Source Machine Translation API. Free to download, offline " "Free and Open Source Machine Translation API. Free to download, offline "
"capable and easy to setup. Run your own API server in just a few minutes." "capable and easy to setup. Run your own API server in just a few minutes."
msgstr "" msgstr ""
"Vrij en open source Machine Vertaling API. Free to download, offline " "Een vrije en open source vertalingsmachine met API. Zelf te hosten, kan "
"capabel en makkelijk te koppelen. Laat je eigen API-server binnen een " "offline gebruikt worden en makkelijk te configureren. Draai je eigen API-"
"paar minuten." "server binnen een paar minuten."
#: libretranslate/templates/index.html:11 #: libretranslate/templates/index.html:11
msgid "translation" msgid "translation"
@ -605,11 +606,11 @@ msgstr "api"
#: libretranslate/templates/index.html:67 #: libretranslate/templates/index.html:67
msgid "API Docs" msgid "API Docs"
msgstr "API Docmentatie" msgstr "API docmentatie"
#: libretranslate/templates/index.html:69 #: libretranslate/templates/index.html:69
msgid "Get API Key" msgid "Get API Key"
msgstr "Haal API Sleutel" msgstr "Haal API-sleutel"
#: libretranslate/templates/index.html:71 #: libretranslate/templates/index.html:71
msgid "GitHub" msgid "GitHub"
@ -649,11 +650,11 @@ msgstr "Vertaling API"
#: libretranslate/templates/index.html:186 #: libretranslate/templates/index.html:186
msgid "Translate Text" msgid "Translate Text"
msgstr "Vertaal Tekst" msgstr "Vertaal tekst"
#: libretranslate/templates/index.html:190 #: libretranslate/templates/index.html:190
msgid "Translate Files" msgid "Translate Files"
msgstr "Vertaal Bestanden" msgstr "Vertaal bestanden"
#: libretranslate/templates/index.html:196 #: libretranslate/templates/index.html:196
msgid "Translate from" msgid "Translate from"
@ -718,11 +719,11 @@ msgstr "Antwoord"
#: libretranslate/templates/index.html:326 #: libretranslate/templates/index.html:326
msgid "Open Source Machine Translation API" msgid "Open Source Machine Translation API"
msgstr "Open source Machine Vertaling API" msgstr "Open source vertalingsmachine API"
#: libretranslate/templates/index.html:327 #: libretranslate/templates/index.html:327
msgid "Free to download. Offline Capable. Easy to Setup." msgid "Free to download. Offline Capable. Easy to Setup."
msgstr "Zelf gehost. Offline Capable. Makkelijk te configureren." msgstr "Zelf te hosten. Kan offline gebruikt worden. Makkelijk te configureren."
#: libretranslate/templates/index.html:346 #: libretranslate/templates/index.html:346
msgid "LibreTranslate" msgid "LibreTranslate"
@ -735,12 +736,13 @@ msgstr "Licentie:"
#: libretranslate/templates/index.html:354 #: libretranslate/templates/index.html:354
#, python-format #, python-format
msgid "Made with %(heart)s by %(contributors)s and powered by %(engine)s" msgid "Made with %(heart)s by %(contributors)s and powered by %(engine)s"
msgstr "Gemaakt met %(heart)s door %(contributors)s Emmet de kracht van %(engine)s" msgstr ""
"Gemaakt met een %(heart)s door de %(contributors)s en gebouwd op %(engine)s"
#: libretranslate/templates/index.html:354 #: libretranslate/templates/index.html:354
#, python-format #, python-format
msgid "%(libretranslate)s Contributors" msgid "%(libretranslate)s Contributors"
msgstr "%(libretranslate)s Bijdragers" msgstr "%(libretranslate)s bijdragers"
#~ msgid "multipart/form-data" #~ msgid "multipart/form-data"
#~ msgstr "multipart/form-data" #~ msgstr "multipart/form-data"

View file

@ -9,8 +9,8 @@ msgstr ""
"Project-Id-Version: LibreTranslate 1.3.9\n" "Project-Id-Version: LibreTranslate 1.3.9\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2025-04-18 14:43-0400\n" "POT-Creation-Date: 2025-04-18 14:43-0400\n"
"PO-Revision-Date: 2025-06-18 16:01+0000\n" "PO-Revision-Date: 2025-07-09 07:01+0000\n"
"Last-Translator: Akin Uslu <akin@uslu.net>\n" "Last-Translator: Kubi Kanber <kubikanber@gmail.com>\n"
"Language-Team: Turkish <https://hosted.weblate.org/projects/libretranslate/" "Language-Team: Turkish <https://hosted.weblate.org/projects/libretranslate/"
"app/tr/>\n" "app/tr/>\n"
"Language: tr\n" "Language: tr\n"
@ -18,7 +18,7 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n" "Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n" "Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 5.12.1\n" "X-Generator: Weblate 5.13-dev\n"
"Generated-By: Babel 2.12.1\n" "Generated-By: Babel 2.12.1\n"
#: libretranslate/app.py:93 #: libretranslate/app.py:93
@ -259,11 +259,11 @@ msgstr "Portekizce"
#: libretranslate/locales/.langs.py:34 #: libretranslate/locales/.langs.py:34
msgid "Portuguese (Brazil)" msgid "Portuguese (Brazil)"
msgstr "Portekiz (Brazil)" msgstr "Portekizce (Brazil)"
#: libretranslate/locales/.langs.py:35 #: libretranslate/locales/.langs.py:35
msgid "Romanian" msgid "Romanian"
msgstr "Rumence" msgstr "Romence"
#: libretranslate/locales/.langs.py:36 #: libretranslate/locales/.langs.py:36
msgid "Russian" msgid "Russian"
@ -323,11 +323,11 @@ msgstr "Desteklenen dillerin listesini al"
#: libretranslate/locales/.swag.py:2 #: libretranslate/locales/.swag.py:2
msgid "List of languages" msgid "List of languages"
msgstr "Dil listesi" msgstr "Dillerin listesi"
#: libretranslate/locales/.swag.py:3 #: libretranslate/locales/.swag.py:3
msgid "translate" msgid "translate"
msgstr "çevir" msgstr "çeviri"
#: libretranslate/locales/.swag.py:4 #: libretranslate/locales/.swag.py:4
msgid "Translate text from a language to another" msgid "Translate text from a language to another"
@ -359,7 +359,7 @@ msgstr "Merhaba dünya!"
#: libretranslate/locales/.swag.py:11 #: libretranslate/locales/.swag.py:11
msgid "Text(s) to translate" msgid "Text(s) to translate"
msgstr "Çevrilecek metin" msgstr "Çevrilecek metin(ler)"
#: libretranslate/locales/.swag.py:12 #: libretranslate/locales/.swag.py:12
msgid "Source language code" msgid "Source language code"
@ -425,15 +425,15 @@ msgstr "Algılanacak metin"
#: libretranslate/locales/.swag.py:26 #: libretranslate/locales/.swag.py:26
msgid "Retrieve frontend specific settings" msgid "Retrieve frontend specific settings"
msgstr "Ön uca özel ayarları al" msgstr "Önyüze özgü ayarları al"
#: libretranslate/locales/.swag.py:27 #: libretranslate/locales/.swag.py:27
msgid "frontend settings" msgid "frontend settings"
msgstr "ön ayarları" msgstr "önyüz ayarları"
#: libretranslate/locales/.swag.py:28 #: libretranslate/locales/.swag.py:28
msgid "frontend" msgid "frontend"
msgstr "ön" msgstr "önyüz"
#: libretranslate/locales/.swag.py:29 #: libretranslate/locales/.swag.py:29
msgid "Submit a suggestion to improve a translation" msgid "Submit a suggestion to improve a translation"
@ -481,7 +481,7 @@ msgstr "Desteklenen hedef dil kodları"
#: libretranslate/locales/.swag.py:40 #: libretranslate/locales/.swag.py:40
msgid "Translated text(s)" msgid "Translated text(s)"
msgstr "Çevirilen metin" msgstr "Çevrilen metin(ler)"
#: libretranslate/locales/.swag.py:41 #: libretranslate/locales/.swag.py:41
msgid "Error message" msgid "Error message"
@ -505,11 +505,11 @@ msgstr "Bu dil için karakter giriş sınırı (-1, sınır olmadığını göst
#: libretranslate/locales/.swag.py:46 #: libretranslate/locales/.swag.py:46
msgid "Frontend translation timeout" msgid "Frontend translation timeout"
msgstr "Ön çeviri zaman aşımı" msgstr "Önyüz çeviri zaman aşımı"
#: libretranslate/locales/.swag.py:47 #: libretranslate/locales/.swag.py:47
msgid "Whether the API key database is enabled." msgid "Whether the API key database is enabled."
msgstr "API anahtarı veri tabanının etkin olup olmadığı." msgstr "API anahtar veri tabanının etkin olup olmadığı."
#: libretranslate/locales/.swag.py:48 #: libretranslate/locales/.swag.py:48
msgid "Whether an API key is required." msgid "Whether an API key is required."
@ -560,7 +560,8 @@ msgid ""
"Thanks for your correction. Note the suggestion will not take effect right " "Thanks for your correction. Note the suggestion will not take effect right "
"away." "away."
msgstr "" msgstr ""
"Düzeltmeniz için teşekkürler. Önerinin hemen etkili olmayacağını unutmayın." "Düzeltmeniz için teşekkürler. Önerinin hemen yürürlüğe girmeyeceğini "
"unutmayın."
#: libretranslate/templates/app.js.template:463 #: libretranslate/templates/app.js.template:463
msgid "No languages available. Did you install the models correctly?" msgid "No languages available. Did you install the models correctly?"
@ -585,7 +586,7 @@ msgstr "sunucu yöneticisiyle iletişime geçin."
#: libretranslate/templates/index.html:27 #: libretranslate/templates/index.html:27
#: libretranslate/templates/index.html:347 #: libretranslate/templates/index.html:347
msgid "Free and Open Source Machine Translation API" msgid "Free and Open Source Machine Translation API"
msgstr "Özgür ve Açık Kaynaklı Makine Çevirisi API'si" msgstr "Ücretsiz ve Açık Kaynaklı Makine Çevirisi API'si"
#: libretranslate/templates/index.html:10 #: libretranslate/templates/index.html:10
#: libretranslate/templates/index.html:31 #: libretranslate/templates/index.html:31
@ -593,9 +594,9 @@ msgid ""
"Free and Open Source Machine Translation API. Free to download, offline " "Free and Open Source Machine Translation API. Free to download, offline "
"capable and easy to setup. Run your own API server in just a few minutes." "capable and easy to setup. Run your own API server in just a few minutes."
msgstr "" msgstr ""
"Özgür ve Açık Kaynaklı Makine Çevirisi API'si. Kendiniz " "Ücretsiz ve Açık Kaynaklı Makine Çevirisi API'si. Ücretsiz indirilebilir, "
"barındırabileceğiniz, çevrim dışı çalışabilir ve kurulumu kolay. Sadece " "çevrimdışı çalışabilir ve kurulumu kolaydır. Kendi API sunucunuzu sadece "
"birkaç dakika içinde kendi API sunucunuzu çalıştırın." "birkaç dakikada çalıştırın."
#: libretranslate/templates/index.html:11 #: libretranslate/templates/index.html:11
msgid "translation" msgid "translation"
@ -642,8 +643,9 @@ msgid ""
"Due to bot abuse, translation requests are temporarily limited to users with" "Due to bot abuse, translation requests are temporarily limited to users with"
" a valid API key. Sorry for the inconvenience!" " a valid API key. Sorry for the inconvenience!"
msgstr "" msgstr ""
"Bot kötüye kullanılması nedeniyle, çeviri talepleri geçerli bir API anahtarı" "Bot kötüye kullanımı nedeniyle, çeviri istekleri geçici olarak geçerli bir "
" olan kullanıcılarla geçici olarak sınırlıdır. Rahatlık için özür dilerim!" "API anahtarına sahip kullanıcılarla sınırlıdır. Rahatsızlıktan dolayı özür "
"dileriz!"
#: libretranslate/templates/index.html:182 #: libretranslate/templates/index.html:182
msgid "Translation API" msgid "Translation API"
@ -663,7 +665,7 @@ msgstr "Şundan çevir"
#: libretranslate/templates/index.html:206 #: libretranslate/templates/index.html:206
msgid "Swap source and target languages" msgid "Swap source and target languages"
msgstr "Kaynak ve hedef dilleri değiştir" msgstr "Kaynak ve hedef dilleri değiştirin"
#: libretranslate/templates/index.html:209 #: libretranslate/templates/index.html:209
msgid "Translate into" msgid "Translate into"

View file

@ -12,4 +12,4 @@ response = requests.post(
}, },
timeout=60 timeout=60
) )
# if server unavailable then requests with raise exception and healthcheck will fail response.raise_for_status() # if server unavailable then requests with raise exception and healthcheck will fail