mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2026-03-02 07:00:05 -05:00
Fix version display
This commit is contained in:
parent
061a34b813
commit
c7bf3ff9b3
@ -54,10 +54,18 @@ emojis = {e: True for e in \
|
||||
|
||||
def get_version():
|
||||
try:
|
||||
with open("VERSION") as f:
|
||||
with open(os.path.join(os.path.dirname(__file__), "..", "VERSION")) as f:
|
||||
return f.read().strip()
|
||||
except:
|
||||
return "?"
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
try:
|
||||
from importlib.metadata import version
|
||||
return version("libretranslate")
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return "?"
|
||||
|
||||
|
||||
def get_upload_dir():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user