Skip to content

Commit 57dd8f6

Browse files
committed
Merge pull request #13 from ssendev/patch-1
allow specifying lang
2 parents 5b405e5 + 2402b3f commit 57dd8f6

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,16 @@ OpenWeather::Current.city("Berlin, DE", options)
6767
How to get an API key and tips for an effective usage of the API:
6868
http://openweathermap.org/appid
6969

70+
#### Multilingual support
71+
72+
```ruby
73+
# get current weather in german
74+
OpenWeather::Current.city("Berlin, DE", lang: "de")
75+
```
76+
77+
Available languages are listed at:
78+
http://openweathermap.org/current#multi
79+
7080

7181
## Contributing
7282

lib/open_weather/base.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def success?
2424
private
2525

2626
def extract_options!(options)
27-
valid_options = [:lat, :lon, :city, :country, :id, :units, :APPID]
27+
valid_options = [:lat, :lon, :city, :country, :id, :units, :APPID, :lang]
2828
options.keys.each { |k| options.delete(k) unless valid_options.include?(k) }
2929

3030
if options[:city] || options[:country]

0 commit comments

Comments
 (0)