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

Translate $ tomorrowdaylength?

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

Post Reply
MeteoBisignano
Posts: 79
Joined: Mon 09 Mar 2015 10:45 am
Weather Station: wh3080
Operating System: windows
Location: Cosenza

Translate $ tomorrowdaylength?

Post by MeteoBisignano »

Good Sunday to all
I wanted to ask how do I make it into another language (Italian) the
following WebTAG Cumulus $ tomorrowdaylength?
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Translate $ tomorrowdaylength?

Post by steve »

If you want to translate it, you'll have to parse the string and convert it yourself.
Steve
MeteoBisignano
Posts: 79
Joined: Mon 09 Mar 2015 10:45 am
Weather Station: wh3080
Operating System: windows
Location: Cosenza

Re: Translate $ tomorrowdaylength?

Post by MeteoBisignano »

steve wrote:If you want to translate it, you'll have to parse the string and convert it yourself.
Hi Steve and good Sunday.
Unfortunately I do not remember the file to edit, do not even remember its location
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Translate $ tomorrowdaylength?

Post by steve »

It's not in any files that are supplied with Cumulus, it is simply a web tag - <#tomorrowdaylength> - so I can't help with you with what file it is in. If you're using the web tag already, it must be in a file that you have told Cumulus to process, on the files tab of the internet settings. The fact that you have used a '$' rather than the usual web tag format suggests that it may be in a PHP file.
Steve
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: Translate $ tomorrowdaylength?

Post by laulau »

This php fonction converts $DL ($tomorrowdaylength) in +- Xmin XXs
Capt.JPG

Code: Select all

function CVRTDAYL($DL) {
	$marqueurDL = "be ";
	$debutDL = strpos( $DL, $marqueurDL ) + strlen( $marqueurDL );
	
	$sign = "- ";
	$finDL = strpos( $DL, " less" );
	if ($finDL == 0)
		{
		$sign = "+ ";
		$finDL = strpos( $DL, " more" );
		}

	$textDL = substr( $DL, $debutDL, $finDL - $debutDL );
	 return $sign.$textDL;
	}
You do not have the required permissions to view the files attached to this post.
Laurent

Image
MeteoBisignano
Posts: 79
Joined: Mon 09 Mar 2015 10:45 am
Weather Station: wh3080
Operating System: windows
Location: Cosenza

Re: Translate $ tomorrowdaylength?

Post by MeteoBisignano »

laulau wrote:This php fonction converts $DL ($tomorrowdaylength) in +- Xmin XXs
Capt.JPG

Code: Select all

function CVRTDAYL($DL) {
	$marqueurDL = "be ";
	$debutDL = strpos( $DL, $marqueurDL ) + strlen( $marqueurDL );
	
	$sign = "- ";
	$finDL = strpos( $DL, " less" );
	if ($finDL == 0)
		{
		$sign = "+ ";
		$finDL = strpos( $DL, " more" );
		}

	$textDL = substr( $DL, $debutDL, $finDL - $debutDL );
	 return $sign.$textDL;
	}



I inserted the function suggested in the file that processes Cumulus (wt_data_intl.php) but it does not happen nulla.Evidentemente mistake to add in the right place
Last edited by MeteoBisignano on Mon 16 Mar 2015 9:20 am, edited 1 time in total.
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: Translate $ tomorrowdaylength?

Post by laulau »

Hi,
If you are using a 'cumuluwebtags.php' file with all the webtags or something equivalent, just put it at the end of the file and create a new variable that calls the function:

Code: Select all

$tomorrowdaylength    = "<#tomorrowdaylength>";  //  string giving the difference between the length of day today and tomorrow
$tomorrowDL           =CVRTDAYL($tomorrowdaylength)
If you include the cumuluwebtags.php in a web page you can then use $tomorrowDL instead of $tomorrowdaylength
Laurent

Image
MeteoBisignano
Posts: 79
Joined: Mon 09 Mar 2015 10:45 am
Weather Station: wh3080
Operating System: windows
Location: Cosenza

