FIX: TRANSLATION FILE NOT FOUND

This commit is contained in:
Anmol
2020-08-16 18:58:17 +05:30
parent b4da99e671
commit 87fe140181
2 changed files with 2 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ ADD main.py /main.py
ADD loc.py /loc.py ADD loc.py /loc.py
ADD make_bar_graph.py /make_bar_graph.py ADD make_bar_graph.py /make_bar_graph.py
ADD colors.json /colors.json ADD colors.json /colors.json
ADD translation.json /translation.json
RUN pip install -r requirements.txt RUN pip install -r requirements.txt
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global ENV NPM_CONFIG_PREFIX=/home/node/.npm-global

View File

@@ -492,7 +492,7 @@ if __name__ == '__main__':
repo = g.get_repo(f"{username}/{username}") repo = g.get_repo(f"{username}/{username}")
contents = repo.get_readme() contents = repo.get_readme()
try: try:
with open('translation.json', encoding='utf-8') as config_file: with open(os.path.join(os.path.dirname(__file__), 'translation.json'), encoding='utf-8') as config_file:
data = json.load(config_file) data = json.load(config_file)
translate = data[locale] translate = data[locale]
except Exception as e: except Exception as e: