Jump to content

English and spanish version of website?


eduard

Recommended Posts

I want to publish my website also in english (now it´s in spanish)! How do I do this? (so 2 buttons: english/spanish)www.eduardlid.com

Link to comment
Share on other sites

You could do this:

$lng = isset($_GET['lang']) ? "$_GET['lang'] : "en";if (!($lng == "en") && !($lng == "sp")) {  $lng = "en";}include $lng . ".php";

And then create to files:en.php and sp.phpand in both put$home = "Home";$about = "About";Also in span file:$home = "Casa";$about = "Sobre"; Etc.Then in code use this tags $home, $about etc.

Link to comment
Share on other sites

You could do this:
$lng = isset($_GET['lang']) ? "$_GET['lang'] : "en";if (!($lng == "en") && !($lng == "sp")) {  $lng = "en";}include $lng . ".php";

And then create to files:en.php and sp.phpand in both put$home = "Home";$about = "About";Also in span file:$home = "Casa";$about = "Sobre"; Etc.Then in code use this tags $home, $about etc.

Many thanks, but which programming language is it?
Link to comment
Share on other sites

PHP.You could do this with simple HTML pages, but this means you have to manually keep up your site design (HTML & CSS) cosistent across both languages, and if you want to have links for the same page in a different language, you'll have to manually create each one, and the corresponding link in the other language. That's a very tedious activity, but if you prefer to waste time doing plain HTML on every change, it as opposed to waste time learning and coding it in PHP once, so be it.

Link to comment
Share on other sites

PHP.You could do this with simple HTML pages, but this means you have to manually keep up your site design (HTML & CSS) cosistent across both languages, and if you want to have links for the same page in a different language, you'll have to manually create each one, and the corresponding link in the other language. That's a very tedious activity, but if you prefer to waste time doing plain HTML on every change, it as opposed to waste time learning and coding it in PHP once, so be it.
Many thanks! So I have to learn PHP!
Link to comment
Share on other sites

You could do this:
$lng = isset($_GET['lang']) ? "$_GET['lang'] : "en";if (!($lng == "en") && !($lng == "sp")) {  $lng = "en";}include $lng . ".php";

And then create to files:en.php and sp.phpand in both put$home = "Home";$about = "About";Also in span file:$home = "Casa";$about = "Sobre"; Etc.Then in code use this tags $home, $about etc.

