Implemented multi-language support of owm
This commit is contained in:
parent
99929d63a4
commit
b01942b39d
1 changed files with 2 additions and 2 deletions
|
@ -2,7 +2,7 @@ from WeatherForecast import WeatherForecast
|
||||||
from WeatherInterface import WeatherInterface
|
from WeatherInterface import WeatherInterface
|
||||||
import pyowm
|
import pyowm
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from settings import units
|
from settings import units, language
|
||||||
|
|
||||||
class OwmForecasts (WeatherInterface):
|
class OwmForecasts (WeatherInterface):
|
||||||
"""Fetches weather through the Openweathermap-api."""
|
"""Fetches weather through the Openweathermap-api."""
|
||||||
|
@ -11,7 +11,7 @@ class OwmForecasts (WeatherInterface):
|
||||||
self.api_key = api_key
|
self.api_key = api_key
|
||||||
self.units = units
|
self.units = units
|
||||||
self.location = location
|
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):
|
def is_available (self):
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue