Skip to content
This repository has been archived by the owner on Jun 10, 2023. It is now read-only.

Commit

Permalink
add basic lang
Browse files Browse the repository at this point in the history
  • Loading branch information
spookybear0 committed Oct 6, 2020
1 parent 96bba73 commit ed0889f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ Due to GDPyS' major advances within the GDPS space, its requirements are complet
- Device/Server capable of running Python (Linux VPS is recommended)
- Python 3.7+
- MySQL Server
- Domain name ~17 characters long (can be a bit more or less if using a few exe tweaks)
- Domain name ~17 characters long (can be a bit more or less if using a few exe tweaks or if using hosts file)
13 changes: 13 additions & 0 deletions handlers/lang.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import json
import os

class Lang:
def __init__(self):
for f in os.listdir("lang"):
if f.endswith(".json"):
lang = json.load(open("lang/" + f, "r"))
for key, value in lang.items():
setattr(self, key, value)


lang = Lang()
3 changes: 3 additions & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"d": "test"
}
1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import os
import importlib
from threading import Thread
import helpers.lang

def config_routes(app: web.Application) -> None:
"""Configures all of the routes and handlers."""
Expand Down

0 comments on commit ed0889f

Please sign in to comment.