Jump to content

multi language websites


catfish

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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/style-sheet-switcher.php

 

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

Link to comment
Share on other sites

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).

Edited by lm
Link to comment
Share on other sites

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...

Edited by Eric
Link to comment
Share on other sites

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

Edited by catfish
Link to comment
Share on other sites

Like this...

 

The html page


{ visibility: inherit; } Testing








English
German






 

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...

English Stuff

 

In the PHP german.inc file...

German Stuff

 

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

styleswitch.js

 

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

Edited by Eric
Link to comment
Share on other sites

 

<?php include("includes/nav.inc"); ?>

 

Speedy Translations - Herzlich willkommen! Welcome!

 

English

German

 

<?php include("includes/english.inc"); ?>

<?php include("includes/german.inc"); ?>

 

 

© Speedy Translations

 

Tel: (02635 / 921140) Email  info@speedy-translations.de

 

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

English

German

 

<?php include("includes/english.inc"); ?>

<?php include("includes/german.inc"); ?>
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.....

Link to comment
Share on other sites

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 :D

Link to comment
Share on other sites

Hi, me again. I've had a little break from this issue of multi languages. Had decided (for the one site) to just build 2 pages for each language (or, you know what I mean) Susie had asked if I was using CMS for it and at the time I didn't think so but turns out now the one client wants me to. So, yes I have used CMSmade simple a few times now and may try to figure out that module. I just had a brief look at it and when I have installed CMS on this clients server I will work with it.

 

So, when the time comes, have you actually used the one in CMSmadesimple? It is called babel. Or have you just used the one in Wordpress and would you help me out when the time comes?

 

Thanks :D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...