1,126
edits
No edit summary |
|||
Line 68: | Line 68: | ||
Obviously with the url changed to where ever you want the redirect pointing. | Obviously with the url changed to where ever you want the redirect pointing. | ||
== Changing Languages == | == Changing Languages == | ||
To switch statically, you need to edit the "gauges.js" file, and change the line | To switch statically, you need to edit the "gauges.js" file, and change the line 12: | ||
var strings = LANG.EN, | |||
to | |||
var strings = LANG.XX, | |||
(where XX is the desired language code). | |||
To add a new translation, edit the "language.js" file and copy one of the existing sections | To add a new translation, edit the "language.js" file and copy one of the existing sections e.g. English, to the end of the file, changing all the LANG.EN values to LANG.XX (where XX is the code for the new language), and editing all the strings. The zip file contains a language.js file with English, French, German, Dutch, Swedish, Danish, Finnish, Norwegian, Italian, Spanish, and Catalan translations to get you going. | ||
If you are only going to use one language, then deleting the unused language options and the | If you are only going to use one language, then deleting the unused language options and the changeLang() function from the language.js file will speed up the page load time slightly. | ||
To switch languages | To switch languages dynamically, you need to add script to your page which sets the LANG object to equal the desired language and then calls the changeLang() function. | ||
e.g. | |||
// Dynamic script to change the default language to German | |||
changeLang(LANG.DE); | |||
This will re-label all the gauges, and update the text/radio buttons etc. on the web page. | |||
However, changing the language for the gauges DOES NOT translate the displayed forecast as the text of the message is being supplied by your weather station/software. | |||
== Forecast Messages == | == Forecast Messages == |