Skip to content

Commit

Permalink
Fixed tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
mzilinec committed Jul 1, 2019
1 parent 0976252 commit ff75479
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion botshot/core/dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def reset_locale(self, locale=None):
if not locale:
locale = 'en_US'
meta = self.conversation.meta
if meta and 'locale' in meta:
if meta is not None:
locale = meta.get('locale', 'en_US')
strings.set_locale(locale)

Expand Down
5 changes: 3 additions & 2 deletions botshot/core/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ def __init__(self, locale='en_US'):
string_files = config.get("STRING_FILES")
if not string_files:
logging.debug("STRING_FILES not set. Strings will not be available.")
for lang, filename in string_files.items():
self.strings[lang] = self._load_strings(filename)
else:
for lang, filename in string_files.items():
self.strings[lang] = self._load_strings(filename)

def _load_strings(self, filename):
strings = {}
Expand Down

0 comments on commit ff75479

Please sign in to comment.