Re: Translate $ tomorrowdaylength?

Post by MeteoBisignano »

laulau wrote:Hi,
If you are using a 'cumuluwebtags.php' file with all the webtags or something equivalent, just put it at the end of the file and create a new variable that calls the function:

Code: Select all

$tomorrowdaylength    = "<#tomorrowdaylength>";  //  string giving the difference between the length of day today and tomorrow
$tomorrowDL           =CVRTDAYL($tomorrowdaylength)
If you include the cumuluwebtags.php in a web page you can then use $tomorrowDL instead of $tomorrowdaylength

As suggested I put the function in the bottom of the page like this:
  $LatestErrorTime = "<#LatestErrorTime>"; // The time of the latest error logged to the error log window, using the system short time format. Gives a when dashes latest error is reset

CVRTDAYL function ($ DL) {
    $marqueurDL = "be";
    $debutDL = strpos ($ DL, $marqueurDL) + strlen ($marqueurDL);
   
    $sign = "-";
    $Findl = strpos ($ DL, "less");
    if ($ Findl == 0)
       {
       $ sign = "+";
       $ Findl = strpos ($ DL, "more");
       }

    $ textDL = substr ($ DL, $ debutDL, Findl $ - $ debutDL);
     return $ sign. $ textDL;
    }
//====================================================================================================================
//
$tomorrowDL = CVRTDAYL ( $tomorrowdaylength)

?>

but does not work
MeteoBisignano
Posts: 79
Joined: Mon 09 Mar 2015 10:45 am
Weather Station: wh3080
Operating System: windows
Location: Cosenza

Re: Translate $ tomorrowdaylength?

Post by MeteoBisignano »

the WebTAG

$ tomorrowDL = CVRTDAYL ($ tomorrowdaylength)

must be included, or so we must add also:

$ tomorrowDL = <"CVRTDAYL ($ tomorrowdaylength)">; ?

The function previously attached is inserted in the file cumuluwebtag.php beginning or at the end of the code? It must be so set?
<? php function CVRTDAYL ($ DL) {
    $ marqueurDL = "be";
    $ debutDL = strpos ($ DL, $ marqueurDL) + strlen ($ marqueurDL);
   
    $ sign = "-";
    $ Findl = strpos ($ DL, "less");
    if ($ Findl == 0)
       {
       $ sign = "+";
       $ Findl = strpos ($ DL, "more");
       }

    $ textDL = substr ($ DL, $ debutDL, Findl $ - $ debutDL);
     return $ sign. $ textDL;
    };?>

Thanks for your patience and help meticulous
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: Translate $ tomorrowdaylength?

Post by laulau »

The link to my cumuluswebtags.php : http://meteo.laurentmey.fr/php/cumulusw ... ource=view

And in my web pages :

Code: Select all

<?php 
 require_once("cumuluswebtags.php");
?>
Laurent

Image
MeteoBisignano
Posts: 79
Joined: Mon 09 Mar 2015 10:45 am
Weather Station: wh3080
Operating System: windows
Location: Cosenza

Re: Translate $ tomorrowdaylength?

Post by MeteoBisignano »

Now it works perfectly.
Thank you for your patience and precision demonstrated.
I had a look at your site and I noticed a dial dashboard 2.5.5
I wanted to know how do I add the graph "Base clouds" in section trend.php?
Thanks again for the support
Weather Station bisignano.it
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: Translate $ tomorrowdaylength?

Post by laulau »

Laurent

Image
MeteoBisignano
Posts: 79
Joined: Mon 09 Mar 2015 10:45 am
Weather Station: wh3080
Operating System: windows
Location: Cosenza

Re: Translate $ tomorrowdaylength?

Post by MeteoBisignano »

He tells me that "are not authorized to view the page"
duke

Re: Translate $ tomorrowdaylength?

Post by duke »

MeteoBisignano wrote:
He tells me that "are not authorized to view the page"
Yes, you do not have access to the MX part of the forum.
Post Reply