Skip to content

Latest commit

 

History

History
34 lines (29 loc) · 728 Bytes

README.md

File metadata and controls

34 lines (29 loc) · 728 Bytes

extern-js-accept-language

  • Target : Javascript (NodeJS)
  • Library : accept-language
  • Last tested version : 2.0.16
  • Available on : Github - NPM

Usage

import js.acceptlanguage.*;

class Main
{
  static function main()
  {
    AcceptLanguage.instance.languages(['en-US', 'zh-CN']);
    trace(AcceptLanguage.instance.get('en-GB,en;q=0.8,sv')); /* 'en-US' */

    var language = AcceptLanguage.instance.parse('en-GB,en;q=0.8,sv');
    trace(language);
    /*
    [
      {
        value: 'en-US',
        language: "en",
        region: "US",
        quality: 1.0
      }
    ];
    */
  }
}