Voting Chart

Total votes : 2

Which approach would you use to design your multilingual site?

Poll ended at December 21st, 2003, 1:04 am.

  •  
    Separate all code and have separately maintained HTML files for each language?
  •  
    Single HTML page for all languages using a 'gettext' approach.

Designing a multilingual website

  • Kinslayer
  • Born
  • Born
  • Kinslayer
  • Posts: 2
  • Loc: South Africa

Post 3+ Months Ago

Hi.

I'm about to start work on a new site which needs to be accessible in multiple languages. At the momment I'm trying to decide between two ways of implementing this, but any other suggestions are of course welcome.

The idea is that I will be responsible for the design and content creation of the site, and I can have any number of translators who will correctly and idiomatically translate (i.e. computer translation is out) the pages I've already done.

As said, I see two ways of doing this:

1) Separate all lay-out and code using something like Smarty. I can then have root directory structures per language, give per user ftp access to these dirs, language admins will receive a copy of the 'native language' html files (which has no php inside) and can translate and re-upload. I could then also write a script to compare the last modification time of these files compared to the native originals so lang admins can see what's been updated, what's left to do, etc.

2) Take a kind of gettext approach. Have one html file for all languages with codified keywords, which will be displayed according to the users language. The code key database will be in mySQL, and with a PHP Accelerator I reckon the load won't be too bad. This is a bitch to design, but, it is much easier for lang admins to keep the translations up to date, especially if there are just design changes (i.e. no real translation work to be done) and, if new stuff is added, it can just display the 'native language' version of the code.

So unless anyone has any other ideas, the toss up is between (1) which is MUCH easier to design, but significantly harder to maintain, or (2) which is going to be quite a mission to write (especially if there is alot of PHP code between or inside of paragraphs) but could be maintained with simple webforms, etc, + the other advantages mentioned above.

Any thoughts?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • musik
  • Legend
  • Super Moderator
  • User avatar
  • Posts: 6893
  • Loc: up a tree

Post 3+ Months Ago

Hi,

I just finished a multi-language site for a client, I found it much easier to separate the site into sections - given that it needed different headings and text, buttons etc that were in Chinese (in this case).

I would not recommend using an online translator as they are very ammuture in their translation of true language definition. My advice would be to hire a translator who can translate the text properly and either cut & paste it into the site - or display the text as an image file (which is what I ended up doing for those who didnt have the SimSun font installed).

Good luck with it all

Rose :D


PS: Please refrain from swearing as it is an all ages board. Cheers eh and welcome to Ozzu :D
  • Johan007
  • Guru
  • Guru
  • User avatar
  • Posts: 1080
  • Loc: Aldershot, UK

Post 3+ Months Ago

I worked on the one site. We thought it is better to separate it in terms of HTML lan-en and the Japanies equivalent had to be on separate pages. This also helps Search engines know what language the site is aimed at.

I have also done a ASP website where code was used to separate Welsh / English http://ucac.eteach.com/hosted/ucac/Default.asp?lang=cy
  • Kinslayer
  • Born
  • Born
  • Kinslayer
  • Posts: 2
  • Loc: South Africa

Post 3+ Months Ago

Well, finally decided to go for option 2, because this approach has already been quite well written by someone else, and does actually use gettext so I can just hand my translators .po files to be edited with standard po editors.

Check out: http://smarty.incutio.com/?page=Smartes ... ageSupport

This lets you have stuff like {t}Hi and welcome to the site, etc.{/t} block tags in your templates, automatically builds .po files from them, can automatically retreive untranslated languages from babelfish on altavista, and obviously replaces the stuff with the requested language at run time.

Kudos to the author! I reckon the overhead shuoldnt be too bad if I have something like PHP Accelerator. This leaves only two other problems:

1) select fields in forms for stuff like city name in local language
-> gonna use babelkit for this, what its meant for anyway

2) maintaining translations for dynamic content like news updates,, etc
-> have my own solution for this, shouldnt be too hard to code.

Anyways
have fun
  • Falk
  • Born
  • Born
  • Falk
  • Posts: 3

Post 3+ Months Ago

Hi,

although it is some time ago that you wrote your mail below I would like to come back to it.
It is very interesting what you wrote, as I have just the same problem now!!

I would be interested in the decision and solution you choosed. To be honest - I would choose your version 2. Speed won't be the problem, I suppose. And it is very nerving if you have lots of trouble later when maintaining the site.

And maybe one should not have this big 'mission' with coding php into your pages at each location where static text strings have to be referenced to the database... IF this process could be done *automatically*. And I think it could!? Trying to use a software tool?
It defintily should work, shouldn't it?

Best regards, Falk


Kinslayer wrote:
Hi.

I'm about to start work on a new site which needs to be accessible in multiple languages. At the momment I'm trying to decide between two ways of implementing this, but any other suggestions are of course welcome.

The idea is that I will be responsible for the design and content creation of the site, and I can have any number of translators who will correctly and idiomatically translate (i.e. computer translation is out) the pages I've already done.

