skill-weather icon indicating copy to clipboard operation
skill-weather copied to clipboard

Weather skill does not allow condition to be localised

Open JuliaC29 opened this issue 7 years ago • 4 comments
trafficstars

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?

JuliaC29 avatar Nov 05 '18 22:11 JuliaC29

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.

forslund avatar Nov 06 '18 06:11 forslund

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 avatar Nov 16 '18 12:11 domcross

...see PR #52

domcross avatar Nov 17 '18 19:11 domcross

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

chrisveilleux avatar Sep 21 '21 05:09 chrisveilleux