Using the widget attributes one can tune the graphical appearance (theme and background), language, initial location to retrieve the weather and initial measure units:
- theme: the widget theme.
The themes are HTML files consisting of a layout template and some CSS styling.
Default value: "complex1"
- background: the weather widget background.
It can be any CSS valid color such as 'red', '#f00', '#ef23a2', 'transparent' or use 'dynamic' to have a dynamic background according to the current weather conditions.
Default value: "dynamic"
- latitude: default initial location - the latitude.
Default value: "0"
- longitude: default initial location - the longitude.
Default value: "0"
- location: default initial location address.
It can be anything: country, city, zone, area, zipcode, company name, address, street etc.
If latitude or longitude are also set, then this parameter will be just shown like a label as the weather will be retrieved from the (latitude, longitude) pair.
Default value: ""
- units: default initial metric system.
Choose between si (°C, km/h, mBar) or us (°F, mph, InHg).
Default value: "si"
- lang: the widget language.
Forecast.io supports the following languages: bs (bosnian), de (german), en (english), es (spanish), fr (french), it (italian), nl (dutch), pl (polish), pt (portuguese), ru (russian).
If the specified language is not supported by forecast.io, the weather messages will be returned in english as it is the default language of forecast.io.
A few more languages were already included in the package: hi (hindi), hr (croatian), ro (romanian), tr (turkish) and using them will localize the widget texts but the forecasts will be in english as forecast.io do not support these languages.
More languages can be added add or the existing ones can be modified.
For more information on localization support, please see the Localization Support section.
Default value: "en"
Example (the weather widget with the default attributes):