Implemented language in config and 12hours-format aswell

This commit is contained in:
Mathieu B 2021-07-26 21:48:04 +02:00
parent 708ea65163
commit 37678cb247
2 changed files with 4 additions and 5 deletions

View File

@ -1,10 +1,8 @@
{
"HOMEASSISTANT_API_TOKEN": "!secret HOMEASSISTANT_API_TOKEN",
"HOMEASSISTANT_API_URL": "!secret HOMEASSISTANT_API_URL",
"API_KEY": "!secret API_KEY",
"SPOTIFY_CLIENT_ID": "!secret SPOTIFY_CLIENT_ID",
"SPOTIFY_CLIENT_SECRET": "!secret SPOTIFY_CLIENT_SECRET",
"PORT": 5000,
"12HOURS-FORMAT": false,
"LANGUAGE": "fr-fr",
"CLIENT_URL": "http://127.0.0.1:5001",
"TRAIN_ON_START": false
}

View File

@ -4,6 +4,7 @@ import os
import random
import get_path_file
from utils import config_utils
all_intents = dict()
path = os.path.dirname(get_path_file.__file__)
@ -77,7 +78,7 @@ def get_responses(intent_tag):
def get_lang_for_intent(intent_tag):
language = "fr-fr" # TODO: use config value
language = config_utils.get_in_config('LANGUAGE')
# first we check the intent
if exists(intent_tag):