Re: Translation
| From: | MPN | Date: | Fri, 22 Mar 2002 16:15:21 +0000 |
| Subject: | Re: Translation | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-3282@lists.php.net to get a copy of this message | ||
Seems to me in either case, pulling words from a database seems the most
logical solution with respect to server performance. Currently we use a
separate config file for each translated language, which uses key words and
phrases that are hardcoded in the script to do the translation. As you
might imagine, this is not the most efficient method of translation by far.
I feel adding a translation plugin would greatly extend the capabilities of
the engine worldwide and I welcome any input from smarty users who have
explored this issue..
KT
-----Original Message-----
From: mohrt@ns3.ispi.net [mailto:mohrt@ns3.ispi.net]On Behalf Of Monte
Ohrt
Sent: Friday, March 22, 2002 7:15 AM
To: smarty@lists.ispi.net
Cc: smarty@lists.ispi.net
Subject: [smarty] Re: Translation
Will this solution scale? I mean, you could have hundreds or even
thousands of words per language that would have to be loaded.
config_load loads the _entire_ config file into memory on the first hit,
meaning it would load every word for every language. Maybe splitting out
each language into a separate config file would scale better. But even
so, you would still conceivably load thousands of words in a single
language. So probably the best solution would be a plugin that pulls the
translations from a faster datasource, such as a database or dbm file.
Monte
programisci_listy wrote:
>
> On 16 marca 2002 at 05:25:58
> olivier hericord <ohericord@free.fr>
> wrote:
>
> > There's a lot of way to achieve a translation of a page...
> > The text that has to be translated can be
> > -Static
> > -Dynamic
> >
> > An already given solution is to achieve the translation by creating a
.conf
> > file containing something like that:
> >
> > [en]
> > hello="hello"
> > other=...
> >
> > [de]
> > hello="Bonjour"
> > other=...
> >
> > The template will look like this:
> >
> > {config_load file="language.conf" section="$language"}
> > <html>
> > <body>
> > {#hello#}
> > </body>
> > </html>
> >
> > It would be possible to use this way to translate a dynamic text if it
was
> > possible to write something like that in a Template : {#$TEXT#}
> > $TEXT is a variable containing the name of the config variable that
contains
> > the text u want to translate....
>
> I agree with you with 100%.
>
> --
> Jarek
>
> ---
> You are currently subscribed to smarty as: monte@ispi.net
> To unsubscribe send a blank email to $subst('Email.Unsub')
> Visit Smarty's homepage at
> http://www.phpinsider.com/php/code/Smarty/
--
Monte Ohrt <monte@ispi.net>
Director of Technology, ispi Inc.
---
You are currently subscribed to smarty as: mpn@3dgamelink.com
To unsubscribe send a blank email to $subst('Email.Unsub')
Visit Smarty's homepage at http://www.phpinsider.com/php/code/Smarty/