I am in a hurry (because I have to earn money of my website! Could you insert the code in my html document and CSS document (included)? Thanks!HTML DOCUMENT:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><HTML><head><meta http-equiv="content-type" content="text/ html; charset=UTF-8"><title>Eduard Lid</title><link rel="stylesheet" type="text/css" href="ex1.css"></head><body><div class="header"><a href="http://www.eduardlid.com/book/mine.html">Libro</a><a href="http://www.viadeo.com/es/profile/eduard.lid">Perfil</a></div><div id="main"><img src="images/me.JPG" alt="Eduard Lid" align="right" width="373" height="279"></div><div class="footer"><p class="sansserif">Eduard Lid</p><h6>Este sitio web es hecho por Eduard Lid ©</h6></div></body></HTML>CSS document:body{margin:0px;padding:0px;}div.header{background-color:#98fb98;height:200px;}a:link{color:#ffd700;}a:visited{color:#0000ff;}a:hover{color:#ffcc00;}a:hover{color:#ffcc00}div#main{height:240px;background-color:#ffffff;padding:0px;margin:0px;}div.footer{background-color:#98fb98;height:200px;text-align:center;}p{font-family: verdana, Geneva, sans-serif;font-size:40px;color:#00008b;}h5{text-align:center;color:#dc143c;font-family: Verdana, Geneva, sans-serif;}
Link to comment
Share on other sites

Do it in the "no PHP" way then. The PHP way requires you take the time to organize your content properly, and then create the PHP code accordingly. It's less hassle once it is set up, but you MUST sacrifice some time initially. It's not a copy&paste thing.If you want a copy&paste thing, you might as well as get yourself a "CMS" (google it).

Link to comment
Share on other sites

Do it in the "no PHP" way then. The PHP way requires you take the time to organize your content properly, and then create the PHP code accordingly. It's less hassle once it is set up, but you MUST sacrifice some time initially. It's not a copy&paste thing.If you want a copy&paste thing, you might as well as get yourself a "CMS" (google it).
Thanks! But what should I copy&paste (the codes which are written before?) and in what (my html document)?
Link to comment
Share on other sites

A "CMS" is a full "Content Management System" - a complete ready-to-install-and-use site if you will. You'll have to scrap everything you have, maybe redo your design for the CMS (if you REALLY want your site to look as it does now; otherwise, you can stick to default templates the CMS has).Which CMS to choose? See this list, and pick one of the PHP CMS-es. They all have similar features, good and bad features, but they can all do what you currently want a CMS for.How to install it? Read the instructions on the site of the CMS of your choice.Can't do the instructions? Well... that's one use of a web developer's time. You may want to actually hire someone to set it up for you.

Link to comment
Share on other sites

A "CMS" is a full "Content Management System" - a complete ready-to-install-and-use site if you will. You'll have to scrap everything you have, maybe redo your design for the CMS (if you REALLY want your site to look as it does now; otherwise, you can stick to default templates the CMS has).Which CMS to choose? See this list, and pick one of the PHP CMS-es. They all have similar features, good and bad features, but they can all do what you currently want a CMS for.How to install it? Read the instructions on the site of the CMS of your choice.Can't do the instructions? Well... that's one use of a web developer's time. You may want to actually hire someone to set it up for you.
Many thanks!
Link to comment
Share on other sites

Do it in the "no PHP" way then. The PHP way requires you take the time to organize your content properly, and then create the PHP code accordingly. It's less hassle once it is set up, but you MUST sacrifice some time initially. It's not a copy&paste thing.If you want a copy&paste thing, you might as well as get yourself a "CMS" (google it).
Installing a CMS is complicated! Can I do the english version by PHP in some days????
Link to comment
Share on other sites

In theory yes, but in practice, if you find the installation of a CMS hard, you'll have a harder time doing it with "stand alone" PHP.

Link to comment
Share on other sites

A "CMS" is a full "Content Management System" - a complete ready-to-install-and-use site if you will. You'll have to scrap everything you have, maybe redo your design for the CMS (if you REALLY want your site to look as it does now; otherwise, you can stick to default templates the CMS has).Which CMS to choose? See this list, and pick one of the PHP CMS-es. They all have similar features, good and bad features, but they can all do what you currently want a CMS for.How to install it? Read the instructions on the site of the CMS of your choice.Can't do the instructions? Well... that's one use of a web developer's time. You may want to actually hire someone to set it up for you.
It is very difficult to find a CMS for my Apple computer (I found Joomla), but is very difficult to install. But can´t I just add the PHP code to my HTML document?I don´t have any money now!(I got the above answer before!)
Link to comment
Share on other sites

Like I said, yes, you can indeed just add PHP code your HTML document. The question is what code to add. There's no universal copy&paste code we can give you, which is why you are expected to take the time to learn PHP if you are to go on that route. You can do it the "no PHP" way now, and add PHP later, but that too may not be easy.The installation of different CMS-es is pretty much the same, but you need to figure it out once. Install one CMS, and you'll be capable of installing any other CMS after that.PHP applications, CMS-es being such, do not depend on the computer they're on. All CMS-es can run on your Apple computer. All you need is to install Apache, PHP and MySQL for them to run the thing. All of those are available for a MAC, and there are even packages like XAMPP and MAMP that make it easy to install of those at once.

Link to comment
Share on other sites

Like I said, yes, you can indeed just add PHP code your HTML document. The question is what code to add. There's no universal copy&paste code we can give you, which is why you are expected to take the time to learn PHP if you are to go on that route. You can do it the "no PHP" way now, and add PHP later, but that too may not be easy.The installation of different CMS-es is pretty much the same, but you need to figure it out once. Install one CMS, and you'll be capable of installing any other CMS after that.PHP applications, CMS-es being such, do not depend on the computer they're on. All CMS-es can run on your Apple computer. All you need is to install Apache, PHP and MySQL for them to run the thing. All of those are available for a MAC, and there are even packages like XAMPP and MAMP that make it easy to install of those at once.
Thanks! I´ll do it the PHP way! But can I use the PHP codes Harris S wrote (see above 1st reply)?
Link to comment
Share on other sites

If you structure your pages accordingly, I suppose yes. That code is for one type of structure. Other structures will require other code. The plain HTML you currently have has no "structure" in the PHP sence. It could be turned into such, but again - you need to take the time to set it up.What I'm trying to say in the last few posts is that everything requires "know how" or "payment". "know how" is only achieved with time, trial&error. Take the time to do trial&error on something. We already went over the possibilities. They're all equally good, but they require different levels of time investment, with the CMS being the least time consuming option IF you read the instructions and can follow them.

Link to comment
Share on other sites

If you structure your pages accordingly, I suppose yes. That code is for one type of structure. Other structures will require other code. The plain HTML you currently have has no "structure" in the PHP sence. It could be turned into such, but again - you need to take the time to set it up.What I'm trying to say in the last few posts is that everything requires "know how" or "payment". "know how" is only achieved with time, trial&error. Take the time to do trial&error on something. We already went over the possibilities. They're all equally good, but they require different levels of time investment, with the CMS being the least time consuming option IF you read the instructions and can follow them.
Many thanks for your explanation!
Link to comment
Share on other sites

You could do this:
$lng = isset($_GET['lang']) ? "$_GET['lang'] : "en";if (!($lng == "en") && !($lng == "sp")) {  $lng = "en";}include $lng . ".php";

And then create to files:en.php and sp.phpand in both put$home = "Home";$about = "About";Also in span file:$home = "Casa";$about = "Sobre"; Etc.Then in code use this tags $home, $about etc.

Hi Harris S.,I now can upload my files to the FTP server of the hosting company, but I also read that the expiry date for my free (fast!) FTP uploader expires 26 11 (friday). Is it difficult to add the PHP code written by you adding to my HTML document and do I have to learn PHP (some say yes!)?Regards,Eduard
Link to comment
Share on other sites

You could always get a new free FTP uploader, it's not the biggest problem here I guess. Learn a bit of PHP. If you do not want to learn PHP you could always make something like index.htm (which is english),and if the user clicks on a spanish flag/link for a spanish version you can link him toindexspa.htmYou'd have to make each page twice tho, one english and one spanish version. But it's the easiest way with HTML i think. Do you understand? I see you are dutch so here a dutch explanation:Als je geen php wilt leren, kan je altijd 2 versies van je website maken. Een engelse, en een spaanse. De homepage maak je dan bijvoorbeeld standaard engels,http://www.eduardlid.com/en als de gebruiker dan op een spaanse vlag/link klikt, dan kan je hem directen naarhttp://www.eduardlid.com/spaDan moet je wel elke pagina zowel in het spaans als in het engels maken, maar dat moest je toch zoiezo al. Om wat advies over de pagina in het algemeen te gevenJe zou de foto mischien in het midden willen zetten, een voorbeeld van hoe ik het zou doen (vergeet niet je oude code op te slaan als je dit gaat proberen):THE HTML FILE

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">  <HTML>  <head> <meta http-equiv="content-type" content="text/ html; charset=UTF-8"> <title>Eduard Lid</title> <link rel="stylesheet" type="text/css" href="ex1.css"> </head>  <body> <center><div class="header" ><div style="height:3em; width:0; vertical-align:middle; display:inline;"></div><p style="font-size:15px;"><a href="http://www.eduardlid.com/book/mine.html" style="vertical-align:middle;">Libro</a> </p><p style="font-size:15px;"><a href="http://www.viadeo.com/es/profile/eduard.lid">Perfil</a> </p></div> </center><center><div id="main"> <img src="images/me.JPG"  alt="Eduard Lid" width="373" height="279"> </div>  </center> <div class="footer"> <p class="sansserif">Eduard Lid</p> <h6>Este sitio web es hecho por Eduard Lid ©</h6> </div>  </body>  </HTML>

THE CSS (ex1.css) FILE

body{margin:0px;padding:0px;}div.header{background-color:#98fb98;height:80px;}a:link{color:#ffd700;}a:visited{color:#0000ff;}a:hover{color:#ffcc00;}a:hover{color:#ffcc00}div#main{height:240px;background-color:#ffffff;padding:0px;margin:0px;}div.footer{background-color:#98fb98;height:200px;text-align:center;}p{font-family: verdana, Geneva, sans-serif;font-size:40px;color:#00008b;}h5{text-align:center;color:#dc143c;font-family: Verdana, Geneva, sans-serif;}

Link to comment
Share on other sites

You could always get a new free FTP uploader, it's not the biggest problem here I guess. Learn a bit of PHP. If you do not want to learn PHP you could always make something like index.htm (which is english),and if the user clicks on a spanish flag/link for a spanish version you can link him toindexspa.htmYou'd have to make each page twice tho, one english and one spanish version. But it's the easiest way with HTML i think. Do you understand? I see you are dutch so here a dutch explanation:Als je geen php wilt leren, kan je altijd 2 versies van je website maken. Een engelse, en een spaanse. De homepage maak je dan bijvoorbeeld standaard engels,http://www.eduardlid.com/en als de gebruiker dan op een spaanse vlag/link klikt, dan kan je hem directen naarhttp://www.eduardlid.com/spaDan moet je wel elke pagina zowel in het spaans als in het engels maken, maar dat moest je toch zoiezo al. Om wat advies over de pagina in het algemeen te gevenJe zou de foto mischien in het midden willen zetten, een voorbeeld van hoe ik het zou doen (vergeet niet je oude code op te slaan als je dit gaat proberen):THE HTML FILE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">  <HTML>  <head> <meta http-equiv="content-type" content="text/ html; charset=UTF-8"> <title>Eduard Lid</title> <link rel="stylesheet" type="text/css" href="ex1.css"> </head>  <body> <center><div class="header" ><div style="height:3em; width:0; vertical-align:middle; display:inline;"></div><p style="font-size:15px;"><a href="http://www.eduardlid.com/book/mine.html" style="vertical-align:middle;">Libro</a> </p><p style="font-size:15px;"><a href="http://www.viadeo.com/es/profile/eduard.lid">Perfil</a> </p></div> </center><center><div id="main"> <img src="images/me.JPG"  alt="Eduard Lid" width="373" height="279"> </div>  </center> <div class="footer"> <p class="sansserif">Eduard Lid</p> <h6>Este sitio web es hecho por Eduard Lid ©</h6> </div>  </body>  </HTML>

THE CSS (ex1.css) FILE

body{margin:0px;padding:0px;}div.header{background-color:#98fb98;height:80px;}a:link{color:#ffd700;}a:visited{color:#0000ff;}a:hover{color:#ffcc00;}a:hover{color:#ffcc00}div#main{height:240px;background-color:#ffffff;padding:0px;margin:0px;}div.footer{background-color:#98fb98;height:200px;text-align:center;}p{font-family: verdana, Geneva, sans-serif;font-size:40px;color:#00008b;}h5{text-align:center;color:#dc143c;font-family: Verdana, Geneva, sans-serif;}

Hartelijk dank!(woon je in of vlakbij Dordrecht?)
Link to comment
Share on other sites

Nee helaas niet vlakbij Dordrecht maar rond Leiden. En zaterdag ga ik verhuizen naar Amerika dus dat schiet ook niet echt op!
Ik vroeg dat, omdat Dubbeldam is (nu) een wijk in Dordrecht. Waar ga je naar toe in de ´States´?
Link to comment
Share on other sites

Hartelijk dank!
Many thanks for the codes and hints! What I don´t understand properly in what way I should make the homepage so that visitors can either chose english or spanish? (het is een engelstalig forum!)
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...