jcheng31 / DarkSkyApi

An unofficial C# library for the Dark Sky weather service. Targets .NET Standard 1.1.
MIT License
33 stars 18 forks source link

string format in czech locale #5

Closed bklabs closed 9 years ago

bklabs commented 9 years ago

Hi I've faced with problem with decimal separator in czech locale - it is a "," but not "." So, as result, "https://api.forecast.io/forecast/{0}/{1},{2}?units={3}&extend={4}&exclude={5}&lang={6}" will be formatted as "https://api.forecast.io/forecast/APIKEY/50,029,14,49?units=....."

workaround for now:

CultureInfo ci = Thread.CurrentThread.CurrentCulture; Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; _forecast = await _forecastClient.GetWeatherDataAsync(_lat, _longt, units, language); Thread.CurrentThread.CurrentCulture = ci;

Regards Dmitry Belov

jcheng31 commented 9 years ago

Hey, thanks for reporting this. I'm looking into it now, and should be able to get a fix out soon - it looks like a fairly easy change, so it shouldn't take too long :)

jcheng31 commented 9 years ago

All right, I think that should fix it. I've published the change to NuGet, so you should be able to update through there - let me know if the issue's still there!

bklabs commented 9 years ago

Hi

GetWeatherDataAsync still does not work in Czech locale (

Regards

Dmitry Belov

bklabs commented 9 years ago

BTW

You can send a Culture directly as an argument in to string.Format method

Regards

D.

jcheng31 commented 9 years ago

Oops, I updated the time machine method but not the "main" one - my bad. I'll get to it in a bit.

jcheng31 commented 9 years ago

Alright, just made the change, added some simple tests, and published it. Let me know if it works :)

bklabs commented 9 years ago

Hi

It works! Thank you.

Regards

D.

jcheng31 commented 9 years ago

No problem :)