At 12/19/2006 07:03 AM, Kepler Gelotte wrote:
I had a question about creating multi-language web sites and best practices.
Is it better to create two separate directories with the pages and images
duplicated for each language, or is it best to try a database solution using
meta tags that will be replaced on the server depending on the language
selected? Maybe there is another approach all together?

I would think the database solution would be more flexible but could get out
of hand quickly just with the number of meta tags required. The web site I
am concerned about has to support 2 languages only (French/English).


The decision whether to generate web content from a database is often driven by the efficiency of doing so for middlin' to large applications. However, once you build a good method for supplying multilingual content, it's there for you to use on even small jobs.

Here are two bilingual sites I've built using somewhat different techniques:

Partcon (English/French site)
http://partcon.ca/

With Partcon, the English & French are in separate records in the MySQL database. I set a language field in the database table with (in this case) three possible values, "-", "EN", and "FR". The hyphen stands for 'any language' and is used to output content that isn't language-dependent such as image src and anchor href. Therefore I can select records:
        WHERE lang='-' OR lang='$sSelectedLanguage'
and the Boolean overlap of recordsets works just fine. When the user changes the language selection, a new page view is pulled down from the server with the requested language records plugged in.


Laurie Toby Edison - Women of Japan - The Models' Words (English/Japanese pages)
http://laurietobyedison.com/WOJwords.asp

With Laurie Edison's Women of Japan pages, both the English and the Japanese texts are present on every page of mark-up. Which language is currently displayed depends on the body class ('langEN' or 'langJP'). Each language-specific block of text, whether a single span or a div containing multiple paragraphs, is given a language code so that CSS can display or hide text selectively:

        /* make English invisible on Japanese pages and vice versa */
        body.langEN .langJP,
        body.langJP .langEN
        {
                position: absolute;
                left: -1000em;
        }

With JavaScript disabled, changing language pulls down the same page from the server but with the body class reset. With JavaScript enabled, the body class is changed immediately and no server round-trip is required. Obviously this solution depends on a relatively limited amount of text on the page and/or a limited number of languages if you want to keep page size down.

Regards,
Paul


*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to