mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2025-06-21 08:30:58 +00:00
add download link & auto download translated file
This commit is contained in:
parent
b97134ac07
commit
6a304df2e8
3 changed files with 39 additions and 9 deletions
10
app/app.py
10
app/app.py
|
@ -507,11 +507,9 @@ def create_app(args):
|
|||
id: translate
|
||||
type: object
|
||||
properties:
|
||||
translatedText:
|
||||
oneOf:
|
||||
- type: string
|
||||
- type: array
|
||||
description: Translated text(s)
|
||||
translatedFileUrl:
|
||||
type: string
|
||||
description: Translated file url
|
||||
400:
|
||||
description: Invalid request
|
||||
schema:
|
||||
|
@ -588,7 +586,7 @@ def create_app(args):
|
|||
translated_filename = os.path.basename(translated_file_path)
|
||||
return jsonify(
|
||||
{
|
||||
"translatedFileUrl": url_for('download_file', filename=translated_filename)
|
||||
"translatedFileUrl": url_for('download_file', filename=translated_filename, _external=True)
|
||||
}
|
||||
)
|
||||
except Exception as e:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue