Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

best way to build a multi-language site with smarty
Goto page Previous  1, 2, 3, 4 ... 13, 14, 15  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Tips and Tricks
View previous topic :: View next topic  
Author Message
AZTEK
Smarty Pro


Joined: 16 Apr 2003
Posts: 235
Location: Purdue University

PostPosted: Tue Apr 29, 2003 9:48 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
smartymoon
Smarty Rookie


Joined: 29 Apr 2003
Posts: 15

PostPosted: Tue Apr 29, 2003 6:37 pm    Post subject: each config file for each language Reply with quote

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
View user's profile Send private message
Rene Grassegger
Smarty n00b


Joined: 30 Apr 2003
Posts: 1

PostPosted: Wed Apr 30, 2003 8:07 am    Post subject: Installtion question Reply with quote

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
View user's profile Send private message Visit poster's website
mniskanen
Smarty Rookie


Joined: 26 Apr 2003
Posts: 20
Location: Lieksa,Finland

PostPosted: Wed Apr 30, 2003 12:03 pm    Post subject: Re: Recomandation!!!!! Reply with quote

risto wrote:
Very Happy Very Happy Very Happy
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
View user's profile Send private message
andre
Smarty Pro


Joined: 23 Apr 2003
Posts: 164
Location: Karlsruhe, Germany

PostPosted: Wed Apr 30, 2003 1:04 pm    Post subject: Re: Installtion question Reply with quote

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 Wink
Back to top
View user's profile Send private message
AZTEK
Smarty Pro


Joined: 16 Apr 2003
Posts: 235
Location: Purdue University

PostPosted: Wed Apr 30, 2003 2:43 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
mniskanen
Smarty Rookie


Joined: 26 Apr 2003
Posts: 20
Location: Lieksa,Finland

PostPosted: Wed Apr 30, 2003 3:34 pm    Post subject: Reply with quote

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... Embarassed

Well, the future of a couple of projects just got a lot brighter. A big, very
big THANK YOU!

Markku
Back to top
View user's profile Send private message
andre
Smarty Pro


Joined: 23 Apr 2003
Posts: 164
Location: Karlsruhe, Germany

PostPosted: Wed Apr 30, 2003 4:16 pm    Post subject: Reply with quote

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 Confused 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
View user's profile Send private message
andre
Smarty Pro


Joined: 23 Apr 2003
Posts: 164
Location: Karlsruhe, Germany

PostPosted: Wed Apr 30, 2003 4:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
mniskanen
Smarty Rookie


Joined: 26 Apr 2003
Posts: 20
Location: Lieksa,Finland

PostPosted: Wed Apr 30, 2003 5:08 pm    Post subject: Reply with quote

andre wrote:

I'm not really sure Confused but look at this:
http://sourceforge.net/projects/phpxmldb/
phpXML is a class for accessing XML documents through the powerful XPath ...


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
View user's profile Send private message
AZTEK
Smarty Pro


Joined: 16 Apr 2003
Posts: 235
Location: Purdue University

PostPosted: Wed Apr 30, 2003 7:02 pm    Post subject: Reply with quote

andre wrote:
I'm not really sure Confused 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
View user's profile Send private message Visit poster's website
Tobi
Smarty n00b


Joined: 08 May 2003
Posts: 1
Location: Friedrichshafen, German

PostPosted: Fri May 09, 2003 7:56 pm    Post subject: Reply with quote

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)

Sad
Back to top
View user's profile Send private message
toma
Smarty Regular


Joined: 25 Apr 2003
Posts: 62

PostPosted: Wed May 14, 2003 6:33 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
andreas
Smarty Pro


Joined: 22 Apr 2003
Posts: 106

PostPosted: Wed May 14, 2003 7:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
toma
Smarty Regular


Joined: 25 Apr 2003
Posts: 62

PostPosted: Wed May 14, 2003 9:16 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Tips and Tricks All times are GMT
Goto page Previous  1, 2, 3, 4 ... 13, 14, 15  Next
Page 3 of 15

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP