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

Now available: AJAX/PHP multilingual website templates

Discussion of Ken True's web site templates

Moderator: saratogaWX

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: Now available: AJAX/PHP multilingual website templates

Post by saratogaWX »

n9mfk wrote:Hi Ken,
why is pressure trend arrow not on the ajax-gizmo.php?
Beau
In ajax-gizmo.php, the code

Code: Select all

			 if(isset($trend)) {
			  if($commaDecimal) {
				  $Tnow = preg_replace('|,|','.',gizmo_strip_units($baro));
				  $TLast = preg_replace('|,|','.',gizmo_strip_units($trend)); 
			   } else {
				  $Tnow = gizmo_strip_units($baro);
				  $TLast = gizmo_strip_units($trend); 
			   }
			   echo gizmo_gen_difference($Tnow, $Tnow-$TLast, '',
			   langtransstr('Rising') . ' %s '. $uomBaro . langtransstr($uomPerHour),
			   langtransstr('Falling') . ' %s ' . $uomBaro . langtransstr($uomPerHour) ); 
			 } 
determines how to diplay the trend arrow for pressure.

Looking at http://n9mfk.localweatherview.net/CU-defs.php?sce=view shows

Code: Select all

$trend = $WX['presstrendval'];
and http://n9mfk.localweatherview.net/CUtags.php?sce=dump shows

Code: Select all

$WX['presstrend'] = 'Falling';
$WX['presstrendval'] = '-0.012';
I found the prblem in ajax-gizmo and ajax-dashboard code that prevented the baro arrow from displaying properly if the difference was less than 0.1 , and both ajax-gizmo and ajax-dashboard have fixed updates which you can get from here.

Best regards,
Ken
n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: Now available: AJAX/PHP multilingual website templates

Post by n9mfk »

Hi Ken,
all updates work good Thanks
Beau
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by nitrx »

I saw that Ray forgot the this month extremes in his template so I've added it for your convience http://apeldoorn.tk/weer/wxcudataextremes.php?lang=en (I don't use it myself because I've them in seperate templates in my menu) the zip is attached you will have to ad one line to your local language translation

langlookup|Extreme Weather Data This Month|Extreme Weather Data This Month| the bold text should be translated for non english in your language-??.txt
You do not have the required permissions to view the files attached to this post.
Last edited by nitrx on Thu 24 Mar 2011 10:14 pm, edited 1 time in total.
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:

Re: Now available: AJAX/PHP multilingual website templates

Post by actioman »

Can someone help me to solve the following situation:

What add to the language of the header so that the banner is centered when we have selected the option Widescreen?
I've tried various ways, but the "XHTML 1.0" validation always gives me some error...

Here is the current and original code:

Code: Select all

<div id="page"><!-- page wrapper -->
<!-- header -->
    <div id="header">
      <h1 class="headerTitle">
        <a href="index.php" title="Browse to homepage"><img src="my-banner.jpg" alt="<?php langtrans($SITE['organ']); ?>" width="770" height="150" border="0" align="middle"/></a>
      </h1>	
	  <div class="headerTemp">
	    <span class="doNotPrint">
 		  <span class="ajax" id="ajaxbigtemp"><?php print isset($tempnodp)?"$tempnodp$tuom":"&nbsp;"; ?>
		  </span>
		</span>
 	  </div>

And this is how it looks:

Image


Thank you again! :)
Kind Regards, Manuel.

Image
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by mcrossley »

<h1 class="headerTitle" style="text-align: center;">

may do it? Though this should probably go in a CSS somewhere.
Last edited by mcrossley on Thu 24 Mar 2011 12:53 pm, edited 1 time in total.
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Now available: AJAX/PHP multilingual website templates

Post by gemini06720 »

gemini06720 wrote:...trying to understand the concept behind the GNU Translation Project 'gettext'...
actioman wrote:Ok, no hurry. If you can, very well. If you can not, well anyway!
Manuel, I must be doing something wrong... After two clean installations of Mike Challis 'Fast Secure Contact Form' scrit files, I cannot get the contact form to display in any other languages other than english, no matter which parameters I use... :evil:

I have not contacted Mike Challis yet as I want to find out by myself why the contact form will not display in french with the french language files already available/installed.

I have also noticed that Mike Challis' scripts do not play all that well when installed and run under XAMPP on a Windows platform - XAMPP = Apache HTTP Server, MySQL database, and interpreters for scripts written in the PHP and Perl languages. I also tried changing the name of the directory where the files are originally installed to (ie: 'contact-files') but, unfortunately, some paths seem to be hard coded into the script rather than relying on the path information variable as entered (declared) during installation... :(
actioman wrote:...I noticed however that you have a different font type. Yours is smaller and therefore looks better on the table.
Where can I change mine, if possible of course?...
Manuel, you should know by now that 'almost' every thing is possible - look at what you have accomplished over the past months, new web pages... :)

As you should be aware, the way much of the web page information is displayed on the screen is through the use of cascading style sheets or CSS - the cascading style sheets are used, not only to offer different colour themes, but also to position the information on the screen.

OK, here is how I do any changes/modifications to my pages without having to change a bunch of CSS files. I have created a new cascading style sheet which I have called 'weather-cumulus.css' and which only contains the properties I want to change on some or all the web pages displayed. So, I have added the following line to my 'weather-cumulus.css' file:

Code: Select all

body {
  font-family: "Trebuchet MS", verdana, helvetica, arial, sans-serif;
}
But, what is very important is that this 'weather-cumulus.css' file be loaded after all the other cascading style sheets have loaded, meaning that a line such as

