http-status-i18n
HTTP status and message mapping, i18n supported.
Installation
$ npm install http-status-i18n
API
var status = // or
status.BROWSER_LANG
Returns a lowercase string of default browser language set by user.
status.codes
Returns an array of all the status codes as Integer
s.
status[code]
Map of code
to status message
, in the same format as the Node.js http module. undefined
for invalid code
s. The language has been set to default en-us
.
status404 // => 'Not Found'status700 // => undefined
status(code, language)
Map of code
to status message
with specific language. The default browser language is assumed to be en-us
.
// => '无权限' // => '无权限' // => 'Unauthorized' // => 'Unauthorized'