make website in german

5 views
Skip to first unread message

cloudymegz

unread,
Apr 23, 2006, 9:02:01 PM4/23/06
to Multi-Lingual Web Site Discussion
hi,

I am making a multilingual website in php.

I need to make it in german and english. English i have no problem but
how can i make the pages in german. I have all the content translated
in german but what change in the php and html code do i have to do to
make the content display in german.

pls help me. its really urgent

Thankssss

Cloudymegz

Paul Novitski

unread,
Apr 24, 2006, 1:35:48 AM4/24/06
to Multi-Lingual Web Site Discussion
At 06:02 PM 4/23/2006, cloudymegz wrote:
>I am making a multilingual website in php.
>
>I need to make it in german and english. English i have no problem but
>how can i make the pages in german. I have all the content translated
>in german but what change in the php and html code do i have to do to
>make the content display in german.


My approach is, first of all, to separate the HTML structure from the
text content, so I can fill an empty HTML template with variable text
according to the user's language choice.

I keep all the text in a MySQL table with one of two record structures:

1)
`EN` = text in English
`DE` = text in German

With this record structure, you read the records for the current page
and display either the EN field or the DE field according to the
user's current language choice.

SELECT {$sLang} AS content FROM `tableName` WHERE
`pageName`="{$sCurrentPage}" ...

2)
`content` = text
`language` = EN or DE

With this second record structure, you select records for the current
page AND for the current language choice, then display the `content` field.

SELECT `content` FROM `tableName` WHERE
`pageName`="{$sCurrentPage}" AND `language`="{$sLang}" ...

Here's a bilingual English/French website I did this way:
http://partcon.ca/

Regards,
Paul

Reply all
Reply to author
Forward
0 new messages