MycroftAI / skill-weather

Mycroft AI official Weather Skill, providing weather conditions and forecasts.
https://mycroft.ai/skills
Apache License 2.0
19 stars 59 forks source link

Weather skill does not allow condition to be localised #49

Open JuliaC29 opened 6 years ago

JuliaC29 commented 6 years ago

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?

forslund commented 6 years ago

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.

domcross commented 6 years ago

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...

domcross commented 6 years ago

...see PR #52

chrisveilleux commented 3 years ago

Is this still an issue? the weather api call attempts to use the device's language setting to return results in the right language