I have been working on my smarty system, and have been scouring for ways to impliment internationialization. There seems to be 2 distinct ways. Use IntSmarty which acts like the block(?) t function? I am not too sure on it as I havn't been able to get it to work, but it seems similair to what people have been tlaking about by using block delimiters like {L} and {tr} to tag off some text, which will then draw up a table of words, then you can go ahead and translate all those words yourself into diferent language tables. Seems legit, but I cannot get it to work, I keep getting flex scan errors and other weird occurences. So anyway, i went on to do more reserarch and found that the get-text function seeems to work ok for this (Sagi's approach), but I havn't tried this yet.
I have also been conccerned wityh something that i've seen in recently updates of smarty. In the setup.php I've noticed a call to some language arguments:
Code: Select all
<?php
global $lang;
include_once('lang/language.php');
function tra($content)
{
global $lang;
if ($content) {
if(isset($lang[$content])) {
return '+'.$lang[$content].'+';
} else {
return '-'.$content.'-';
}
}
}
?>But on I go , cause I know i need my system to be intrnationialized. I need my entire system to be hotswapable with any language, so i was thinking about a "news-maniac/moodle" approach.. Where you store everything as a variable and then just call the vbariable and whatevere lang is set is what page it ghets the variables from.. This is a very neat concept and I like it. But betweeen the 2 methods I seem to be getting lost, not knowing which way to go with it. And consdiering I can't get INTsmarty to work ( when I put something in {l} i get this:
Code: Select all
<?php
Warning: Smarty plugin error: [in leftbar.tpl line 4]: unknown tag - 'l' in /var/www/php2/Smarty/Smarty.class.php on line 1889
Warning: Smarty plugin error: [in leftbar.tpl line 4]: unknown tag - '/l' in /var/www/php2/Smarty/Smarty.class.php on line 1889
Fatal error: Call to undefined function: () in /var/www/php2/templates_c/N626/N626615291/leftbar.tpl.php on line 8
?>So I dont really understand.. its as if L cannot be found, but this magicaly TR(?) which seems to be built into smarty does nothing.
If anyone knows anything about SMarty, if it already has int built in (blockt), or know any other good way to go about internationization then please write. I am looking to make my entirie system changeable at any time by the user by the way, so not have it pick the lang bythe browser incoming, but by a user selected drop down menu, wh9ich would need to cahnge the $lang variable i gues, not to hard. But in order to get to that step, i need to first of all understnad why Int will not work, or maybe see how I can get somethnig at all to work.
Thank you...
*distressed*