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

Dual Language website

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

Moderator: daj

Synewave
Posts: 642
Joined: Mon 25 Jan 2010 1:55 pm
Weather Station: Watson W-8681
Operating System: Raspian
Location: Brighton, UK
Contact:

Re: Dual Language website

Post by Synewave »

Well after a lot of tinkering, I've got most of my dual language website working for lehamel.eu .

I must thank daj and beteljuice for the french version templates from the wiki.

There are just a few other things I'd like to achieve, for example translate the moon phase wording from English to French.

I'm aware I can use the translated versions of the strings.ini file but then that would change my english site to french (as I am only running one instance of Cumulus for lehamel.eu .

I'm thinking using javascript to change the value of <#moonphase> to french after the index.htm file has been processed by Cumulus.

Having never really coded javascript myself, can anyone help on how to achieve this, or is javascript the wrong approach?

Paul
Synewave
Posts: 642
Joined: Mon 25 Jan 2010 1:55 pm
Weather Station: Watson W-8681
Operating System: Raspian
Location: Brighton, UK
Contact:

Re: Dual Language website

Post by Synewave »

Well I've got there in the end, and taught myself a bit of javascript!

The code I've inserted where the <#moonphase> variable would go in the indexT.htm is:

<script type="text/javascript" language="JavaScript">
moonphasefr = "<#moonphase>";
var moonphasefr = moonphasefr.replace( /Waning Gibbous/g, "Lune gibbeuse décroissante" );
var moonphasefr = moonphasefr.replace( /New Moon/g, "Nouvelle Lune" );
var moonphasefr = moonphasefr.replace( /Waxing Crescent/g, "Premier Croissant" );
var moonphasefr = moonphasefr.replace( /First Quarter/g, "Premier Quartier" );
var moonphasefr = moonphasefr.replace( /Full Moon/g, "Pleine Lune" );
var moonphasefr = moonphasefr.replace( /Last Quarter/g, "Dernier Quartier" );
var moonphasefr = moonphasefr.replace( /Waning Crescent/g, "Dernier Croissant" );
var moonphasefr = moonphasefr.replace( /Waxing Gibbous/g, "Lune Gibbeuse décroissante" );
document.write(moonphasefr);
</script>

Seems to work OK. Now I shall do the French translations for Steady/Rising/Falling etc.
m0clx
Posts: 15
Joined: Sat 13 Mar 2010 12:46 pm
Weather Station: Watson W-8681
Operating System: XP
Location: Fulda, Germany

Re: Dual Language website

Post by m0clx »

Thanks for that Paul! am in the process of setting up a dual language (engl/german) site too. Your discussion really helped- didn't suffer the ftp problems tho. Plan to pinch your Java script for the moon phases- thanks for posting it.
Have taken the lazy approach for the forcast text and just added to the strings.ini entries.
Think your site looks great!

George
Synewave
Posts: 642
Joined: Mon 25 Jan 2010 1:55 pm
Weather Station: Watson W-8681
Operating System: Raspian
Location: Brighton, UK
Contact:

Re: Dual Language website

Post by Synewave »

Thanks George. You're welcome to pinch my scripts.
m0clx
Posts: 15
Joined: Sat 13 Mar 2010 12:46 pm
Weather Station: Watson W-8681
Operating System: XP
Location: Fulda, Germany

Re: Dual Language website

Post by m0clx »

Pinched script- substituted german txt and is now up and running - works a treat :-) thanks again Paul
Highly recommend this - I just need to do it for the trends and forecast now...
thanks again Paul
rgds
George
m0clx
Posts: 15
Joined: Sat 13 Mar 2010 12:46 pm
Weather Station: Watson W-8681
Operating System: XP
Location: Fulda, Germany

Re: Dual Language website

Post by m0clx »

Finally got round to doing the scripts for the second language pages. Both pages look much better now.
Thanks again Paul - super solution to running a dual language website :)
George
Post Reply