Topic: multi language websites

I am building a website that will have an English version and a German version. Is there a correct way to do this? I have started it but am just building my pages, duplicating each, changing the language and links for each. I wonder if there is a proper way.

Re: multi language websites

I don't think there is necessarily a "right" and "wrong" way to go about this. If you are making a static website, duplicating the pages and updating the content is probably the best way.

Re: multi language websites

You could do a style sheet switcher. German display none. Switch, German display block, English display none.

Re: multi language websites

Eric wrote:

You could do a style sheet switcher. German display none. Switch, German display block, English display none.

Good idea -- I hadn't thought of that. However, it probably wouldn't work if the English site needed English file names, and the German site needed German file names... I suppose you could do some .htaccess work to rewrite the file names, but that sounds kinda tricky.

Re: multi language websites

Yeah, wouldn't know how to do that. You could of course change the menu names etc. You could give the file names a generick term that maybe made sense for both parties.

Re: multi language websites

Thanks for the replies and suggestions. I don't know what you mean by "style sheet switcher. German display none. Switch, German display block, English display none" How and where do you code that?

Re: multi language websites

catfish wrote:

Thanks for the replies and suggestions. I don't know what you mean by "style sheet switcher. German display none. Switch, German display block, English display none" How and where do you code that?

well you would implement a style switcher like one here... http://www.visibilityinherit.com/code/s … itcher.php

then you would put those rules I mentioned in their respective style sheets.

Re: multi language websites

Thanks, I'm going to have a look and play with it. I appreciate it.

9

Re: multi language websites

I wouldnt do any "style" switcher because it is a content changing (depending on language) going on here if to be precise.
So you just make 2 pages in both languages ( most effective is to have PHP includes - will help when you will need to update the pages) and have a special button  to switch to another language version.

