skill-weather
skill-weather copied to clipboard
Weather skill does not allow condition to be localised
When we translate the weather skill, there are strings in the output that don't seem to be localisable.
History ========================================================
날씨가 어때요
>> 현재 날씨는 overcast clouds고 기온은 54도입니다. 오늘의 최고 기온은 54도, 최저 기온은 44도입니다.
We searched for the string:
juyeon@juyeonubuntu:/opt/mycroft/skills/mycroft-weather.mycroftai$ grep -nHri -e "overcast" -e "cloudy" .
./__init__.py:125: self.CODES['02d', '02n', '03d', '03n'] = 1 # partly cloudy
./__init__.py:126: self.CODES['04d', '04n'] = 2 # cloudy
But it seems like there is no way to localise this. Any thoughts?
These are used to select the icon to show on the Mark-1 display.
I believe the condition is handled like on L219
and calls the __translate() method. This method will load the <condition>.dialog or <condition>.future.dialog depending on if it's the present or future that's reported. If no match is found the english words will be used.
In the example you provide condition would be overcast clouds so if you create a file in the dialog/LANG/ folder called overcast clouds.dialog and overcast clouds.future.dialog this should be translated.
OpenWeatherMap currently supports more than 30 languages - see multilingual support. At least for these 30+ languages the translation work for the over 50 possible weather-codes that OWM provides can be avoided. I will have a look into it shortly...
...see PR #52
Is this still an issue? the weather api call attempts to use the device's language setting to return results in the right language