Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2927 from ChanceNCounter/fix/lang-none
Browse files Browse the repository at this point in the history
stop passing lang=None to Lingua Franca
  • Loading branch information
krisgesling authored Jul 12, 2021
2 parents b3a0b3b + a211441 commit 31e1e2d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions mycroft/util/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from enum import Enum

# These are the main functions we are using lingua franca to provide
from lingua_franca import get_default_loc
# TODO 21.08 - move nice_duration methods to Lingua Franca.
from lingua_franca.format import (
join_list,
Expand Down Expand Up @@ -104,6 +105,7 @@ def _duration_handler(time1, lang=None, speech=True, *, time2=None,
Returns:
str: timespan as a string
"""
lang = lang or get_default_loc()
_leapdays = 0
_input_resolution = resolution
milliseconds = 0
Expand Down
6 changes: 5 additions & 1 deletion mycroft/util/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from difflib import SequenceMatcher
from warnings import warn

from lingua_franca import get_default_loc
from lingua_franca.parse import (
extract_duration,
extract_number,
Expand Down Expand Up @@ -115,4 +116,7 @@ def extract_datetime(text, anchorDate="DEFAULT", lang=None,
"deprecated. This parameter can be omitted."))
if anchorDate is None or anchorDate == "DEFAULT":
anchorDate = now_local()
return _extract_datetime(text, anchorDate, lang, default_time)
return _extract_datetime(text,
anchorDate,
lang or get_default_loc(),
default_time)

0 comments on commit 31e1e2d

Please sign in to comment.