One most useful thing for multilingual website could be IP analyzer (which opens, for example, German version of home page for people with german based IP's).

Last edited by lm (2009-08-09 08:41:31)

Re: multi language websites

Are you using a content management system like Wordpress or something?  If so, there may be plugins that will help you get the job done.  This one is for Wordpress:  http://www.poplarware.com/languageplugin.html .

Re: multi language websites

Susie wrote:

Are you using a content management system like Wordpress or something?  If so, there may be plugins that will help you get the job done.  This one is for Wordpress:  http://www.poplarware.com/languageplugin.html .

I'm using that one on my personal blog - it works great.

Re: multi language websites

lm wrote:

I wouldnt do any "style" switcher because it is a content changing (depending on language) going on here if to be precise.
So you just make 2 pages in both languages ( most effective is to have PHP includes - will help when you will need to update the pages) and have a special button  to switch to another language version.

One most useful thing for multilingual website could be IP analyzer (which opens, for example, German version of home page for people with german based IP's).

Why wouldn't you use a style sheet switcher? "because it is a content changing (depending on language) going on here if to be precise." ???

With a style sheet switcher, you can do it all with PHP includes as well. Say he switches over, now everywhere they travel (from page to page) they stay in German (or English depending on language spoken). When they go back to the site 10 days later, it's still presented in their preferred language.  I don't think one way is better here, just a different way of doing it. Each with their own positives and negatives...

Last edited by Eric (2009-08-09 11:45:45)

Re: multi language websites

Thankyou all for the replies. I did play a bit with the style switcher and managed it sortof. I didn't totally understand what I was doing with the 'German display block, English display none'

I haven't done much PHP so I don't understand the 'PHP includes' thing mentioned and this website is for a non paying friend so I haven't spent much time on it. I think I may just stick to making 2 pages of each in different languages.

Funny thing is that just days ago I was asked to do some updates on an existing website (for a paying client) and the one update is to have an Arabic version. Go figure!

Oh, and no I wasn't building it with CMS or Wordpress, but could look into that as well. Thanks

Last edited by catfish (2009-08-10 01:24:29)

Re: multi language websites

Like this...

The html page

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>{ visibility: inherit; } Testing</title>

<link href="default.css" rel="stylesheet" type="text/css">
<link href="alternate.css" rel="alternate stylesheet" type="text/css" title="alternate">
<script src="styleswitch.js" type="text/javascript"></script>

</head>
<body>

<a href="javascript:chooseStyle('none', 60)">English</a>
<a href="javascript:chooseStyle('alternate', 60)">German</a>

<div id="English"><?php include("includes/english.inc"); ?></div>
<div id="German"><?php include("includes/german.inc"); ?></div>

</body>
</html>

In the default style sheet...

#german{display:none;}

In the alternate style sheet...

#english{display:none;}
#german{display:block;}

In the PHP english.inc file...

<p>English Stuff</p>

In the PHP german.inc file...

<p>German Stuff</p>

And put all the JS in a file called...

styleswitch.js

And of course this is all explained in greater detail here and here.

Last edited by Eric (2009-08-10 07:27:21)

Re: multi language websites

Ok Eric, thankyou for the help. I have played abit with the php includes and the styleswitcher. It is a bit confusing even for me to explain what I did so I have uploaded and here is the link. http://mindyourelders.awardspace.com/trial-switcher.php
I have a folder with 3 .inc files in it english.inc  german.inc and  nav.inc 
Here is the code to one php page

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!-- saved from url=(0014)about:internet -->

<html>
<head>


<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>style switch and includes Testing</title>


<link href="default.css" rel="stylesheet" type="text/css">
<link href="alternate.css" rel="alternate stylesheet" type="text/css" title="alternate">
<script src="styleswitch.js" type="text/javascript"></script>



</head>
<body>

<div id="container">
<div id="header"></div>
<div id="navcontainer">
<ul id="navlist">
<?php include("includes/nav.inc"); ?>
</ul>

</div>
<div id="content">
<h1>Speedy Translations  - Herzlich willkommen! Welcome!</h1>

<a href="javascript:chooseStyle('none', 60)">English</a>
<a href="javascript:chooseStyle('alternate', 60)">German</a>

<div id="English"><?php include("includes/english.inc"); ?></div>
<div id="German"><?php include("includes/german.inc"); ?></div>
  </div>

     
<div id="footer">
  <p><strong>&copy; Speedy Translations<br>
     Tel:</strong> (02635 / 921140) <strong>Email</strong>   &nbsp;<a href="mailto:info@int-veen.de">info@speedy-translations.de</a><br>
    </p>
  </div>

</div>
</body>
</html>


smile

Re: multi language websites

Hi that link is not working for me. Have you created the JS, CSS, and .inc files? If so, it looks like it should work. Here is what I suggest. Get rid of php inludes for now. Worry about those later once you get it working. Less to think about.

Re: multi language websites

The link should be working now. I know it wasn't working for a bit when I looked yesterday as well. Wouldn't you know it that it's when you tried it. I thought I needed the english.inc and german.inc for it to work?

18

Re: multi language websites

I still think that this "style" switcher makes sense if you have small includes with the text in other languages.
To create fully functional website in 2 equal language versions it is better to have 2 full sets of HTML pages for each language ( with the link to other language on each page).
Once you done it, to make website easy updatable, look into how to use PHP includes.
If content for both languages needs frequent  updates, do use CMS - WordPress seems most likely to be useful here as it has this  plugin.

Re: multi language websites

It's not working - the only thing that switches is the background color, English and German are both displayed.  Look at the code -you have multiple sets of doctypes and html tags.  Also, the ä's, ö's, and ü's are showing up as odd symbols.  They should be written like "& uuml;" etc.

When you create the include parts, they only need what will actually be included - so no doctype, etc.  That and the body and html tag are likely in your 'master' page.

Re: multi language websites

One of the reasons it's not working is probably that in the HTML, you have <div id="German"> (upper case) but in the CSS you use #german (lower case) - don't forget, this stuff is case sensitive.

Re: multi language websites

Ah ha! Thankyou Thelma. It seems to work now.

I'm not sure which way I will do the site. Most of it is already built with 2 sets of pages, (english and german) with their correct navigation.

I just want to understand this though, If I use the style switcher for the website, would I need to create new english and german .inc files (with different names to hold the different content? I don't understand that.
<a href="javascript:chooseStyle('none', 60)">English</a>
<a href="javascript:chooseStyle('alternate', 60)">German</a>

<div id="english"><?php include("includes/english.inc"); ?></div>
<div id="german"><?php include("includes/german.inc"); ?></div>

Re: multi language websites

I don't see a point in using includes the German and English parts.  Includes make sense when the same thing is used on multiple pages (like headers, footers, and navigation, for example).

When you use the styleswitcher, it works by hiding parts.  Your English text is in a div called english, the German stuff in one called german.  The stylesheet that's applied when one clicks on 'english' hides the german div, and the stylesheet for 'german' hides the English Div.

One thing I'm wondering so - using the style switcher - as one moves through the site from page to page, will the next page automatically use the same style as one's picked on the current view, or will it default to one of the two?

Re: multi language websites

As Thelma said, there's not much point in using the includes unless they're going to be repeated. And yes, your language preference would be maintained as you navigate from page to page. And for the amount of time (in days) you wish. That's what the number does in the anchor. So when they come back to the site later, it's still in the language they picked last.

Re: multi language websites

I have done several sites in two or three languages and like LM I just use different html pages for each language.

Whichever method you use, it is a pain as every time there is an update it has to be done in both languages regardless of whether they are on 1 page or 2. That is something you need to take into account if you are updating the site for your client so you bill them for double the work.

Hopefully your client will provide you with the text in each language, not like me where they give me the English and expect me to translate to the other language as well.....

Re: multi language websites

Right, thank you all for the help and input. I think I am going in the right direction. Will carry on with html pages of each but once again have learned a few things along way - and yes both clients have the translated text ready for me as well.

Thanks again big_smile