View previous topic :: View next topic |
Author |
Message |
AZTEK Smarty Pro
Joined: 16 Apr 2003 Posts: 235 Location: Purdue University
|
Posted: Tue Apr 29, 2003 9:48 am Post subject: |
|
|
True as my intention was to make the trainslations as grapaticly correct as possible and to emulate gettext on a certin level _________________ "Imagine a school with children that can read and write, but with teachers who cannot, and you have a metaphor of the Information Age in which we live." -Peter Cochrane |
|
Back to top |
|
smartymoon Smarty Rookie
Joined: 29 Apr 2003 Posts: 15
|
Posted: Tue Apr 29, 2003 6:37 pm Post subject: each config file for each language |
|
|
you may create config files for each lang
like
lang.eng,config
lang.spn.config
and assign $LANG and use in template to fetch file
{config_load file="lang.$LANG.conf"}
moon |
|
Back to top |
|
Rene Grassegger Smarty n00b
Joined: 30 Apr 2003 Posts: 1
|
Posted: Wed Apr 30, 2003 8:07 am Post subject: Installtion question |
|
|
Hallo Andreas
andre wrote: | It works quite well for me and it's fast. If somebody needs some help just post your questions in the forum |
I found your multi language class and I want to "install" it in my smarty system.
I'm pretty new to smarty and I'm not sure how exactly to install your class.
I've searched over the resources, but I found no helpfull docs, turials, any further information.
Could you please tell me with a few words, how to install it?
Herzlichen Dank.
Gruß
Rene |
|
Back to top |
|
mniskanen Smarty Rookie
Joined: 26 Apr 2003 Posts: 20 Location: Lieksa,Finland
|
Posted: Wed Apr 30, 2003 12:03 pm Post subject: Re: Recomandation!!!!! |
|
|
risto wrote: |
This XML version is just exelent! I very much recomend it! |
Having XML enabled by default would be a very nice thing indeed.
In most cases, however, XML support has nob been included in a typical
ISP/Web Hotel PHP installation. Stepping a bit aside from this thread: does
anybody know of any Pure-PHP alternative (a class would be fine) to Expat
and/or DOM/XML?
Markku |
|
Back to top |
|
andre Smarty Pro
Joined: 23 Apr 2003 Posts: 164 Location: Karlsruhe, Germany
|
Posted: Wed Apr 30, 2003 1:04 pm Post subject: Re: Installtion question |
|
|
Rene Grassegger wrote: | Hallo Andreas
andre wrote: | It works quite well for me and it's fast. If somebody needs some help just post your questions in the forum |
I found your multi language class and I want to "install" it in my smarty system.
I'm pretty new to smarty and I'm not sure how exactly to install your class.
I've searched over the resources, but I found no helpfull docs, turials, any further information.
Could you please tell me with a few words, how to install it?
Herzlichen Dank.
Gruß
Rene |
Du hast Post |
|
Back to top |
|
AZTEK Smarty Pro
Joined: 16 Apr 2003 Posts: 235 Location: Purdue University
|
Posted: Wed Apr 30, 2003 2:43 pm Post subject: |
|
|
Well 99.9% of all servers I have ever used had XML summport enabled considering you would have had to pass --disable-xml to turn it off. And as far as I know there is no native class to use XML without using the PHP functions unless you want to use the COM functions to load the MS-XML engine. _________________ "Imagine a school with children that can read and write, but with teachers who cannot, and you have a metaphor of the Information Age in which we live." -Peter Cochrane |
|
Back to top |
|
mniskanen Smarty Rookie
Joined: 26 Apr 2003 Posts: 20 Location: Lieksa,Finland
|
Posted: Wed Apr 30, 2003 3:34 pm Post subject: |
|
|
AZTEK wrote: | Well 99.9% of all servers I have ever used had XML summport enabled considering you would have had to pass --disable-xml to turn it off. . |
Thanks, you just saved my day... I, the idiot, have been working believing
that XML is off by default and must be ENABLED, oh, dear me...
Well, the future of a couple of projects just got a lot brighter. A big, very
big THANK YOU!
Markku |
|
Back to top |
|
andre Smarty Pro
Joined: 23 Apr 2003 Posts: 164 Location: Karlsruhe, Germany
|
Posted: Wed Apr 30, 2003 4:16 pm Post subject: |
|
|
AZTEK wrote: | Well 99.9% of all servers I have ever used had XML summport enabled considering you would have had to pass --disable-xml to turn it off. And as far as I know there is no native class to use XML without using the PHP functions unless you want to use the COM functions to load the MS-XML engine. |
I'm not really sure but look at this:
http://sourceforge.net/projects/phpxmldb/
phpXML is a class for accessing XML documents through the powerful XPath language WITHOUT requiring the DOM XML extensions to be setup on your server. With this script XPath becomes at last also everywhere available, where hosters refuse persistently to setup this extension. |
|
Back to top |
|
andre Smarty Pro
Joined: 23 Apr 2003 Posts: 164 Location: Karlsruhe, Germany
|
Posted: Wed Apr 30, 2003 4:31 pm Post subject: |
|
|
I have just updated my "SmartyMultilanguageSupport" Wiki at http://smarty.incutio.com/?page=SmartyMultilanguageSupport
A small bug has been fixed and I added a example for the SmartyML::loadTranslationTable() method.
I just remembered another possible use of this Multilanguage class: You can get the translations of a text even without using Smarty. I'm not sure if the other solutions provide this to.
Imagine a logging function for your project or automatically generated comments or something similar. You can easily use ngLanguage class here to get the translation for a string even without instantiating the Smarty class. |
|
Back to top |
|
mniskanen Smarty Rookie
Joined: 26 Apr 2003 Posts: 20 Location: Lieksa,Finland
|
Posted: Wed Apr 30, 2003 5:08 pm Post subject: |
|
|
The XML Parser functions ARE available by default but the DOM XML functions
must be included in the MAKE phase. Thank you for your link, anyhow, that
was what I was looking some time ago.
Markku |
|
Back to top |
|
AZTEK Smarty Pro
Joined: 16 Apr 2003 Posts: 235 Location: Purdue University
|
Posted: Wed Apr 30, 2003 7:02 pm Post subject: |
|
|
andre wrote: | I'm not really sure but look at this:
http://sourceforge.net/projects/phpxmldb/
phpXML is a class for accessing XML documents through the powerful XPath language WITHOUT requiring the DOM XML extensions to be setup on your server. With this script XPath becomes at last also everywhere available, where hosters refuse persistently to setup this extension. |
That class is a good one I have used before. It requires expat (aka the built in XML support) which is the same thing my code requires. _________________ "Imagine a school with children that can read and write, but with teachers who cannot, and you have a metaphor of the Information Age in which we live." -Peter Cochrane |
|
Back to top |
|
Tobi Smarty n00b
Joined: 08 May 2003 Posts: 1 Location: Friedrichshafen, German
|
Posted: Fri May 09, 2003 7:56 pm Post subject: |
|
|
andre: I've a problem with your ML Script, I got this error:
Warning: Invalid argument supplied for foreach() in /php/includes/setup_intern_lng.php on line 240
And it only replaces ##
so, that on the page is, e.g., WELCOME instead of Welcome (##WECLOME## in the TPL)
|
|
Back to top |
|
toma Smarty Regular
Joined: 25 Apr 2003 Posts: 62
|
Posted: Wed May 14, 2003 6:33 pm Post subject: |
|
|
Hey now: I want to plug my own multilanguage method here. http://smarty.incutio.com/?page=SmartestSmartyMultilanguageSupport uses gettext. gettext has been around for a very long time and is a mature method for internationalizing apps. You don't need to put placeholders in your smarty templates to use it. Instead, you but block markers around any text you want translated such as {t}translate this{/t}.
The script at the above link uses the babelfish for translations to help you get started.
Also, you don't need to remember where your translated strings are. When development mode is turned on, all strings to be translated are added to the message.po files used by gettext if they do not already exist in them. There are several editors available just for gettext .po files too.
The only requirement for my method is gettext must be enabled.
</selfpromotion> |
|
Back to top |
|
andreas Smarty Pro
Joined: 22 Apr 2003 Posts: 106
|
Posted: Wed May 14, 2003 7:02 pm Post subject: |
|
|
toma wrote: | The script at the above link uses the babelfish for translations to help you get started. |
is this allowed?
________
volcano vaporizer
Last edited by andreas on Fri Feb 04, 2011 9:00 am; edited 2 times in total |
|
Back to top |
|
toma Smarty Regular
Joined: 25 Apr 2003 Posts: 62
|
Posted: Wed May 14, 2003 9:16 pm Post subject: |
|
|
andreas wrote: | toma wrote: | The script at the above link uses the babelfish for translations to help you get started. |
is this allowed? |
http://www.altavista.com/web/legal/termsofuse
I'm no lawer. If you care enough to hire one, that's the page to use. I cannot find anything which I think prohibits use of their babelfish services as I used it in block.t.
If you think it's illegal to use it, you only need to comment out the
$babel = file("http://babelfish.altavista.com/babelfish/tr?lp={$t_language_from}_{$t_language}&intl=1&tt=urltext&doit=done&urltext=" . urlencode($content));
line and the plugin turns into a gettext-only plugin without the autotranslate feature.
Even without the autotranslate I added, gettext is a well-tested, mature translation tool designed just to do translations.
Tom |
|
Back to top |
|
|