+ Reply to Thread
Results 1 to 4 of 4

Language code list? (ISO 639-1?)

  1. #1
    Junior Member
    Join Date
    Nov 2009
    Posts
    0

    Default Language code list? (ISO 639-1?)

    [Note: parts of this message were removed to make it a legal post.]

    Hi there,

    I'm wondering there's any built-in list or gem that has the list of language
    codes/country names/language names (native/foreign, either's good) in it?
    Something like a list like this:

    http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes

    I could scrape it from the page and coerce it into a tneable format, but I
    don't want to reinvent the wheel.

    Cheers,
    Arlen.


  2. #2
    Junior Member
    Join Date
    Nov 2009
    Posts
    0

    Default Re: Language code list? (ISO 639-1?)

    [Note: parts of this message were removed to make it a legal post.]

    Well, I found this:

    http://www.iana.org/assignments/lang...ubtag-registry

    And I did mean a "tenable" format - one which I'd still like, should it
    exist. Otherwise this'll be a piece of cake anyway.

    Arlen


  3. #3
    Junior Member
    Join Date
    Nov 2009
    Posts
    0

    Default Re: Language code list? (ISO 639-1?)

    Arlen Cuss wrote:
    > Hi there,
    >
    > I'm wondering there's any built-in list or gem that has the list of
    > language
    > codes/country names/language names (native/foreign, either's good) in
    > it?
    > Something like a list like this:
    >
    > http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
    >
    > I could scrape it from the page and coerce it into a tneable format, but
    > I
    > don't want to reinvent the wheel.
    >
    > Cheers,
    > Arlen.


    http://locale.rubyforge.org/svn/trunk/lib/

    Regards,

    Siep
    --
    Posted via http://www.ruby-forum.com/.


  4. #4
    Junior Member
    Join Date
    Nov 2009
    Posts
    0

    Default Re: Language code list? (ISO 639-1?)

    On Apr 27, 2008, at 1:55 PM, Siep Korteling wrote:
    > Arlen Cuss wrote:
    >> I'm wondering there's any built-in list or gem that has the list of
    >> language
    >> codes/country names/language names (native/foreign, either's good) in
    >> it?
    >>


    [...]

    > http://locale.rubyforge.org/svn/trunk/lib/


    The locale module looks great! It seems like a pretty comprehensive
    interface to what you need, but if you happen to need something in one
    file, and don't need predicates and such, the Linguistics gem also has
    both the iso639-1 and iso639-2 codes in a module:

    http://deveiate.org/projects/Linguis...tics/iso639.rb

    Example usage:

    irb(main):001:0> require 'linguistics/iso639'
    => true
    irb(main):002:0> Linguistics::LanguageCodes['en']
    => {:codes=>["eng", "en"], :desc=>"English"}
    irb(main):003:0> Linguistics::LanguageCodes['sog']
    => {:codes=>["sog"], :desc=>"Sogdian"}


    --
    Michael Granger <ged@FaerieMUD.org>
    Rubymage, Architect, Believer
    The FaerieMUD Consortium <http://www.FaerieMUD.org/>







+ Reply to Thread