Reply to Re: i18n - how best to provide multilingual content

Your name:

Reply:


Posted by Captain Dondo on 01/20/07 16:05

V Sat, 20 Jan 2007 14:27:37 +0100, Rik napsal(a):

> Andy Dingley wrote:
>>> backend to serve up the language based a) the user's locale, and if
>>> that is not set, its own locale.
>>
>> Make the selection completely user-selectable, with cookie
>> persistence, with the methods you describe setting the default. It
>> works just the
>> same by default, but it's more flexible for casual users finding
>> themselves using other people's computers' It's a real nuisance
>> otherwise!
>
> Check, the order in which I determine language:
> - Explicitly set (by a GET variable, or pseudo one like /en/ or /de/ etc.
> taken into a rewrite)
> - Cookie
> - HTTP-Accept-Language in the header
> - Geo-IP info (there are free databases available, which are mostly
> accurate enough to determine the coutry most of the time)
> - System default
>
> After determining the language the cookie will be sent/overwritten with the
> current choice.
>

Thanks. I'll probably do something like that - I've thought about
using the 'HTTP-Accept-Language' var from the header. I just don't know
how many people actually set those correctly.

I guess I didn't phrase my question accurately enough; it has been a long
week.

I have XML templates that define item labels in a form. The XML has
various tags that provide nav info and so on. This is on an embedded
system, with only a small number of phrases that would need translation; I
probably have less than 200 phrases, mostly one and two words.

I have XML templates of the following form:

<item id="myname" value="" index="5" type="text">My Name</item>

The PHP backend reads that line, and creates a form entry for myname, with
the label "My Name". What I want to do is to replace the english "My
Name" with the appropriate words in the user's language.

I'm thinking of a mechanism similar to the .po files, where the PHP
backend look up the text in a translation file. Or even something like
this:

<item id="myname" value="" index="5" type="text" text="My Name"/>

and the PHP backend would look up the text value for "My Name" in a lookup
table for the user's language.

(Aside: I guess I failed to use Google correctly yesterday.... PHP has
support for gettext! <http://us3.php.net/gettext> So that's how I think I
will go...)

--Yan

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация