I've been thinking about best approaches to multilingual sites.
What I would prefer would be something like this:
<xml version="1.0" encoding="utf8">
<language>
<menu id="mainMenu">
<menuLink id="1"><a href="test.com">test</a></menuLink>
<menuLink id="2"><a href="test2.com">test2</a></menuLink>
</menu>
<menu id="someSubMenu">
...
</menu>
<section id="mainPage">
<title>text</title>
<text>some<br />text<br />here</text>
</section>
</language>
Now in my PHP code I would love to be able to do:
echo $myLanguage->menu['mainMenu']->menuLink['1'];
echo $myLanguage->section['mainPage']->title;
The problem is parsing this "xml" file into an object that will look like this.
simplexml_load_file doesn't parse this the way I want it, neither does it seem to like "html tags" within the "xml tags".
Anyone got any solutions to this or another simple good way to make multilingual sites where I won't need 1 copy for each language of my webpage 🙂