Re: language environment variable?
Ken Jones wrote: Hi, I'm working on redoing the qmailadmin code to support multiple languages. Instead of doing some wierd tricky code, I figured we can use the built in language environment variable from the web server. There goes Mr. Jones!! Thank you, man! It'll be really appreciated! Does anyone know the name of the environment variable that carries the language? See `man setlocale` I think you'll choose 'LC_ALL' I'm removing all the hard coded english text from qmailadmin and putting it in a file. So no "text" is compiled in. Great!! Then we can do translation of the html templates and this one file into different languages. So when people connect to qmailadmin, it can automatically display it in the proper language based on what the user has set as thier language in the browser. Ken Jones Using 'Accept-Language'? Great work! Daniel Augusto Fernandes (DAF tm) [EMAIL PROTECTED] GCSNethttp://www.gcsnet.com.br/ Se você não encontra o sentido das coisas é porque este não se encontra, se cria. Antoine Saint-Exupéry
Re: language environment variable?
I think I've figured it out using the printenv perl script that comes with apache. HTTP_ACCEPT_LANGUAGE="en, eu" Daniel Augusto Fernandes [EMAIL PROTECTED] wrote Using 'Accept-Language'? yep, that looks like the one. I'll need to write some error checking code, but not for now. Like.. HTTP_ACCEPT_LANGUAGE="fr, eu" If there is no fr translation, try eu if there is no eu translation, default to en Ken
Re: language environment variable?
Ken Jones wrote: I think I've figured it out using the printenv perl script that comes with apache. HTTP_ACCEPT_LANGUAGE="en, eu" Heheh... seems that I mixed up things! Daniel Augusto Fernandes [EMAIL PROTECTED] wrote Using 'Accept-Language'? yep, that looks like the one. I'll need to write some error checking code, but not for now. Like.. HTTP_ACCEPT_LANGUAGE="fr, eu" If there is no fr translation, try eu if there is no eu translation, default to en A while loop would resolve it, would not? Daniel Augusto Fernandes (DAF tm) [EMAIL PROTECTED] GCSNethttp://www.gcsnet.com.br/ Se você não encontra o sentido das coisas é porque este não se encontra, se cria. Antoine Saint-Exupéry