Implemented multi-language support of owm

This commit is contained in:
Maximilian Giller 2019-05-06 16:09:14 +02:00
parent 99929d63a4
commit b01942b39d

View file

@ -2,7 +2,7 @@ from WeatherForecast import WeatherForecast
from WeatherInterface import WeatherInterface
import pyowm
from datetime import datetime
from settings import units
from settings import units, language
class OwmForecasts (WeatherInterface):
"""Fetches weather through the Openweathermap-api."""
@ -11,7 +11,7 @@ class OwmForecasts (WeatherInterface):
self.api_key = api_key
self.units = units
self.location = location
self.api = pyowm.OWM(self.api_key, subscription_type=self.subscription)
self.api = pyowm.OWM(self.api_key, subscription_type=self.subscription, language=language)
def is_available (self):
try: