Skip to content

Commit

Permalink
Add localization support and unofficial en_US strings file (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffo99 committed Feb 5, 2020
2 parents 2d8c36f + 63a28f2 commit 0a9ade3
Show file tree
Hide file tree
Showing 7 changed files with 450 additions and 11 deletions.
7 changes: 6 additions & 1 deletion config/template_config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
# Config file parameters
[Config]
; Config file version. DO NOT EDIT THIS!
version = 13
version = 14
; Set this to no when you are done editing the file
is_template = yes
; Language code for string file
; Available languages:
; it_IT - Italian, by Steffo
; en_US - English, by https://github.com/DarrenWestwood (incomplete, please improve it!)
language = it_IT

# Telegram bot parameters
[Telegram]
Expand Down
4 changes: 3 additions & 1 deletion core.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import sys
import telegram
import strings
import worker
import configloader
import utils
import threading
import importlib

language = configloader.config["Config"]["language"]
strings = importlib.import_module("strings." + language)

def main():
"""The core code of the program. Should be run only in the main process!"""
Expand Down
5 changes: 4 additions & 1 deletion database.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
from sqlalchemy.ext.declarative import declarative_base
import configloader
import telegram
import strings
import requests
import utils
import importlib

language = configloader.config["Config"]["language"]
strings = importlib.import_module("strings." + language)

# Create a (lazy) database engine
engine = create_engine(configloader.config["Database"]["engine"])
Expand Down
Loading

0 comments on commit 0a9ade3

Please sign in to comment.