On Thursday 06 August 2009 01:04:10 Zero3 wrote:
> Zero3 skrev:
> > Daniel Cheng skrev:
> >> On Mon, Jul 6, 2009 at 8:58 AM, Zero3<ze...@zerosplayground.dk> wrote:
> >>> Reposting:
> >>>
> >>> bo-le skrev:
> >>>> Am Dienstag, 16. Juni 2009 21:40:53 schrieb Zero3:
> >>>>> Matthew Toseland skrev:
> >>>>>> On Sunday 14 June 2009 13:11:40 Zero3 wrote:
> >>>>>>> Matthew Toseland skrev:
> >>>>>>> This value is also passed on to the node via "node.l10n=Deutsch"
> >>>>>>> (example for German) in freenet.ini. (I don't think that specifying a
> >>>>>>> language by the localized name is ideal, but that seems to be how the
> >>>>>>> node wants it. I *did* ask if this could be changed to standardized
> >>>>>>> language IDs a while ago...)
> >>>>>> IIRC both work.
> >>>>> Which kind of IDs does it accept? I'd really like to switch over to that
> >>>>> instead.
> >>>> freenet.l10n.L10n.java shows you the strings:
> >>>>       /** @see "http://www.omniglot.com/language/names.htm"; */
> >>>>       public enum LANGUAGE {
> >>>>               ENGLISH("en", "English", "eng"),
> >>>>               SPANISH("es", "Español", "spa"),
> >>>>               DANISH("da", "Dansk", "dan"),
> >>>>               GERMAN("de", "Deutsch", "deu"),
> >>>>               FINNISH("fi", "Suomi", "fin"),
> >>>>               FRENCH("fr", "Français", "fra"),
> >>>>               ITALIAN("it", "Italiano", "ita"),
> >>>>               NORWEGIAN("no", "Norsk", "nor"),
> >>>>               POLISH("pl", "Polski", "pol"),
> >>>>               SWEDISH("se", "Svenska", "svk"),
> >>>>               CHINESE("zh-cn", "中文(简体)", "chn"),
> >>>>               CHINESE_TAIWAN("zh-tw", "中文(繁體)", "zh-tw"),
> >>>>               UNLISTED("unlisted", "unlisted", "unlisted");
> >>>>
> >>>> any string listed here can be used.
> >>> Cool. But which standards do these follow? <ISO 639>, <localized name>
> >>> and <ISO 639-3> (though zh-tw seems wrong then)?
> >>>
> >> Grad you ask about "zh-tw" :)
> >>
> >> The last field is supposed to be countries, or "Regional Authority".
> >> Here we have 3 problems:
> >>
> >> 1) Language does not match "Regional Authority"
> >>     For example, Spanish and English are used in USA
> >>     English is used in many commonwealth region.
> >>     Some minority language never have an official position
> >>     in ANY region.
> >>
> >> 2) Spoken Language and Written Language never match
> >>     中文(繁體) and 中文(简体) are different writing script for the
> >>     same (spoken) language family.
> >>
> >> 3) Some "Authority" are not globally recognized .
> >>     The "tw" in "zh-tw" stand for "Taiwan". Do I have to explain more?
> >>
> >> In short, we simply don't have any choice standard there.
> > 
> > Ugh. So what the heck do I do?
> > 
> > Right now, the wininstaller simply passes on the localized name of the 
> > language to fproxy, but that probably won't match most of the time. How 
> > should I negotiate with fproxy about which language to use? (... because 
> > another variation of French (for example), should still be a better 
> > choice than falling back to English).
> > 
> > IMHO this is a complete mess, and we are probably better off letting 
> > fproxy itself handle the language selection based on OS locale or user 
> > choice or whatever. Doesn't fproxy pull the OS locale and pre-select 
> > according to that anyway?
> 
> *bump*

We need to deal with this...

We do not currently autonegotiate language via fproxy. Even if we did we would 
want to be able to set the language by hand and remember it for that specific 
browser, that specific IP, or globally. Having said that, it is possible, and 
Artefact2's status line makes it more likely in the future, since the status 
line can be extended to allow switching language on the fly from a dropdown 
which is visible on all generated pages.

If there is no language argument set in the node, we use:
Locale.getDefault().getLanguage().toLowerCase()

On my system this returns "en" and it's likely that the other european 
constants would also work. Chinese will work too, because Java's constants for 
chinese are zh_CN and zh_TW. These ara reasonably close to ISO codes - what 
does Windows give you?

The objective for the installer setting it is simply that then we only ask the 
user once, and Freenet remembers what they chose. Arguably it is less prominent 
in your wininstaller, and that alone might be an argument for not setting the 
language? However, if you can get the language in something compatible with the 
above, it would be best if we could just select the language once.

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to