Re: best practice wrt multi-lingual websites, gettext() etc.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 26, 2009 at 12:21 PM, Per Jessen <per@xxxxxxxxxxxx> wrote:

> Phpster wrote:
>
> > Dunno if it's a best practice, but I store all the translations in the
> > db for easy manipulation and extraction to a file for others to
> > translate. That obviously involves both import and export utilities.
>
> Hi Bastien
>
> interesting - does this mean you're also coding for language-awareness
> yourself?  I mean, you must have your own gettext() functionality?
>
> > A number of pup apps take the approach of storing the label
> > translations in variables inside language folders ( phpmyadmin has
> > this ). That is also not a bad approach but is slightly slower and I
> > can't help but feeling that serving up a static page created by code
> > is a better solution.
>
> That's part of what we're thinking of doing, but it's difficult to
> separate the language and code completely.  Which is where gettext()
> comes in.
>
> Does anyone on this list use gettext() ?
>
>
> /Per Jessen, Zürich
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
No, as all of our users have to authorized to use the app, we store the
desired language in a field in the user record. However, we also supply
functionality via a drop down to allow the user to change the language if
desired.

I agree its difficult to separate the language and the code, but if you
create xslt / html files for each language then its a much simpler matter,
and far less resouce intensive, to direct the user to that page in their
desired language. Again, you and just use PHP and handle the labels and
option (drop downs, radios etc) variables in real time  but I never see the
point in doing the same thing over and over again when its much cleaner (if
more management intensive)  to direct the user to a static resource and pass
in an XML string with the data in it.

At work, we don't use gettext() since :
a) its an classic ASP shop (  :-(  ), therefore no Linux and no PHP
b) the db current doesn't support multi-byte charsets

My personal projects (or work on the side) are, of course, all php but so
far there has been no requirements for multi language support, though the
two projects that I am starting will both require it. Not sure if I will use
gettext(), I will research some more, but it will definitely support
multi-language and the db is unicode.


-- 

Bastien

Cat, the other other white meat

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux