mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2024-11-28 19:01:02 +00:00
remove scheduler if files translation is disabled
This commit is contained in:
parent
909deccd3f
commit
aac45a60ab
1 changed files with 4 additions and 5 deletions
|
@ -13,8 +13,7 @@ from flask_swagger_ui import get_swaggerui_blueprint
|
||||||
from translatehtml import translate_html
|
from translatehtml import translate_html
|
||||||
from werkzeug.utils import secure_filename
|
from werkzeug.utils import secure_filename
|
||||||
|
|
||||||
from app import flood
|
from app import flood, remove_translated_files
|
||||||
from app import remove_translated_files
|
|
||||||
from app.language import detect_languages, transliterate
|
from app.language import detect_languages, transliterate
|
||||||
from .api_keys import Database
|
from .api_keys import Database
|
||||||
from .suggestions import Database as SuggestionsDatabase
|
from .suggestions import Database as SuggestionsDatabase
|
||||||
|
@ -29,9 +28,6 @@ def get_upload_dir():
|
||||||
return upload_dir
|
return upload_dir
|
||||||
|
|
||||||
|
|
||||||
remove_translated_files.setup(get_upload_dir())
|
|
||||||
|
|
||||||
|
|
||||||
def get_json_dict(request):
|
def get_json_dict(request):
|
||||||
d = request.get_json()
|
d = request.get_json()
|
||||||
if not isinstance(d, dict):
|
if not isinstance(d, dict):
|
||||||
|
@ -97,6 +93,9 @@ def create_app(args):
|
||||||
if args.debug:
|
if args.debug:
|
||||||
app.config["TEMPLATES_AUTO_RELOAD"] = True
|
app.config["TEMPLATES_AUTO_RELOAD"] = True
|
||||||
|
|
||||||
|
if not args.disable_files_translation:
|
||||||
|
remove_translated_files.setup(get_upload_dir())
|
||||||
|
|
||||||
# Map userdefined frontend languages to argos language object.
|
# Map userdefined frontend languages to argos language object.
|
||||||
if args.frontend_language_source == "auto":
|
if args.frontend_language_source == "auto":
|
||||||
frontend_argos_language_source = type(
|
frontend_argos_language_source = type(
|
||||||
|
|
Loading…
Reference in a new issue