As said, I see two ways of doing this:

1) Separate all lay-out and code using something like Smarty. I can then have root directory structures per language, give per user ftp access to these dirs, language admins will receive a copy of the 'native language' html files (which has no php inside) and can translate and re-upload. I could then also write a script to compare the last modification time of these files compared to the native originals so lang admins can see what's been updated, what's left to do, etc.

2) Take a kind of gettext approach. Have one html file for all languages with codified keywords, which will be displayed according to the users language. The code key database will be in mySQL, and with a PHP Accelerator I reckon the load won't be too bad. This is a bitch to design, but, it is much easier for lang admins to keep the translations up to date, especially if there are just design changes (i.e. no real translation work to be done) and, if new stuff is added, it can just display the 'native language' version of the code.

So unless anyone has any other ideas, the toss up is between (1) which is MUCH easier to design, but significantly harder to maintain, or (2) which is going to be quite a mission to write (especially if there is alot of PHP code between or inside of paragraphs) but could be maintained with simple webforms, etc, + the other advantages mentioned above.

Any thoughts?
  • Falk
  • Born
  • Born
  • Falk
  • Posts: 3

Post 3+ Months Ago

Hi,

although it is some time ago that you wrote your mail below I would like to come back to it.
It is very interesting what you wrote, as I have just the same problem now!!

I would be interested in the decision and solution you choosed. To be honest - I would choose your version 2. Speed won't be the problem, I suppose. And it is very nerving if you have lots of trouble later when maintaining the site.

And maybe one should not have this big 'mission' with coding php into your pages at each location where static text strings have to be referenced to the database... IF this process could be done *automatically*. And I think it could!? Trying to use a software tool?
It defintily should work, shouldn't it?

Best regards, Falk


Kinslayer wrote:
Hi.

I'm about to start work on a new site which needs to be accessible in multiple languages. At the momment I'm trying to decide between two ways of implementing this, but any other suggestions are of course welcome.

The idea is that I will be responsible for the design and content creation of the site, and I can have any number of translators who will correctly and idiomatically translate (i.e. computer translation is out) the pages I've already done.

As said, I see two ways of doing this:

1) Separate all lay-out and code using something like Smarty. I can then have root directory structures per language, give per user ftp access to these dirs, language admins will receive a copy of the 'native language' html files (which has no php inside) and can translate and re-upload. I could then also write a script to compare the last modification time of these files compared to the native originals so lang admins can see what's been updated, what's left to do, etc.

2) Take a kind of gettext approach. Have one html file for all languages with codified keywords, which will be displayed according to the users language. The code key database will be in mySQL, and with a PHP Accelerator I reckon the load won't be too bad. This is a bitch to design, but, it is much easier for lang admins to keep the translations up to date, especially if there are just design changes (i.e. no real translation work to be done) and, if new stuff is added, it can just display the 'native language' version of the code.

So unless anyone has any other ideas, the toss up is between (1) which is MUCH easier to design, but significantly harder to maintain, or (2) which is going to be quite a mission to write (especially if there is alot of PHP code between or inside of paragraphs) but could be maintained with simple webforms, etc, + the other advantages mentioned above.

Any thoughts?
  • gsv2com
  • Professor
  • Professor
  • User avatar
  • Posts: 776
  • Loc: Nippon

Post 3+ Months Ago

I recommend php includes for this. Then you can have your "brain" page run the show. For instance, on your index.php, set up a switch like this with ?p being the page to access.

Code: [ Select ]
switch ($p) {
 case home:
   if ($lang=="jp") {
     include("home_jp.htm");
   } else {
     include ("home.htm");
   }
   break;
  case news:
    same thing
}
  1. switch ($p) {
  2.  case home:
  3.    if ($lang=="jp") {
  4.      include("home_jp.htm");
  5.    } else {
  6.      include ("home.htm");
  7.    }
  8.    break;
  9.   case news:
  10.     same thing
  11. }


Or do a switch inside a switch. Then set the links to ?p=home&lang=jp or lang= whatever languages you have set.

Your folders will be more organized since they'll look like this:
home.htm
home_jp.htm
home_fr.htm
home_sp.htm
news.htm
news_jp.htm
news_fr.htm
news_sp.htm

Much easier to do updates. Then just have the translaters send you your text and you can copy and paste as should be.
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

The way I do it, is similar to what gsv2com said above, by using PHP's include...

But I actually use language definitons throughout my script, so that the layout stays the same, but only the text changes.

Even though I only speak English, often people ask me to do apps in other languges - I don't do this, but I leave the ability for them to do it, or to get somebody who speaks both languages to do it.

Basically, during development, I'll just do this at the top of a global header.php file..

Code: [ Select ]
<?php
 define('SITE_LANG','eng');
 include('includes/lang/'.SITE_LANG.'.php');
?>
  1. <?php
  2.  define('SITE_LANG','eng');
  3.  include('includes/lang/'.SITE_LANG.'.php');
  4. ?>

eng.php basically includes a bunch more definitions...

