Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

Lack of translation in Moon mousover

Discussion of Ken True's web site templates

Moderator: saratogaWX

Post Reply
User avatar
actioman
Posts: 118
Joined: Sat 20 Mar 2010 1:01 am
Weather Station: Davis Vantage Pro2 Plus
Operating System: Windows XP SP3
Location: Elvas, Portugal
Contact:

Lack of translation in Moon mousover

Post by actioman »

Hi there!

One of the reasons why I have my website with these templates is the feature that allows you to change the language with a single click.
Recently discovered that there are still some things untranslated. I refer in this case to two situations related with the moon and its phases:

The first one is in the 'ajax-dashboard.php' in the Moon area, the "mouseover" is allways in English,like you can see in the image:

Image

I've tried several solutions without success.
These are the lines of code:

Code: Select all

                <td style="text-align: center;"><img src="<?php 
				  echo $imagesDir . 'moon' . $moonagedays; ?>.gif" 
				  alt="<?php $t1 =  moonphase($moonage) . ", Moon at $moonagedays days in cycle";
				  echo $t1; ?>" 
				  title="<?php echo $t1; ?>" 
				  width="48" height="48" style="border: 0;" />
			    </td>
              </tr>
The second is in the 'wxastronomy.php' page and is equal to the previous point, the mouseover is not translated as you can see:

Image

And these are the lines of code for the above situation:

Code: Select all

    <img src="moonicon.gif" width="104" height="72" 
	  alt="<?php print $moonage; ?>" title="<?php print $moonage; ?>"/></td>
     <?php } else { // ?>
    <img src="<?php echo $imagesDir . 'moon' . $moonagedays; ?>.gif" width="45" height="45"
	  alt="<?php print langtrans($moonage); ?>" title="<?php print langtrans($moonage); ?>"/></td>
     <?php } ?>
I appreciate any help in this matter! ;)
Kind Regards, Manuel.

Image
User avatar
saratogaWX
Posts: 1238
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: Lack of translation in Moon mousover

Post by saratogaWX »

The fix for the ajax-dashboard.php mouseover translation can be done (I think) by changing

Code: Select all

                <td style="text-align: center;"><img src="<?php
              echo $imagesDir . 'moon' . $moonagedays; ?>.gif"
              alt="<?php $t1 =  moonphase($moonage) . ", Moon at $moonagedays days in cycle";
              echo $t1; ?>"
              title="<?php echo $t1; ?>"
              width="48" height="48" style="border: 0;" />
             </td>
              </tr>
to

Code: Select all

                <td style="text-align: center;"><img src="<?php
              echo $imagesDir . 'moon' . $moonagedays; ?>.gif"
              alt="<?php $t1 =  langtransstr(moonphase($moonage)) . ", ".langtransstr("Moon at")."  $moonagedays ".langtransstr('days in cycle');
              echo $t1; ?>"
              title="<?php echo $t1; ?>"
              width="48" height="48" style="border: 0;" />
             </td>
              </tr>
since the phases are already in language-*.txt files. You'd need to add

Code: Select all

langlookup|Moon at|Moon at|
langlookup|days in cycle|days in cycle|
translations to the language-*.txt to finish the translation.

The mouseover on the wxastronomy.php page is much more difficult since the $moonage variable contains both fixed text and changing numbers, so can't be used successfully in a langtrans()/langtransstr() function since the content is not unchanging.
To do that, the $moonage would need to have 4 statements to successively replace (with langtransstr() calls) the words 'Moon age', 'days', 'hours' and 'minutes' and the corresponding langlookup entries added to language-* for those words. Seems like a lot of extra trouble for a mouseover, but it may make a nice programming exercise :)

Hope this helps...

Best regards,
Ken
Post Reply