Code: Select all

<link rel="stylesheet" href="weather-cumulus.css" media="screen" title="screen" />
be added to the end of the 'top.php' file. This way, all the other cascading style sheets are read and processed before this last one is read and modify whatever properties need to be modified (clear as mud... :mrgreen: ).
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Now available: AJAX/PHP multilingual website templates

Post by gemini06720 »

nitrx wrote:I saw that Ray forgot the this month extremes in his template so I've added it for your convience...
Ron, indeed, I had completely forgotten about the monthly extremes... :oops: ...got involved with other scripts and for got the month extremes.

Would you mind if I included your modification to the script I have been posting in this forum so everything is combined into one script, one package.

I also noticed and wondered why the month names were not translated on your page ... and I realised that there was not translation for the month names (nor for the day names) in any of the language files... :o ...I have never noticed that before as I have just imported the french language file I had been using for the past 2 years with my Weather Display templates - my 'language-fr.txt' is about 3 times the size of the 'language-en.txt' file!
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by nitrx »

gemini06720 wrote:
nitrx wrote:I saw that Ray forgot the this month extremes in his template so I've added it for your convience...
Ron, indeed, I had completely forgotten about the monthly extremes... :oops: ...got involved with other scripts and for got the month extremes.

Would you mind if I included your modification to the script I have been posting in this forum so everything is combined into one script, one package.

I also noticed and wondered why the month names were not translated on your page ... and I realised that there was not translation for the month names (nor for the day names) in any of the language files... :o ...I have never noticed that before as I have just imported the french language file I had been using for the past 2 years with my Weather Display templates - my 'language-fr.txt' is about 3 times the size of the 'language-en.txt' file!
I don't mind Ray , I was also wondering about the monthnames .
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Now available: AJAX/PHP multilingual website templates

Post by gemini06720 »

nitrx wrote:... I was also wondering about the monthnames ...
Ron, now you know... :D ...translation was never part of the language files... :(
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by nitrx »

gemini06720 wrote:
nitrx wrote:... I was also wondering about the monthnames ...
Ron, now you know... :D ...translation was never part of the language files... :(
Yes I looked it up , are these adapted from settings.php or from the local language of the PC where cumulus runs :?:
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Now available: AJAX/PHP multilingual website templates

Post by gemini06720 »

Find attached the latest release of the 'Weather Data' PHP script.

As indicated in a previous message, included in the ZIP archive are:
  • - 'wxcudata.php', the PHP script
    - 'wxcudata_language-en.txt', the file which contains all the english terms (words/phrases) contained in the template
    - 'wxcudata_language-fr.txt', the french translation
    - 'wxcudata_language-pt.txt', the portuguese translation - thank you Manuel
    - 'CUtags.txt' and 'CUtags-comments.txt', the files/templates containing all the webtags produced by Cumulus
ZIP archive 'Weather Data' was updated to version 1.4 on 24 Mars 2010:
  • - added the extremes for the month - thanks to Ron/nitrx for the suggestion
    - added translations for the month names
    - correction to one of the monthly tags
Last edited by gemini06720 on Fri 25 Mar 2011 1:10 am, edited 1 time in total.
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Now available: AJAX/PHP multilingual website templates

Post by gemini06720 »

gemini06720 wrote:
nitrx wrote:... I was also wondering about the monthnames ...
Ron, now you know... :D ...translation was never part of the language files... :(
nitrx wrote:Yes I looked it up , are these adapted from settings.php or from the local language of the PC where cumulus runs :?:
Ron, the translation of the month names (and a lot of other terms) comes from my 'Weather Display (PHP-AJAX) Website' french language file.

Ron, two years ago, when I worked on the development of the then so called 'Weather Display (PHP-AJAX) Website Templates - Canada Multilingual', I quickly realised that many english terms/expressions were not translating properly into french - and, as someone previously mentioned, I am quite sensitive (read, picky) about grammatically-incorrect language - "speak less but speak properly"! So, I expanded the 'language-fr.txt' file with the proper translations. :mrgreen:
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by nitrx »

Thanks Ray I've a look at your solution.
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Now available: AJAX/PHP multilingual website templates

Post by gemini06720 »

nitrx wrote:Thanks Ray I've a look at your solution.
Ron, you can add terms/expressions into your templates (with the 'langtrans()' or the 'langtransstr()' functions) and add the same terms/expressions into your 'language-nl.txt' (with the proper dutch translation) and the terms/expressions will be properly translated/displayed onto your web pages... ;)
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by nitrx »

gemini06720 wrote:Find attached the latest release of the 'Weather Data' PHP script.

As indicated in a previous message, included in the ZIP archive are:
  • - 'wxcudata.php', the PHP script
    - 'wxcudata_language-en.txt', the file which contains all the english terms (words/phrases) contained in the template
    - 'wxcudata_language-fr.txt', the french translation
    - 'wxcudata_language-pt.txt', the portuguese translation - thank you Manuel
    - 'CUtags.txt' and 'CUtags-comments.txt', the files/templates containing all the webtags produced by Cumulus
ZIP archive 'Weather Data' was updated 24 Mars 2010:
  • - added the extremes for the month - thanks to Ron/nitrx for the suggestion
    - added translations for the month names
Hmmz I tried this but only the months in the all-time extremes are changed in the translation I cheched this while I was trying to make separate templates. http://www.apeldoorn.tk/weer/wxcudatatry.php?lang=en
Post Reply