deformed-offering

Free Weather Website Templates

They're free, but use at your own risk

The scripts referenced here are used in the operation of this weather station, and may be freely copied and used to support your station. Please note that you use these scripts at your own risk. No warranty is expressed or implied. I accept no liability for any damages that may ensue from their use.
You will need to configure them for your own particular weather station website.
RSS feed for Scripts Updates A RSS Feed is available to help keep you informed on updates to the scripts.

If you find one or more of the scripts useful to you, please consider making a donation to help offset the routine expenses of operation of this website.
Thanks for your kind support!

A Version History is available -- check back from time to time to see if there are updates to scripts you have downloaded earlier. Announcements of version updates and new scripts are made on WXForum.net and Weather-Watch forums and saratogaWXPHP Twitter account as they become available.

This page was updated Wednesday, 02-Sep-2009 11:36 AM

Weather Display/PHP/AJAX Website Template Set - WD-World/Canada-ML

The multilanguage feature of the WD-World-ML and Canada-ML template set uses exact match string substitution to replace English words/phrases with their counterpart word/phrase in another language. The technology used is the same as for the multilanguage support in the WXSIM plaintext-parser.php. The WXSIM translation files are included with the distribution .zip. Each supported language has four files necessary to provide full support for the language. The LL is the two-character language abbreviation (en=English, dk=Danish, el=Greek, etc):

language-LL.txt
This file contains the primary lookups for translation of English to language LL. It also specifies the character set for the language. Each 'langlookup' entry is stored in a $LANGLOOKUP array for use by the langtrans() and langtransstr() functions on the webpages (see below for operation).
language-LL-local.txt
This file contains additional lookups for translation of English to language LL. Put your local additions to the language lookups in these files (which are loaded AFTER the language-LL.txt files) so you can add menu item additions and override a translation from the main file here, and still keep your primary language file updated from the master distribution. Each 'langlookup' entry is stored in a $LANGLOOKUP array for use by the langtrans() and langtransstr() functions on the webpages (see below for operation).
NOTE: it is strongly recommended that you use this feature to add translations specific to your site rather than changing the released language file as it will be easier to update the main language file from the distribution as new languages become available, and still preserve your local modifications.
 
language.LL.js
This file contains the JavaScript to configure the AJAX routine (ajaxWDwx.js) so certain words/phrases created by the AJAX updates will be in the language desired. Some of the entries (like wind cardinal directions, Beaufort and Heat Color Word text) are directly imported into $LANGLOOKUP for use by the langtrans() and langtransstr() functions on the webpages.
plaintext-parser-lang-LL.txt
This file contains the translation entries to convert an English WXSIM plaintext.txt forecast into another language. It is exactly the same file as used by plaintext-parser.php for the WXSIM forecast.
wxabout-LL.html
This file contains the language-specific text for use in the wxabout.php page and should be customized for your individual website for each language to be offered.

How the multilanguage feature works

In the common.php routine, a set of load functions will read/parse the language-LL.txt and language-LL.js files to load the common $LANGLOOKUP array with the translation values.

In exact match replacement, a text entry like this sample from language-dk.txt:

langlookup|Enable JavaScript for live updates|Aktiver JavaScript for lever opdaterer|

is read and parsed when each page is loaded (by routines in common.php). The English (second field) is used as a 'key' and when a langtrans() or langtransstr() function is called using that field, the functions will return the contents of the third field (in this case, Danish) for use on the page. If the exact match is not found, then the English words will be returned unchanged.

The preferences for a visitor for a language are retained by PHP session variables, and any page can be switched to a new language by using a ?lang=LL parameter (assuming 'LL' is in the list of supported languages).

Multilanguage support requires Weather-Display to run in English

Be advised that the translation provided by the WD-World-ML template set is FROM ENGLISH ONLY. If you run your Weather-Display using a language other than English, it is very likely that the multi-language support wont work as there is currently no provision to convert from <language> to English so the English to <language> translation isn't possible. If you wish to run Weather-Display in a language other than English, then please do not install the World-ML template set .. it won't work for you.

Language Packs for easy update for a language

With the World-ML template set, I've added distributions for current versions of individual language translation sets to help you keep your language files up-to-date. They can be downloaded individually from the install page as they are updated, then unpacked and uploaded to your World-ML template website to replace those language files. The full distribution ZIP file will always contain the current set of languages offered.

deformed-offering