locale2::flexed_biceps:尽可能尝试在节点或浏览器中检测客户端的语言标签(“语言环境”)。 Browseri

  • o7_113726
    了解作者
  • 193.4KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-14 20:11
    上传日期
地区2 尽力尝试在节点或浏览器中检测客户端的语言标签(“语言环境”)。 Browserify和Webpack友好! 关于语言标签,区域设置,RFC-5646和BCP-47 IETF在2009年发布了RFC-5646 , “用于标识语言的标签” ,其中“ ...描述了在需要指示语言中使用的语言的情况下所使用的语言标签的结构,内容,构造和语义。信息对象。” 语言标签由一个或多个“子标签”的序列组成,每个子标签都会细化或缩小整个标签所标识的语言范围。 子标签又是由字母数字字符(字母和数字)组成的序列,通过连字符("-", [Unicode] U+002D)与标签中的其他子标签区分开并分开。
locale2-master.zip
  • locale2-master
  • .travis.yml
    52B
  • index.js
    44B
  • test-bs.bundle.js
    258.5KB
  • test.js
    3.4KB
  • package.json
    1.8KB
  • assets
  • bs.png
    11.4KB
  • .credentials.example
    41B
  • LICENSE
    1.1KB
  • package-lock.json
    526.5KB
  • .publishrc
    336B
  • src
  • utils.js
    496B
  • index.js
    1.3KB
  • .npmignore
    42B
  • .gitignore
    44B
  • browserstack.json
    352B
  • test-bs.js
    320B
  • webpack.config.js
    235B
  • README.md
    2.9KB
  • test-bs.html
    85B
内容介绍
# locale2 [![Build Status][travis-image]][travis-url] [![Version][npm-version-image]][npm-version-url] [![Downloads][npm-downloads-image]][npm-downloads-url] [![Deps][npm-deps-image]][npm-deps-url] [![DevDeps][npm-devdeps-image]][npm-devdeps-url] Try as hard as possible to detect the client's language tag ("locale") in node or the browser. Browserify and Webpack friendly! ## About Language Tags, Locale, RFC-5646 and BCP-47 In 2009, IETF published **RFC-5646**, _"Tags for Identifying Languages,"_ in which "...describes the structure, content, construction, and semantics of **language tags** for use in cases where it is desirable to indicate the language used in an information object." A **language tag** is composed from a sequence of one or more _"subtags"_, each of which refines or narrows the range of language identified by the overall tag. Subtags, in turn, are a sequence of alphanumeric characters (letters and digits), distinguished and separated from other subtags in a tag by a hyphen `("-", [Unicode] U+002D)`. **References:** 1. [RFC-5646](https://tools.ietf.org/html/rfc5646) 1. [BCP-47](https://tools.ietf.org/html/bcp47) ### Unit tested and browser tested with BrowserStack [![BrowserStack][browserstack-logo]][browserstack-url] **Tested successfully on:** ✓ IE 8 ✓ IE 9 ✓ IE 10 ✓ IE 11 ✓ IE 12 (Edge) ✓ Safari 5.1+ ✓ Opera (Presto, Webkit, Blink) ✓ Firefox ✓ Chrome ### Node support ```sh $ babel-node > import locale2 from 'locale2' > locale2 en-US > ``` ### ...and pairs well with [iso3166-1](https://npmjs.org/package/iso3166-1)! ```sh var iso3166 = require('iso3166-1') var locale2 = require('locale2') > iso3166.from(locale2).to3() USA > ``` ## Install ```sh npm install --no-optional npm test ``` ## Development ### Browser testing (currently private) ```sh npm run test:bs npm run test:bs:local ``` ## Try it now [![view on requirebin](http://requirebin.com/badge.png)](http://requirebin.com/?gist=8394988344ff2514df5e) ## License [![License][npm-license-image]][npm-license-url] [browserstack-logo]: https://raw.githubusercontent.com/moimikey/locale2/master/assets/bs.png [browserstack-url]: http://browserstack.com [npm-version-url]: https://www.npmjs.com/package/locale2 [npm-version-image]: https://img.shields.io/npm/v/locale2.svg [npm-license-url]: https://github.com/moimikey/locale2/blob/master/LICENSE [npm-license-image]: https://img.shields.io/npm/l/locale2.svg [npm-downloads-url]: https://www.npmjs.com/package/locale2 [npm-downloads-image]: https://img.shields.io/npm/dm/locale2.svg [npm-deps-url]: https://david-dm.org/moimikey/locale2 [npm-deps-image]: https://img.shields.io/david/moimikey/locale2.svg [npm-devdeps-url]: https://david-dm.org/moimikey/locale2 [npm-devdeps-image]: https://img.shields.io/david/dev/moimikey/locale2.svg [travis-url]: https://travis-ci.org/moimikey/locale2 [travis-image]: https://travis-ci.org/moimikey/locale2.svg?branch=master
评论
    相关推荐