Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix german language issue #81

Open
wants to merge 3 commits into
base: 20.02
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
import pytz
import re
import time
from astral import geocoder
from timezonefinder import TimezoneFinder
import geocoder

import mycroft.audio
from adapt.intent import IntentBuilder
Expand Down Expand Up @@ -99,8 +100,13 @@ def use_24hour(self):
def _get_timezone_from_builtins(self, locale):
try:
# This handles common city names, like "Dallas" or "Paris"
return pytz.timezone(geocoder.lookup(locale, geocoder.database())
.timezone)
# first get the lat / long.
g = geocoder.osm(locale)

# now look it up
tf = TimezoneFinder()
timezone = tf.timezone_at(lng=g.lng, lat=g.lat)
return pytz.timezone(timezone)
except Exception:
pass

Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pytz==2017.2
tzlocal==1.3
astral>=2.1
timezonefinder
geocoder
holidays
6 changes: 3 additions & 3 deletions vocab/de-de/date.future.weekend.intent
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Was (sind die |) Tage (für |) | Tag ist) (dieses | nächste) Wochenende
Was (Datum ist | Datum ist) (dieses | nächste) Wochenende
was (ist das Datum | sind die Daten) (für |) (dieses | nächste) Wochenende
(Was sind die|) Tage (für |) (dieses | nächstes) Wochenende
Was (für ein | )Datum ist (dieses | nächstes) Wochenende
was (ist das Datum | sind die Daten) (für |) (dieses | nächstes) Wochenende
6 changes: 4 additions & 2 deletions vocab/de-de/what.time.is.it.intent
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
(das |) (Uhrzeit | Uhr) ((rechts |) jetzt |) (bitte |)
(die |) (uhrzeit | uhr) (jetzt | ) (bitte |)
Hast du die (aktuelle|) Uhrzeit
aktuelle Zeit
aktuelle (uhrzeit | zeit)
Wie spät ist es
sag mir die (uhrzeit| zeit)