Code: [ Select ]
<?php
 define('LANG_GREETING', 'Welcome to the site');
 define('LANG_LOGIN', 'Click here to login');
 define('LANG_LOGOUT', 'Click here to logout');
 define('LANG_REGISTER', 'Click here to register');
?>
  1. <?php
  2.  define('LANG_GREETING', 'Welcome to the site');
  3.  define('LANG_LOGIN', 'Click here to login');
  4.  define('LANG_LOGOUT', 'Click here to logout');
  5.  define('LANG_REGISTER', 'Click here to register');
  6. ?>

Then, in each of my pages..

Code: [ Select ]
<?php
include('header.php');
echo LANG_GREETING.'<p><a href="login.php">'.LANG_LOGIN.'</a><br><a href="register.php">'.LANG_REGISTER.'</a>';
include('footer.php');
  1. <?php
  2. include('header.php');
  3. echo LANG_GREETING.'<p><a href="login.php">'.LANG_LOGIN.'</a><br><a href="register.php">'.LANG_REGISTER.'</a>';
  4. include('footer.php');

As the script develops, if they only want the site in a single non-English language, they simply need to copy the eng.php file to something else, like ger.php (German) for example. Then edit ger.php translate the text, and change the first bit in the header to..

Code: [ Select ]
define('SITE_LANG', 'ger');

If they want something a bit more advanced, whereby a user can select their own language, then the simple define changes into a function. Now, what goes in this function depends entirely upon the client.

Do they want everybody to be able to change the language on-the-fly? In this case, it'd be set in a cookie. The function would look what's set in the cookie when the page is loaded, and include the appropriate language file - then even guests can use their local language.

If it's a closed site with admin-created members only, maybe he only wants it to be set in their user profile, in which each user's language setting could be made in the user profile record in the database (in which case, as soon as they login, they get their language, and don't have to set the cookie on every PC they may use - as in the example above).
  • Falk
  • Born
  • Born
  • Falk
  • Posts: 3

Post 3+ Months Ago

Hi,

hmmh, to build a switch is okay but it is not the point I suppose. Did I missunderstand you in your point 2 of your first mail?
As you wrote there I want to realise i18n in ONE (dynamic) page, but not in ONE static page for EACH language.
[Your last sample is based again on extra copies of the pages to each language (home. home_jp, ...).]

See, what happens in your example if the design of one page is changed? Then you have to make these changes on EACH language pages. This is no good!
Imagine you populate a site in 6 languages... So includes will not solve this problem, I suppose.

I was talking about a *separation* between text and design by dynamic laoding of the (original static) text phrases in depence of the selected language!

In PHP I thought about Babelkit, gettext or links to database done by extra tool.
My early question: What is best?

But as I can see you followed your point 1 with includes. So you won't be able to give an answer...

Regards, Falk


gsv2com wrote:
I recommend php includes for this. Then you can have your "brain" page run the show. For instance, on your index.php, set up a switch like this with ?p being the page to access.

Code: [ Select ]
switch ($p) {
 case home:
   if ($lang=="jp") {
     include("home_jp.htm");
   } else {
     include ("home.htm");
   }
   break;
  case news:
    same thing
}
  1. switch ($p) {
  2.  case home:
  3.    if ($lang=="jp") {
  4.      include("home_jp.htm");
  5.    } else {
  6.      include ("home.htm");
  7.    }
  8.    break;
  9.   case news:
  10.     same thing
  11. }


Or do a switch inside a switch. Then set the links to ?p=home&lang=jp or lang= whatever languages you have set.

Your folders will be more organized since they'll look like this:
home.htm
home_jp.htm
home_fr.htm
home_sp.htm
news.htm
news_jp.htm
news_fr.htm
news_sp.htm

Much easier to do updates. Then just have the translaters send you your text and you can copy and paste as should be.
  • dekanos
  • Beginner
  • Beginner
  • dekanos
  • Posts: 49

Post 3+ Months Ago

Any recommendations for how to do this without PHP? I'll need to develop something similar for our company's German office, and sadly, PHP is not an option for us right now.
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

Only other option is basically creating a copy of your site in each language.

How come PHP isn't an option? Doesn't your host support it?

I can do you a good deal on hosting if you're looking for something :)
  • i_kumar99
  • Born
  • Born
  • i_kumar99
  • Posts: 2
  • Loc: India-Hyderabad

Post 3+ Months Ago

Can you please guide in developing a multilingual website in pure php with dynamic font support. no smarty.
  • kimberlymccabe
  • Born
  • Born
  • kimberlymccabe
  • Posts: 1

Post 3+ Months Ago

Check out this white paper from Oshyn which explains managing multilingual websites in Drupal: oshyn (dot) com/landingpages/drupal-multilingual

It covers:
Management of Websites with multiple languages
Management of a Website with one language different than the default English
Management of multiple languages in one website
Combining management of multiple websites and multiple languages
Managing different languages with different databases
Managing different languages with one database

Post Information

  • Total Posts in this topic: 13 posts
  • Users browsing this forum: minddigital and 74 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.