Page 2 of 2
Re: Dual Language website
Posted: Sat 06 Mar 2010 10:40 am
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
Re: Dual Language website
Posted: Sat 06 Mar 2010 5:03 pm
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.
Re: Dual Language website
Posted: Thu 03 Feb 2011 12:53 am
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
Re: Dual Language website
Posted: Thu 03 Feb 2011 9:17 am
by Synewave
Thanks George. You're welcome to pinch my scripts.
Re: Dual Language website
Posted: Sun 13 Feb 2011 1:51 pm
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
Re: Dual Language website
Posted: Mon 02 Jan 2012 4:54 pm
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