Forum Moderators: coopster

Message Too Old, No Replies

multiple langauge sites

how do you store the different translations

         

jamie

5:24 pm on Jan 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi,

our sites are in three languages which are more or less identical in structure and content.

we currently have hardcoded the translations into the php files - a real recipe for spaghetti code [webmasterworld.com] ;)

i am thinking about creating separate include files for each of the words and phrases used in each section (a bit like phpbb). these included files will be quite big, but i think the ease of maintenance and translation will outweigh the bloat.

i had also thought however of doing it in a db. that would allow unskilled translators to edit words and phrases. i could then cache the db results into an array and access them from there.

i just wondered what everyone else does and why?

many thanks

jatar_k

6:05 pm on Jan 26, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



mostly, as I heard from many phh "pros"

multi language just sucks

templating of some sort is probably the way to go, db or file doesn't matter too much, except that you have to set your default charset in your db and that could cause some insanity.

use a language setting in the session if it iis a logged in type thing

is it a static site (ie. just info)? is it forum or some kind of user gen content site? ecomm?

reason I ask is the needs of each are fairly different. I am liable to just serve it up pretty static if it is an info only site.

jamie

6:21 pm on Jan 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



'..sucks' ha ha - i heartily agree with that ;)

the site is static and templated. the main content is stored in a db and translated via cms, but there are many scripts such as send to a friend, submit reviews, etc which have lots of little "click here to do this" type of phrases.

i don't use sessions; each site is on a regional .tld (all on the same server).

i have never heard of setting the default charset on db?

as an example, can't i just store records:

Click here
Click aquí

i normally run all content through htmlentities() before storing in db? shouldn't that be ok?

jatar_k

6:33 pm on Jan 26, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



should be, just test it

as long as you stay away from languages with different character sets it should be ok