[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: languages lists



On Fri, 2009-05-01 at 13:28 +0200, Tobias Quathamer wrote:
> >
> > I would like to Internationalize it, So I assume I should get the user
> > to type it's language code (en, pt, pt_BR, zh_CN ...) rather than full
> > text, so gettext has consistent inputs using. typically using:
> > gettext(get_language_name(lang_code))
> > BTW: what do you think about it? should I prompt for locale or iso636?

> if I understand correctly, it should make no big difference. The name of the 
> locale (e.g. en_GB) is constructed from the ISO 639 language code, an 
> underscore, and the ISO 3166 country code.

Actually, I was wondering about those three letters iso codes
(ISO-636-2T or ISO-636-3...?!#@?)

> > Do you know a package which provides a locales->language name table?
> > (the package iso-codes has such list, but only in it's source package
> > notes/language-in-locales.txt)
> 
> Yes, correct. However, that file has not been updated for five years and is 
> considered obsolete. We (the iso-codes package maintainers) are removing 
> that file from the tarball. If you want to get a language name from the
> ISO 639 code, try installing the package isoquery. Then you can run a 
> command like that:

This tool is great!

Now I have another problem, it's that I prefer a "compact" (i.e common)
language name.

It seems I can reliably drop anything after semi-column and inside
parenthesis:

        isoquery  --iso=639  el nb st ca nl es pt | cut -f 3,4 
        el	Greek, Modern (1453-)
        nb	Bokmål, Norwegian; Norwegian Bokmål
        st	Sotho, Southern
        ca	Catalan; Valencian
        nl	Dutch; Flemish
        es	Spanish; Castilian
        pt	Portuguese
        
        isoquery  --iso=639 -l fr el nb st ca nl es pt | cut -f 3,4
        el	Grec moderne (après 1453)
        nb	Norvégien Bokmål
        st	Sotho du Sud
        ca	Catalan
        nl	Néerlandais
        es	Castillan
        pt	Portugais
        
        isoquery  --iso=639 -l el el nb st ca nl es pt | cut -f 3,4 
        el	Ελληνικά, Σύγχρονα
        nb	Bokmål, Norwegian; Norwegian Bokmål
        st	Sotho, Southern
        ca	Catalan; Valencian
        nl	Dutch; Flemish
        es	Spanish; Castilian
        pt	Πορτογαλικά

Do you think it's correct?

> $ isoquery --iso=639 --locale=nl it
> ita     ita     it      Italiaans
=> That's a great feature.

Thanks,

Franklin


Reply to: