Jeremy Newman wrote:<br>
I figured as much. I just needed a template to use as a test. I knew
you'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> # Alternative one (my prefer, but not is valid, because cut \n and the next character)<br> $quotes = split("\n.",$GLOBALS[html]->template('base','quotes')); # We use the powerful slice of regex<br>
return $quotes[array_rand($quotes)]; # and then we use array_rand() more effectively<br><br> # Alternative two (better)<br> $quotes = explode("\n",$GLOBALS[html]->template('base','quotes')); # If we don't use regex then explode() is more effective<br>
return $quotes[mt_rand(0,(sizeof($quotes)-2))]; # and also use mt_rand() and sizeof which is faster<br> <br> # Alternative three (less better)<br> $quotes = explode("\n",$GLOBALS[html]->template('base','quotes')); # If we don't use regex then explode() is more effective<br>
$num = sizeof($quotes)-2; # We use a temp variable + sizeof() + array_random()<br> 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> // exit if config not found<br>
if (!file_exists($path))<br> {<br>- echo 'config file not found!';<br>+ echo 'config file '.$path.' not found!';<br> exit();<br>
}<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's into o<br>
plus o umlaut,<br>
all n's into n plus n tilde, etc. 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'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. </div></div>Soon, more translations. <br><a href="http://www.apogeus.es" target="_blank"></a>