From dd128162efa427c9832e48053e43081d857bc5d5 Mon Sep 17 00:00:00 2001 From: mammo0 Date: Thu, 11 Mar 2021 13:34:48 +0100 Subject: [PATCH] use appdirs to define path to polyglot data --- app/__init__.py | 8 ++++++++ requirements.txt | 1 + 2 files changed, 9 insertions(+) diff --git a/app/__init__.py b/app/__init__.py index 1fb8330..53554d9 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -1,2 +1,10 @@ +import os +from appdirs import user_data_dir + +# override polyglot path +import polyglot +polyglot.polyglot_path = os.path.join(user_data_dir(appname="LibreTranslate", appauthor="uav4geo"), "polyglot_data") + + from .main import main from .manage import manage diff --git a/requirements.txt b/requirements.txt index 30763a7..627a875 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,3 +9,4 @@ pyicu==2.6 pycld2==0.41 morfessor==2.0.6 polyglot==16.7.4 +appdirs==1.4.4