Help with a website

This is a discussion on Help with a website within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hello! I'm trying to make a website like this in PHP if possible: 1. It will be multilanguage website ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-08-2006
belovah@gmail.com
 
Posts: n/a
Default Help with a website

Hello!

I'm trying to make a website like this in PHP if possible:

1. It will be multilanguage website
When you enter the site there will be 3 or 4 flags. When you click on
the English flag, the entire website will be in English or if you want
it to be French you click on the French flag and everything will be in
French.
(I think I could figure this out by myself but any help would be much
appreciated.)

2. Now this is the hard part. At least for me.
In the right bottom corner there would be a map of Europe with all of
the countries. And when you'd go over a country with your mouse a flag
and a country name would show up on the map and in the left top corner
a description of this country (some text).


Help me please!

Reply With Quote
  #2 (permalink)  
Old 02-08-2006
Domestos
 
Posts: n/a
Default Re: Help with a website


<belovah@gmail.com> wrote in message
news:1139410105.534444.195640@g44g2000cwa.googlegr oups.com...
> Hello!
>
> I'm trying to make a website like this in PHP if possible:
>
> 1. It will be multilanguage website
> When you enter the site there will be 3 or 4 flags. When you click on
> the English flag, the entire website will be in English or if you want
> it to be French you click on the French flag and everything will be in
> French.
> (I think I could figure this out by myself but any help would be much
> appreciated.)
>
> 2. Now this is the hard part. At least for me.
> In the right bottom corner there would be a map of Europe with all of
> the countries. And when you'd go over a country with your mouse a flag
> and a country name would show up on the map and in the left top corner
> a description of this country (some text).
>
>
> Help me please!
>


There is two ways... both will require you to enter your entire text in each
language in either a database table/s or in conditional PHP statements on
every page. You would then store the language selected as a master global
variable which you read in on the display of every page.




Reply With Quote
  #3 (permalink)  
Old 02-08-2006
Ben Bacarisse
 
Posts: n/a
Default Re: Help with a website

On Wed, 08 Feb 2006 06:48:25 -0800, belovah wrote:

> Hello!
>
> I'm trying to make a website like this in PHP if possible:
>
> 1. It will be multilanguage website
> When you enter the site there will be 3 or 4 flags. When you click on the
> English flag, the entire website will be in English or if you want it to
> be French you click on the French flag and everything will be in French.
> (I think I could figure this out by myself but any help would be much
> appreciated.)


You should seriously consider using your server's language negotiation
facilities. This will avoid any conditional PHP/database-driven
solutions.

--
Ben.

Reply With Quote
  #4 (permalink)  
Old 02-09-2006
rlee0001
 
Posts: n/a
Default Re: Help with a website

When the user clicks a flag, set a cookie called "lang" to an ISO
language code (or language/country code pair). For example 'en' for
english (or en-us for United States English). If the request contains
HTTP headers which identify the user's native language (as most do) you
can use that as a default and make the flags page optional.

At the top of every page do this:

<script src="/languages/<?php echo $_COOKIE['lang']; ?>_strings.js"
language="javascript">

Then create a folder called languages in your wwwroot. Inside this
folder create a .js file for each language, for example:

/language/en-us_strings.js
/language/fr-fr_strings.js
/language/es_sp_strings.js
....and so on...

Within each file define some VARs for each country. For example:

en-us_strings.js:

var us_name = 'United States';
var us_desc = 'Population: about 350 Million and so forth...';
var sp_name = 'Spain';
....and so on...

On page load build a polygon-based image map using PHP. Pull the shape
of each country from a database. Good luck finding such a database (I'm
sure something like this exists). Meanwhile on the client side...

Then on the onmouseover and onmouseout for each image map region swap
out the innerHTML property of a DIV at the top of the page with the
associated country_name variable defined by the .js file inserted.

If this post made no sense don't blame me. Blame it being 1:00am and my
lack of sleep. ;o)

-Robert

Reply With Quote
  #5 (permalink)  
Old 02-09-2006
Ben Bacarisse
 
Posts: n/a
Default Re: Help with a website

On Wed, 08 Feb 2006 22:43:36 -0800, rlee0001 wrote:

> When the user clicks a flag, set a cookie...


You replied to the wrong message, I think. It looks like you are
suggesting a solution to me.

--
Ben.

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:51 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0