You are here: Re: i18n - how best to provide multilingual content « HTML « IT news, forums, messages
Re: i18n - how best to provide multilingual content

Posted by Rik on 01/20/07 16:17

Captain Dondo wrote:
> 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.

Not that many set it themselves, however, most browsers will set during
installation to the most probable language (based in install-languages
choice or for instance OS locale).

> 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'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...)

Check, with a limited amount of frases that would be my choice. A lot
harder to maintain in translating entire pages/documents though.
--
Rik Wasmus

 

Navigation:

[Reply to this 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

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