Page 1 of 1

IntSmarty, Has Anyone Ever Installed This?

Posted: Mon Jul 05, 2004 6:51 am
by NewfieBilko
Hi, I am trying to install IntSmarty for SMarty. It is an Internationalization method for Smarty. (http://blog.coggeshall.org/).

I have included the IntSmarty class into my Smarty compilation, and have tried code from his examples in PHP architect, but doesn't work. I have looked around for documentation or help, but cannot find any. Was wondering if anyone else has had experience making Smarty, Internationalized, or if anyone knows any good resources for making it internation please write me. I have included the IntSmarty class: http://www.coggeshall.org/show_source.p ... .class.php

but cannot understand how to impliment the internationization and i want to make it selectable for the user as to what langage she/he views the page in.

Posted: Mon Jul 05, 2004 7:55 am
by NewfieBilko
I have been having problems with my delimiters. Smarty tells me when I demlimit something with {l} something {/l} I get :



Warning: Smarty plugin error: [in leftbar.tpl line 4]: unknown tag - 'l' in /var/www/php2/Smarty/Smarty.class.php on line 1923

Warning: Smarty plugin error: [in leftbar.tpl line 4]: unknown tag - '/l' in /var/www/php2/Smarty/Smarty.class.php on line 1923

Posted: Mon Jul 05, 2004 8:01 am
by NewfieBilko
where would
'l'

be defined?


THe next (following) message is a conversation with me and 1 other guy:

Posted: Mon Jul 05, 2004 1:12 pm
by NewfieBilko
IntSmarty Needs more Attention!!!! [message #3038] Mon, 21 June 2004 10:27
NewfieBilko
Messages: 3
Registered: June 2004
Location: Newfoundland


Hi

I have been working on internationizing Smarty for the past few days. I have read John's articles, and have my own installation of Smarty.

I am confused as to how the actual translation from say default to say 'russian' actually takes place.. Where is the translator, where is my output coming from?

One of the posts on this sites says that: this is a good way to convert one word, or a phrase, but how about full websites and such. One guy goes on to say that we should make make templates in different languages. I dont disagree, but this IntSmarty, what exactly can it translate? Wherein lies the translator? What If i needed it to all be dynamic? We need more help here!
Report message to a moderator



Re: IntSmarty Needs more Attention!!!! [message #3105 is a reply to message #3038 ] Sun, 04 July 2004 20:48
morpheusagn
Messages: 1
Registered: July 2004 add to buddy list
ignore all messages by this user


Hoepfully I can say something helpful and even a bit enlightening.

Having worked with IntSmarty for the past month or two, I have picked up on how it works and what it is capable of. As you go about creating your Smarty templates and surrounding text that you want to provide a translation for with the IntSmarty tags(e.g. {l} ... {/l}), IntSmarty builds a "translation table" of words in the default language (most often en-us). If you look in the directory that you set to store the translation tables, you should see a file named $lang.php, where $lang is the default language (e.g. en-us.php). That file contains the translation table for en-us. Now, to make, say, a Spanish translation, copy the en-us.php file to es.php (es for Spanish, fr for French, etc.) and change the phrases to their Spanish equivalents. When a visitor comes to your site with Spanish as their primary language (In IE/Firefox, Tools->(Internet) Options->Languages), the IntSmarty object will detect the primary language and supply the correct translation.

Now, about larger blocks of text and dynamic translation. It's fine to provide translations for larger blocks of text, but as you can see, it's a bit time-consuming and, I would imagine, you will take a performance hit. Secondly, you've hinted about on-the-fly translations without translation tables. Unfortunately, despite Babelfish's and Google's best efforts, we are simply not there yet with one-to-one translations. Visions of "All your base ..." come to mind. If you hunt around the Smarty forums, you may come across something that will do on-the-fly translations from Babelfish, but it will eat up your performance.

Anyway, hope that helps and good luck.
Report message to a moderator



Re: IntSmarty Needs more Attention!!!! [message #3107 is a reply to message #3038 ] Mon, 05 July 2004 14:18
NewfieBilko
Messages: 3
Registered: June 2004
Location: Newfoundland


Thanks, you were right, you have provided me with some light.

I have installed IntSmarty now, and am trying to get it to work. But now whenever I put {l} {/l} around anything all I get is errors... Anyone know why?


Error:

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

Report message to a moderator



Re: IntSmarty Needs more Attention!!!! [message #3108 is a reply to message #3038 ] Mon, 05 July 2004 14:22
NewfieBilko
Messages: 3
Registered: June 2004
Location: Newfoundland


its like my BLOCK is not defined as l..... where is the register_block "L" too in IntSmarty??!?!!??!

HELP!!!

na027436@students.cna.nl.ca

Posted: Wed Jul 07, 2004 7:32 am
by NewfieBilko
damn

Posted: Wed Jul 07, 2004 1:16 pm
by launchcode
I would take the vast lack of responses to mean that no-one has used it ;) Probably time to ask somewhere else.. like the Smarty mailing list? Or even PHP-General where the author hangs out a lot.

Posted: Thu Jul 08, 2004 10:44 am
by NewfieBilko
solid