translate php website without extrernalizing resources
<p>I have a php site that mixes html and php.
ex: </p>

<pre><code>&lt;html&gt;
hello &lt;?=$username?&gt;
</code></pre>

<p>I need infact to keep texts are they are. I do not want a classical solution such as that consits of creating reosurce strings and replace them such as: </p>

<pre><code>&lt;html&gt;
&lt;?=echo $helloString?&gt; &lt;?=$username?&gt;
</code></pre>

<p>Infact a kind of "autoscript" that will replace all text resources at run time. So I keep the existing site and just add some script at begin.</p>

<pre><code>&lt;? include("translation_module.php?")?&gt;
&lt;html&gt;
hello &lt;?=$username?&gt;
</code></pre>

<p>and this translation_module.php will replace "hello" to "bonjour".</p>

<p>Any clue to achieve that ?</p>

<p><strong>I don't care about grammer, currencies, plurial problems.</strong></p>

<ul>
<li>I guess it should work like google translate: it should execute itself, and translate then output texts and finally printout the result (of course I have no idea how it does it, how it handles $GET, $POST, $SESSION variables...)</li>
</ul>

<p>Thanks</p>
