Jeremy Newman wrote:<br>
I figured as much. I just needed a template to use as a test. I knew
you&#39;d end up fixing the poor translation. I had no intention to use it
on more templates.<br><br>Okay, then nothing happens. All right.<br><br>The templates files are well. Sorry for my fail in quote function. I thought a little more and I saw three alternatives but to make the code more quickly and efficiently:<br>
<br>&nbsp;&nbsp;&nbsp; # Alternative one (my prefer, but not is valid, because cut \n and the next character)<br>&nbsp;&nbsp;&nbsp; $quotes = split(&quot;\n.&quot;,$GLOBALS[html]-&gt;template(&#39;base&#39;,&#39;quotes&#39;)); # We use the powerful slice of regex<br>
&nbsp;&nbsp;&nbsp; return $quotes[array_rand($quotes)]; # and then we use array_rand() more effectively<br><br>&nbsp;&nbsp;&nbsp; # Alternative two (better)<br>&nbsp;&nbsp;&nbsp; $quotes = explode(&quot;\n&quot;,$GLOBALS[html]-&gt;template(&#39;base&#39;,&#39;quotes&#39;)); # If we don&#39;t use regex then explode() is more effective<br>
&nbsp;&nbsp;&nbsp; return $quotes[mt_rand(0,(sizeof($quotes)-2))]; # and also use mt_rand() and sizeof which is faster<br>&nbsp;<br>&nbsp;&nbsp;&nbsp; # Alternative three (less better)<br>&nbsp;&nbsp;&nbsp; $quotes = explode(&quot;\n&quot;,$GLOBALS[html]-&gt;template(&#39;base&#39;,&#39;quotes&#39;)); # If we don&#39;t use regex then explode() is more effective<br>
&nbsp;&nbsp;&nbsp; $num = sizeof($quotes)-2; # We use a temp variable + sizeof() + array_random()<br>&nbsp;&nbsp;&nbsp; return $quotes[array_rand($num)];<br><br>You decide Jeremy.<br><br>And other small improve, show path of config file not found<br><br>
diff --git a/include/config.php b/include/config.php<br>index a5f1fe2..6016cc4 100644<br>--- a/include/config.php<br>+++ b/include/config.php<br>@@ -22,7 +22,7 @@ class config<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // exit if config not found<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!file_exists($path))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &#39;config file not found!&#39;;<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &#39;config file &#39;.$path.&#39; not found!&#39;;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


i18n people sometimes do a search and replace to turn all o&#39;s into o<br>
plus o umlaut,<br>
all n&#39;s into n plus n tilde, etc. &nbsp;The result is longer than the<br>
original and uses<br>
funny characters, and is still understandable by the person doing the<br>
internationalization,<br>
but can&#39;t be mistaken for final text.<br>
<font color="#888888">- Dan</font></blockquote><div><br>I try to do the translations as well as possible and without which vary the original meaning.&nbsp;</div></div>Soon, more translations. <br><a href="http://www.apogeus.es" target="_blank"></a>