This is a discussion on Newbie asks about multi-lingual website strategies within the PHP General forums, part of the PHP Programming Forums category; I'm a noob so keep the comments to a noob's level please. I am doing a website and ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I'm a noob so keep the comments to a noob's level please.
I am doing a website and my client wants the bulk of the text to be bilingual (French and English). The last site I did used php and mysql so I am getting comfortable with that technology. Typically I am using a single php file and my menu constantly points to the same file with different id options example "index.php?id=30" and I want to use the same idea to choose a language example "index.php?lang=fr&id=30". Pretty straight forward for many of you folks but before I start reinventing the wheel I wondered if anyone could offer any suggestions. I have a couple of approaches in mind. 1: Session vars, I have never used this but it seems straight forward. Drawbacks? 2: Cookies again not too big a deal, never used cookies either but it doesn't seem to be mystifying however the fact that the user can turn cookies off makes me not want to go this route. 3: Use the mysql database and log each ip address and record the preference and maybe the last time on the site. I am leaning in this direction because I think it is the most robust but will it be slow? First I have to get the ip then I have to check to see if it is in my data base and then get the language preference. It would be great to have a standardized function that I could use on all of my sites. I live in a bilingual country (Canada) so this could be a real selling point for my services. Any any and all comments are welcome, it will be a learning curve no matter which route I take so a little advice on the best direction pros cons would be great. And of course knowing that I will have many many thousands of people on my site (hee hee) which option will perform best once I start accumulating vistors. That's one problem I see with the mysql solution, I think it may start to be slow unless I start purging vistors who have not shown up in a while or limit the number of entries. Thanks, Jeff |
|
|||
|
On Nov 27, 2007, at 8:37 AM, Jeff Benetti wrote: > I'm a noob so keep the comments to a noob's level please. > > I am doing a website and my client wants the bulk of the text to be > bilingual (French and English). The last site I did used php and > mysql so I > am getting comfortable with that technology. Typically I am using a > single > php file and my menu constantly points to the same file with > different id > options example "index.php?id=30" and I want to use the same idea to > choose > a language example "index.php?lang=fr&id=30". Pretty straight > forward for > many of you folks but before I start reinventing the wheel I > wondered if > anyone could offer any suggestions. I have a couple of approaches > in mind. > I'm actually in the process of planning this as well... English and Spanish... > 1: Session vars, I have never used this but it seems straight forward. > Drawbacks? Sessions are easy enough to use, just make sure that you are setting the variable in the right place... On a site I did the stored variable was always 1 behind what I wanted it to be... I moved the setting of the variable, and it worked :) > > 2: Cookies again not too big a deal, never used cookies either but it > doesn't seem to be mystifying however the fact that the user can turn > cookies off makes me not want to go this route. > 3: Use the mysql database and log each ip address and record the > preference > and maybe the last time on the site. I am leaning in this direction > because > I think it is the most robust but will it be slow? First I have to > get the > ip then I have to check to see if it is in my data base and then get > the > language preference. It would be great to have a standardized > function that > I could use on all of my sites. I live in a bilingual country > (Canada) so > this could be a real selling point for my services. I don't know much about using mysql for storing IP's in canada... But in the US, all IP's except for businesses are dynamic, they could change every time a user would go to a site.. I could see that causing issues... > > > Any any and all comments are welcome, it will be a learning curve no > matter > which route I take so a little advice on the best direction pros > cons would > be great. > > And of course knowing that I will have many many thousands of people > on my > site (hee hee) which option will perform best once I start > accumulating > vistors. That's one problem I see with the mysql solution, I think > it may > start to be slow unless I start purging vistors who have not shown > up in a > while or limit the number of entries. I'm currently planning to store the text of the pages on my site in a database, so that I can very easily just change the language preference, and get the english, or spanish out of the database. I also think it will help speed up the site for when I have my thousands of users a second :) When you start doing it, let me know your experiences... I plan to actually start coding (If me and the site owner can see eye to eye on some stuff...) in january. -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com japruim@raoset.com |
|
|||
|
We use something similar to the following
define('DEFAULT_LANG_ID', 'en'); function getLanguageId() { // Allow for language id override in $_GET, $_POST and $_COOKIE $req_lang_id = $_REQUEST['lang_id']; // Retrieve the one stored in the session if any $sess_lang_id = $_SESSION['lang_id']; // $lang_id will contain the lang id retrieved from request (overrides session), // or from session or a default one $lang_id = isset($req_lang_id) ? $req_lang_id : (isset($sess_lang_id) ? $sess_lang_id : DEFAULT_LANG_ID); // Save it for next time $_SESSION['lang_id'] = $lang_id; return $lang_id; } Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 Email: info@bestplace.net | MSN Chat: best@bestplace.net | SKYPE: bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com > -----Original Message----- > From: Jason Pruim [mailto:japruim@raoset.com] > Sent: Tuesday, November 27, 2007 11:15 AM > To: Jeff Benetti > Cc: php-general@lists.php.net > Subject: Re: [php] Newbie asks about multi-lingual website strategies > > > On Nov 27, 2007, at 8:37 AM, Jeff Benetti wrote: > > > I'm a noob so keep the comments to a noob's level please. > > > > I am doing a website and my client wants the bulk of the text to be > > bilingual (French and English). The last site I did used php and > > mysql so I > > am getting comfortable with that technology. Typically I am using a > > single > > php file and my menu constantly points to the same file with > > different id > > options example "index.php?id=30" and I want to use the same idea to > > choose > > a language example "index.php?lang=fr&id=30". Pretty straight > > forward for > > many of you folks but before I start reinventing the wheel I > > wondered if > > anyone could offer any suggestions. I have a couple of approaches > > in mind. > > > > I'm actually in the process of planning this as well... English and > Spanish... > > > 1: Session vars, I have never used this but it seems straight > forward. > > Drawbacks? > > Sessions are easy enough to use, just make sure that you are setting > the variable in the right place... On a site I did the stored variable > was always 1 behind what I wanted it to be... I moved the setting of > the variable, and it worked :) > > > > 2: Cookies again not too big a deal, never used cookies either but it > > doesn't seem to be mystifying however the fact that the user can turn > > cookies off makes me not want to go this route. > > 3: Use the mysql database and log each ip address and record the > > preference > > and maybe the last time on the site. I am leaning in this direction > > because > > I think it is the most robust but will it be slow? First I have to > > get the > > ip then I have to check to see if it is in my data base and then get > > the > > language preference. It would be great to have a standardized > > function that > > I could use on all of my sites. I live in a bilingual country > > (Canada) so > > this could be a real selling point for my services. > > I don't know much about using mysql for storing IP's in canada... But > in the US, all IP's except for businesses are dynamic, they could > change every time a user would go to a site.. I could see that causing > issues... > > > > > > > Any any and all comments are welcome, it will be a learning curve no > > matter > > which route I take so a little advice on the best direction pros > > cons would > > be great. > > > > And of course knowing that I will have many many thousands of people > > on my > > site (hee hee) which option will perform best once I start > > accumulating > > vistors. That's one problem I see with the mysql solution, I think > > it may > > start to be slow unless I start purging vistors who have not shown > > up in a > > while or limit the number of entries. > > I'm currently planning to store the text of the pages on my site in a > database, so that I can very easily just change the language > preference, and get the english, or spanish out of the database. I > also think it will help speed up the site for when I have my thousands > of users a second :) > > When you start doing it, let me know your experiences... I plan to > actually start coding (If me and the site owner can see eye to eye on > some stuff...) in january. > > > -- > > Jason Pruim > Raoset Inc. > Technology Manager > MQC Specialist > 3251 132nd ave > Holland, MI, 49424 > www.raoset.com > japruim@raoset.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php |
|
|||
|
Jeff Benetti wrote:
> I'm a noob so keep the comments to a noob's level please. > > I am doing a website and my client wants the bulk of the text to be > bilingual (French and English). The last site I did used php and mysql so I > am getting comfortable with that technology. Typically I am using a single > php file and my menu constantly points to the same file with different id > options example "index.php?id=30" and I want to use the same idea to choose > a language example "index.php?lang=fr&id=30". Pretty straight forward for > many of you folks but before I start reinventing the wheel I wondered if > anyone could offer any suggestions. I have a couple of approaches in mind. > > 1: Session vars, I have never used this but it seems straight forward. > Drawbacks? > 2: Cookies again not too big a deal, never used cookies either but it > doesn't seem to be mystifying however the fact that the user can turn > cookies off makes me not want to go this route. > 3: Use the mysql database and log each ip address and record the preference > and maybe the last time on the site. I am leaning in this direction because > I think it is the most robust but will it be slow? First I have to get the > ip then I have to check to see if it is in my data base and then get the > language preference. It would be great to have a standardized function that > I could use on all of my sites. I live in a bilingual country (Canada) so > this could be a real selling point for my services. > > Any any and all comments are welcome, it will be a learning curve no matter > which route I take so a little advice on the best direction pros cons would > be great. > > And of course knowing that I will have many many thousands of people on my > site (hee hee) which option will perform best once I start accumulating > vistors. That's one problem I see with the mysql solution, I think it may > start to be slow unless I start purging vistors who have not shown up in a > while or limit the number of entries. First of all you can use the browser supplied language preferences (if available) to try and guess the users preferred language. It should be obvious from phpinfo() and a half decent browser what vars you need to inspect ($_SERVER['HTTP_LANG'] or something like that - can't remember of hand!). You could do soemthing like: 1. Check session for lang preference and use it. 2. Regardless of the result of 1, check GET for a preference and store in session if present and use it. 3. If neither 1 nor 2 has any preference, use the browser supplied preference. 4. If nothing else, use a hard coded default. OK, that selection taken care of :) For hard coded strings in your PHP code use Gettext and bind to standard your catalog files and use the language choice from the above algorithm. xgettext can extract strings from PHP files easily enough. You just have to make sure you write in your default language and do not use variable substition as you normally would in PHP. e.g. BAD: echo gettext("Hello $user, welcome to my site"); GOOD: printf(gettext("Hello %s, welcome to my site"), $user); printf and sprintf are your friend!! If you use modules, be sure to write all your strings with a gettext domain. It's a pain to go back and do this later!!! I'd recommend looking at the gallery2 codebase for a nice example of well internationalised and modular string handling. As for the database contained strings there are multiple approaches here. You could have a general linking structure that uses tables to store the different strings. This is simple conceptually but also a pain to implement in terms of SQL code. I've actually created a set of custom functions for MySQL (in C) which pack and extract multilingual content into text fields. It's a bit of a pain in terms of standards complient SQL but it makes coding much simpler. I would do e.g. "INSERT INTO table (mystring) VALUES(LANG_PACK('en', 'Hello', 'fr', 'Bonjour')); Then SELECT LANG_EXTRACT(mystring) FROM table; ("Hello" - defaults to first string) of SELECT LANG_EXTRACT(mystring, 'de', 'fr') FROM table; ('Bonjour' - can't find de but finds fr). I've wrapped up the calls to LANG_EXTRACT in the SQL to use the user's language preference automatically which works quite well. There are lots of solutions here and if I were to think about it again I'd maybe reconsider what I've done. It's convenient in some ways but not so in others! Hope this gives food for thought. Col |
|
|||
|
your all missing something, namely that the browser can tell you what
it's preferred language is (which you can use to select a language in the event no language has yet been determined for the current session). you do this by parsing the value of the HTTP_ACCEPT_LANGUAGE request header. HTTP_ACCEPT_LANGUAGE is in the form: en-us,en,fr,nl,nl-be;q=0.5 <?php // following if statement exists for testing this code on the command line if (!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'en-us,en,fr,nl,nl-be;q=0.5'; $lLangs = explode(',', preg_replace('#;.*$#', '', $_SERVER['HTTP_ACCEPT_LANGUAGE'])); $sLangs = array_unique(array_map('substr', $lLangs, array_fill(0, count($lLangs), 0), array_fill(0, count($lLangs), 2))); var_dump($lLangs, $sLangs); Andrés Robinet wrote: > We use something similar to the following > > define('DEFAULT_LANG_ID', 'en'); > > function getLanguageId() { > // Allow for language id override in $_GET, $_POST and $_COOKIE > $req_lang_id = $_REQUEST['lang_id']; > // Retrieve the one stored in the session if any > $sess_lang_id = $_SESSION['lang_id']; > // $lang_id will contain the lang id retrieved from request (overrides > session), > // or from session or a default one > $lang_id = isset($req_lang_id) ? $req_lang_id : (isset($sess_lang_id) ? > $sess_lang_id : DEFAULT_LANG_ID); > // Save it for next time > $_SESSION['lang_id'] = $lang_id; > return $lang_id; > } > > Rob > > > Andrés Robinet | Lead Developer | BESTPLACE CORPORATION > 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 > | TEL 954-607-4207 | FAX 954-337-2695 > Email: info@bestplace.net | MSN Chat: best@bestplace.net | SKYPE: > bestplace | Web: http://www.bestplace.biz | Web: http://www.seo-diy.com > >> -----Original Message----- >> From: Jason Pruim [mailto:japruim@raoset.com] >> Sent: Tuesday, November 27, 2007 11:15 AM >> To: Jeff Benetti >> Cc: php-general@lists.php.net >> Subject: Re: [php] Newbie asks about multi-lingual website strategies >> >> >> On Nov 27, 2007, at 8:37 AM, Jeff Benetti wrote: >> >>> I'm a noob so keep the comments to a noob's level please. >>> >>> I am doing a website and my client wants the bulk of the text to be >>> bilingual (French and English). The last site I did used php and >>> mysql so I >>> am getting comfortable with that technology. Typically I am using a >>> single >>> php file and my menu constantly points to the same file with >>> different id >>> options example "index.php?id=30" and I want to use the same idea to >>> choose >>> a language example "index.php?lang=fr&id=30". Pretty straight >>> forward for >>> many of you folks but before I start reinventing the wheel I >>> wondered if >>> anyone could offer any suggestions. I have a couple of approaches >>> in mind. >>> >> I'm actually in the process of planning this as well... English and >> Spanish... >> >>> 1: Session vars, I have never used this but it seems straight >> forward. >>> Drawbacks? >> Sessions are easy enough to use, just make sure that you are setting >> the variable in the right place... On a site I did the stored variable >> was always 1 behind what I wanted it to be... I moved the setting of >> the variable, and it worked :) >>> 2: Cookies again not too big a deal, never used cookies either but it >>> doesn't seem to be mystifying however the fact that the user can turn >>> cookies off makes me not want to go this route. >>> 3: Use the mysql database and log each ip address and record the >>> preference >>> and maybe the last time on the site. I am leaning in this direction >>> because >>> I think it is the most robust but will it be slow? First I have to >>> get the >>> ip then I have to check to see if it is in my data base and then get >>> the >>> language preference. It would be great to have a standardized >>> function that >>> I could use on all of my sites. I live in a bilingual country >>> (Canada) so >>> this could be a real selling point for my services. >> I don't know much about using mysql for storing IP's in canada... But >> in the US, all IP's except for businesses are dynamic, they could >> change every time a user would go to a site.. I could see that causing >> issues... >> >>> >>> Any any and all comments are welcome, it will be a learning curve no >>> matter >>> which route I take so a little advice on the best direction pros >>> cons would >>> be great. >>> >>> And of course knowing that I will have many many thousands of people >>> on my >>> site (hee hee) which option will perform best once I start >>> accumulating >>> vistors. That's one problem I see with the mysql solution, I think >>> it may >>> start to be slow unless I start purging vistors who have not shown >>> up in a >>> while or limit the number of entries. >> I'm currently planning to store the text of the pages on my site in a >> database, so that I can very easily just change the language >> preference, and get the english, or spanish out of the database. I >> also think it will help speed up the site for when I have my thousands >> of users a second :) >> >> When you start doing it, let me know your experiences... I plan to >> actually start coding (If me and the site owner can see eye to eye on >> some stuff...) in january. >> >> >> -- >> >> Jason Pruim >> Raoset Inc. >> Technology Manager >> MQC Specialist >> 3251 132nd ave >> Holland, MI, 49424 >> www.raoset.com >> japruim@raoset.com >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php > |
|
|||
|
My approach to multi lang abilities uses the following db structure base_name is the input field name and the basic raw label for the field lang_1 lang_2 .... lang_12 prompt_1 prompt_2 .... prompt_12 since i currently need to support 12 languages in the initial concept when the user signs on, i equate the language to an offset on the table to be able to pull the correct language out of the tables. I have the prompts in there to provide prompts for input fields as required. These values are then input thru a translation interface. Using the interface, i build up translatable values for the controls as well, where items like radio buttons and selects are done in the following manner base_name lang_1 lang_2 ... lang_n ---------------------------------------------------------------------------------------------------- salutation Salutation Salut something base_name.db_value_1 = first option mr Mister Monsiour base_name.db_value_2 = second option mrs Mrs Madam .... base_name.db_value_n = n option Then for each option value i have a function that pulls the the correct values and builds the options list for each control type Our final step to improve perfomance (note that this is, sadly, ASP / vbscript ) was to take the translation table into an XML application level object to cache the data since its relatively immutable. Now when I write this same app in php, I am more likely to skip the cachingportion of this in favor of templating the forms for each language. I would use a folder for each language. hth bastien > To: php-general@lists.php.net> From: gmane@colin.guthr.ie> Date: Tue, 27 Nov 2007 15:18:45 +0000> Subject: [php] Re: Newbie asks about multi-lingualwebsite strategies> > Jeff Benetti wrote:> > I'm a noob so keep the comments to a noob's level please.> > > > I am doing a website and my client wants the bulk of the text to be> > bilingual (French and English). The last site I did used php and mysql so I> > am getting comfortable with that technology. Typically I am using a single> > php file and my menu constantly points to the same file with different id> > options example "index.php?id=30" and I want to use the same idea to choose> > a language example "index.php?lang=fr&id=30". Pretty straight forward for> > many of you folks but before I start reinventing the wheel I wondered if> > anyone could offer any suggestions. I have a couple of approaches in mind.> > > > 1: Session vars, I have never used this but it seems straight forward.> > Drawbacks?> > 2: Cookies again not too big a deal, never used cookies either but it> > doesn't seem to be mystifying however the fact that the user can turn> > cookies off makes me not want to go this route.> > 3: Use the mysql database andlog each ip address and record the preference> > and maybe the last time on the site. I am leaning in this direction because> > I think it is the most robust but will it be slow? First I have to get the> > ip then I have to check to see if it is in my data base and then get the> > language preference. It would be great to have a standardized function that> > I could use on all of my sites. I live in a bilingual country (Canada) so> > this could be a real selling point for my services.> > > > Any any and all comments are welcome, it will be a learning curve no matter> > which route I take so alittle advice on the best direction pros cons would> > be great.> > > > And of course knowing that I will have many many thousands of people on my> >site (hee hee) which option will perform best once I start accumulating> >vistors. That's one problem I see with the mysql solution, I think it may>> start to be slow unless I start purging vistors who have not shown up ina> > while or limit the number of entries.> > > First of all you can use the browser supplied language preferences (if> available) to try and guess the users preferred language. It should be> obvious from phpinfo() and a half decent browser what vars you need to> inspect ($_SERVER['HTTP_LANG'] or something like that - can't remember> of hand!).> > You could do soemthing like:> 1. Check session for lang preference and use it.> 2. Regardless of the result of 1, check GET for a preference and store> in session if present and use it.> 3. If neither 1 nor 2 has any preference, use the browser supplied> preference.> 4. If nothing else, use a hard coded default.> > > > OK,that selection taken care of :)> > > For hard coded strings in your PHP code use Gettext and bind to standard> your catalog files and use the language choice from the above algorithm.> xgettext can extract strings from PHP files easily enough. You just have> to make sure you write in your default language and do not use variable> substition as you normally would in PHP.> > e.g.> BAD:> echo gettext("Hello $user, welcome to my site");> > GOOD:> printf(gettext("Hello %s, welcome to my site"), $user);> > printf and sprintfare your friend!!> > > If you use modules, be sure to write all your strings with a gettext> domain. It's a pain to go back and do this later!!!> > >I'd recommend looking at the gallery2 codebase for a nice example of> wellinternationalised and modular string handling.> > > > As for the database contained strings there are multiple approaches here.> > You could have a general linking structure that uses tables to store the> different strings. This is simple conceptually but also a pain to> implement in terms of SQL code.> > I've actually created a set of custom functions for MySQL (in C) which> pack and extract multilingual content into text fields. It's a bit of a> pain in terms of standards complient SQL but it makes coding much simpler.> > I would do e.g. "INSERT INTO table (mystring) VALUES(LANG_PACK('en',>'Hello', 'fr', 'Bonjour'));> > Then> SELECT LANG_EXTRACT(mystring) FROM table;> ("Hello" - defaults to first string)> of> SELECT LANG_EXTRACT(mystring, 'de', 'fr') FROM table;> ('Bonjour' - can't find de but finds fr).> > I've wrapped up the calls to LANG_EXTRACT in the SQL to use the user's> language preference automatically which works quite well.> > There are lots of solutions here and if I were to think about it again> I'd maybe reconsider what I've done. It's convenient in some ways but> not so in others!> > Hope this gives food for thought.> > Col> > -- > PHP General Mailing List (http://www.php.net/)> To unsubscribe, visit: http://www.php.net/unsub.php> __________________________________________________ _______________ Have fun while connecting on Messenger! Click here to learn more. http://entertainment.sympatico.msn.ca/WindowsLiveMessenger |
|
|||
|
At 9:37 AM -0400 11/27/07, Jeff Benetti wrote:
>Any any and all comments are welcome, it will be a learning curve no matter >which route I take so a little advice on the best direction pros cons would >be great. > > >Thanks, >Jeff Jeff: If it were me, I wouldn't use any problematic browser detects schemes (they don't work) or any of that high-thought stuff -- it's beyond me. I would simply use a "click here" for English/French/Whatever link and then pull all the language specific stuff from the dB. Then throw the user's choice in a session and carry-on -- simple. It wouldn't be any different than a php style sheet switcher, like this: http://sperling.com/examples/styleswitch1/ Instead of green/red/blue/black, why not English/French/Spanish/German? HTH's Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com |
|
|||
|
tedd wrote:
> At 9:37 AM -0400 11/27/07, Jeff Benetti wrote: >> Any any and all comments are welcome, it will be a learning curve no >> matter >> which route I take so a little advice on the best direction pros cons >> would >> be great. >> >> >> Thanks, >> Jeff > > Jeff: > > If it were me, I wouldn't use any problematic browser detects schemes > (they don't work) or any of that high-thought stuff -- it's beyond me. whether it's beyond you or not only you can judge, but I disagree that it's problematic. I should note that I recommend using browser language preference detection (as per my previous post) as a means to initially select a [hopefully] suitable language BUT that this should be done in addition to offer the user an explicit mechanism for language selection. > > I would simply use a "click here" for English/French/Whatever link and > then pull all the language specific stuff from the dB. Then throw the > user's choice in a session and carry-on -- simple. > > It wouldn't be any different than a php style sheet switcher, like this: > > http://sperling.com/examples/styleswitch1/ > > Instead of green/red/blue/black, why not English/French/Spanish/German? > > HTH's > > Cheers, > > tedd > > |
|
|||
|
Jochem Maas wrote:
> tedd wrote: >> At 9:37 AM -0400 11/27/07, Jeff Benetti wrote: >>> Any any and all comments are welcome, it will be a learning curve no >>> matter >>> which route I take so a little advice on the best direction pros cons >>> would >>> be great. >>> >>> >>> Thanks, >>> Jeff >> Jeff: >> >> If it were me, I wouldn't use any problematic browser detects schemes >> (they don't work) or any of that high-thought stuff -- it's beyond me. > > whether it's beyond you or not only you can judge, but I disagree that it's > problematic. I should note that I recommend using browser language preference > detection (as per my previous post) as a means to initially select a [hopefully] > suitable language BUT that this should be done in addition to offer the user > an explicit mechanism for language selection. +1 on that strategy. May as well at least *try* to take an initial educated guess!! Col |
|
|||
|
At 11:05 PM +0100 11/27/07, Jochem Maas wrote:
>tedd wrote: > > > If it were me, I wouldn't use any problematic browser detects schemes >> (they don't work) or any of that high-thought stuff -- it's beyond me. > >whether it's beyond you or not only you can judge, but I disagree that it's >problematic. I should note that I recommend using browser language preference >detection (as per my previous post) as a means to initially select a >[hopefully] >suitable language BUT that this should be done in addition to offer the user >an explicit mechanism for language selection. My "beyond me" statement was meant in jest, but browser sniffing is notorious for being inaccurate and the practice is highly controversial. http://en.wikipedia.org/wiki/Browser_sniffing If you're going to permit the user to select his language, then what difference does it make what language you choose first? IMO, you would be better off to keep a record of the languages chosen and then present to a new user the highest ranking one first. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com |