Meteotemplate 3.1 Black Cherry

Meteotemplate 3.1 Black Cherry

Hi,

not long since the last major update was released and there is now a minor update, which brings one very important new feature as well as a few minor bug fixes and optimizations related to the new homepage. This is not just to fix some bugs, but also based on the recent feedback form where most of you preferred minor updates more often.

The major new feature is a brand new system of translations. Let’s face it… the current system of translating and even the scripts are no longer fulfilling their job. When I first released this template back in June 2015 there were no plugins, there were 3 languages available and I simply asked some of you who were so kind and sent me text files with translations. However, as more and more plugins are now available, more and more languages, it is all becoming disorganized. I have been thinking for quite some time how to best do this. First I thought about some existing solution and service for community translations, unfortunately it turned out they are all paid or very limited – either way not possible to use. I therefore decided I will have to find a way of doing this myself. I first wrote down the current problems and then tried to come up with solutions. I think I now finally came up with a solution to most of them and so I decided to implement it and see if it will work…

I will now describe how it works by giving the specific problems and new solutions to them.

  1. some plugins are translated, some are not, there are separate lanugage files for plugins and it is all very disorganized
    New solution: there is now just one centralized database with all the strings
  2. it was not possible to have a word in the language strings unless translation was available for all languages
    New solution: scripts were modified so that if the translation of a particular word is not available in the chosen language, English is shown by default (no error)
  3. it was not possible to use the language string for custom strings, everything had to be hard-coded and therefore not even potential for future translation
    New solution: even words that are not yet in the language strings can be passed to the lang function. It then returns simply what it gets and in the future, if translation is added, it will be translated.
  4. translation files were released as part of the template so always a long delay
    New solution: new dedicated page to translations, where files can be updated as often as necessary and downloaded separately
  5. it was impossible to see if the language file is up-to-date
    New solution: files now have a date of last update so that you can check if it is the latest available file
  6. very confusing system where various users were sending strings, not knowing what is and what isn’t translated
    New solution: centralized database where it can be seen immediately what is/is not translated and possibility to immediately provide translation and send for review
  7. no proper documentation
    New solution: all strings commented

There is now a brand new section for translations at meteotemplate.com, where you also find instructions how to download language files, how to translate and how to make your own strings on custom pages. I am sure you will quickly understand how the new system works and it will then be much easier with future translations, plugin translations etc

So now back to this new version. This new system of translating required a new format of the language string files therefore also the function that is responsible for actually processing these strings and displaying them, had to be changed. It should be however very easy to upgrade. Also there are some improvements in the header functioning and optimizations of the homepage.

Translations explained here: http://www.meteotemplate.com/web/translations/index.php

Changes

  • NEWnew system for translations – associated changes in header.php and a few other files and scripts
  • NEW – possibility to set particular blocks on the homepage collapsed by default
  • NEW – the time of last update shown in the current conditions box on the homepage is now adjusted to your settings for time format (12h/24h)
  • CHANGED – the header.php now uses a sligthly different URL for retrieving the current conditions. This requires one small change in the config, but should prevent all the problems some of you had with the scripts not being able to automatically locate your station and thus the banner did not work.
  • CHANGED – after some benchmarks I found that what is slowing down the homepage most is the current conditions block for the world cities. Yahoo is sometimes quite overloaded and takes several second to respond. This update will prevent this by loading this through an Ajax call – in other words, the homepage is shown to the user and only this particular block is loaded separately with the spinner being shown before data appears.
  • CHANGED – changes in the script used for loading earthquakes data optimized and is now much faster. This should speed up loading of the homepage substantially along with the previous change.
  • FIX – link colors on the homepage when using light theme were hard to read
  • FIX – the text for selecting long-term average in the station data block on the left on the homepage was not correctly translated
  • FIX – latitudes and longitudes showed negative numbers when using W or S
  • FIX – solar radiation for “this month” did not work in the station data block on the homepage
  • FIX – for some European countries the warnings symbol was shown even if there were none when using the EU warnings block
  • FIX – headers did not generate properly in the CSV table exported via the interactive table section

Instructions for upgrade

Upgrading from 3.0 should be farily easy and hopefully without any problems.

  1. MAKE A BACKUP
  2. Copy the files from pages/station/ directory of the upgrade and overwrite the original ones with the same name (DO NOT overwrite the entire directory, the update package only contains some pages). These changes are necessary for the new translation strings to work and there is a few minor bug fixes as well.
  3. Copy the files from homepage/ directory of the upgrade and overwrite the original ones. The forecastInfo, which is the one you had to edit previously, is not included and requires no changes, so you don´t have to worry about that one (DO NOT overwrite the entire directory, the update package only contains some pages). There is now also a new page worldWeatherInfo.php, which is necessary for the Ajax loading.
  4. Replace your original header.php with the new header.php – changes for new translation system and new URL used for retrieving data for the interactive banner.
  5. Delete the entire scripts directory on your server and replace it with the scripts folder in the upgrade package.
  6. Open your config.php and add the following line
    $bannerID = “XXXXX”;
    You can basically add it anywhere you like, best thing is to place it somewhere near the Aeris ID, to make it easy to find later on.
    Example:

    $aerisID = “id”;
    $aerisSecret = “secret code”;
    $aerisCacheTime = 60;
    $bannerID = “EZXX0002”;
    Now, go to http://www.weather.com, find the place you want to be used for the interactive banner and then look in the URL for the code. If in doubt, see the http://www.meteotemplate.com/web/faq.php -> Troubleshooting.
    This will prevent the problems some of you had with your station location not being automatically recognized or placed in a wrong location.
  7. Open your index.php (homepage). Then, copy all the settings you made and open the index.php included in the upgrade package.
    Start copying where it says:
    $currentConditions = “db”;
    And finish with the line:
    $upcomingAstroEvents = 10; // number of displayed upcoming astro events
  8. Now paste your setting in the new file – this is basically just so that you don´t have to set up everything again. If you want, you can simply use just the new index.php and do the setting again.
  9. You will notice that at the end of the settings, there is now a new set of parameters in the index.php, where you can simply enable certain blocks to be opened by default. So that you can set now as well.
  10. Save the index.php with the right setting and upload it to your root directory as your homepage.
  11. Replace the original language files in the lang directory with the new ones. Remember that you can now download these separately – see above.
  12. Replace the footer.php to reflect the new version upgrade.

Everything should now hopefully be up-to-date.

4 thoughts on “Meteotemplate 3.1 Black Cherry

  1. I upgraded to version 3.1
    I note that interactive banner is not updated
    I followed all the instructions step by step
    I added the line: $ bannerID = “EZXX0002”; with the code “SPCS0010”
    is not updated

Leave a Comment