[vox] New, improved Tux Paint site!
Bill Kendrick
vox@lists.lugod.org
Fri, 12 Mar 2004 12:35:41 -0800
<snippage>
Okay, I'm pretty much doing this now. I keep track of which pages are
translated into what lanuages (I did this before to show the flag icons
at the top).
If the page hasn't been translated into the language they apparently chose
using the form (say, "Catalan"), the PHP variable "HTTP_ACCEPT_LANGUAGE"
is examined to see their preference. If the page is translated into one
of the languages they accept (say, "Spanish"), that version of the
page is shown. Otherwise, it kicks down to English.
So for example, right now, I tell Mozilla I want Japanese as #1 top choice,
Spanish as #2, and English as #3. ("Prefs -> Navigator -> Language")
If I hit the URL:
http://www.newbreedsoftware.com/tuxpaint/index2.php3
it displays the Japanes version of the "About" page. If I click "Reviews",
I get the Spanish version. (Because that page hasn't been translated into
Japanese yet.)
If I hit the "Contact" page, I get the Enlgish version (because, that's
the only one available :^) )
Of course, I can override my presumed preference for Japanese by clicking
the language in the little dropdown menu at the bottom right of a page.
(And now, only the languages that particular page is available in are
listed.)
If I hit a page not translated, it once again checks ACCEPT_LANGUAGE to
decide what to try next. :^)
Cool!
Thx everyone!
-bill!