I'm building a web application that uses LAMP and the Smarty template framework. The website will have plenty of static content (about us page, error alerts, confirmation emails etc...).
The web application must support multiple languages. Is the following approach appropriate?
1) All static copy on Smarty template pages (html pages) will be replaced by calls to smarty plugins such as {lang file='about.xml' getTerm='title'} which returns a string for the title tag in the appropriate language
2) The file about.xml is an xml document on the webserver that acts as a multiple language dictionary. So it will have xml nodes such as
<term value="title">
<en><a href="http://stackoverflow.com&quot;&rt;Stackoverflow&lt;/a&rt; is a great site</en>
<fr><a href="http://stackoverflow.com&quot;&rt;Stackoverflow&lt;/a&rt; c'est website magnifique</fr>
<ch><a href="http://stackoverflow.com&quot;&rt;Stackoverflow&lt;/a&rt; complex looking chinese characters I don't udnerstand</ch>
</term>
<term value="signupmessage">
<en><a href="http://stackoverflow.com&quot;&rt;Stackoverflow&lt;/a&rt; great deals!</en>
<fr><a href="http://stackoverflow.com&quot;&rt;Stackoverflow&lt;/a&rt; magnifique deals!</fr>
<ch><a href="http://stackoverflow.com&quot;&rt;Stackoverflow&lt;/a&rt; complex looking chinese characters I don't udnerstand</ch>
</term>
3) The url structure for the site will be http://mywebsite.com/language/index.php
. To do this, my webserver will have symbolic links such as
ln -s ./en ./
so that http://mywebsite.com/en/index.php
points to the same php page as http://mywebsite.com/fr/index.php
, but I will check the url for language settings. My hope is that google will index both versions of the site.
Is this a good approach? Is xml the best format for storing content of different languages even though it has htmlentity encoded html tags? Did I overlook anything?