Jump to content

Dual Language with php+mysql


Recommended Posts

Hmm...you could just have two tables, each with all your pages stored in it, but in different languages. The client could then choose their language, which sets a cookie. If the cookie is one language or doesn't exist, do a language, if it does, do the other.

 

Just  a suggestion. However...storing pages ina  database is a bit risky. Databases are a lot easier to hack than flat files.

storing pages ina  database is a bit risky. Databases are a lot easier to hack than flat files.

 

Risky? Not really, if you know what you're doing and secure your system...

 

SMARTY templates allow you to add in multi-lingual support, not by default but there are classes available you can add to give that support. We use it at work and our website is available in about 10 languages, I have no complaints. Generally the idea is in your templates you encase text in translation tags, something like {t}hello{/t}, and then the translations are looked up from an XML file or ".po" file. Definitely beats having several versions of the same file...

 

Regards

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.