From: Reini U. <ru...@x-...> - 2005-02-01 18:31:48
|
Arnaud Fontaine schrieb: > | The force the LANG in the apache startup script to 'C' ... and because > | you set the locale to DEFAULT_LANGUAGE only if LANG is empty, it's > | always set to what apache send you ... > > Still investigating ....... > > forcing the LANG in the apache startup script to fr_FR makes phpwiki > behaves strangelly : > > Most of my 'fr' wikis are working ... almost fine. Most of the time, > they are in french and sometimes (hard to see when ... generaly when > logged in as an admin and performing an action=upgrade ... but not only) > it goes back to 'en'. > > VERY strange. > > We really need to set the locale once and very clearly ... not get > confused with LANG and DEFAULT_LANGUAGE ... well ... what else ... Oh > yes, we need an option to not allow locale switching. Why did I add $LANG to DEFAULT_LANGUAGE? I don't remember exactly, but the rough estimation goes like this: Configs cannot only be set once and only, when they have to be changed - e.g. by userprefs or if empty for late auto-detection - they must become a global. Other discrepancies: The locale subdirs are not 1:1 mapped to $LANG. The locale may have a subsection like "de_AT" ($LANG also) and additionally a charset, like de_AT.utf8 (lang NOT) Our bindtextdomain paths (locale/*) should provide these alternatives also. Esp. for utf8 once it's ready. To have ja.utf8 and ja.euc-jp or sv.utf8 Then some lang+locale functions have to be fixed. Better sooner than later, because better databases require better charsets, and utf8 is usually the easiest to convert to and from on collate (sorting) on user-input and pagenames. With latin1 we will hit a border. With mysql-4.1.8 or postgreslql-8.0 I already need a utf-8 database or have to do manual utf8 conversion on unusual pagenames. If DEFAULT_LANGUAGE is empty, the server (or client's?) locale should be used. If userprefs don't override $LANG: $LANG = DEFAULT_LANGUAGE. How to avoid lang switching? Currently it's avoided by disabling the pulldown in userprefs.tmpl Avoiding locale switching? We must do setlocale() to support gettext(), otherwise it will not find the right locale subdir. That's a gettext limitation. This was always automatic and we will not change this. But we have to change the logic to check first DEFAULT_LANGUAGE, and only if this is not set, check LANG or do autodetection. -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ |