@narando/languages
Advanced tools
Comparing version 0.22.0 to 0.22.1
@@ -12,5 +12,13 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "translateLanguages", { | ||
enumerable: true, | ||
get: function () { | ||
return _translateLanguages.default; | ||
} | ||
}); | ||
var _getLanguagesWithSelection = _interopRequireDefault(require("./getLanguagesWithSelection")); | ||
var _translateLanguages = _interopRequireDefault(require("./translateLanguages")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
{ | ||
"name": "@narando/languages", | ||
"version": "0.22.0", | ||
"version": "0.22.1", | ||
"description": "", | ||
@@ -12,3 +12,4 @@ "main": "dist/index.js", | ||
"prepare": "npm run build", | ||
"test": "jest" | ||
"test": "jest", | ||
"lint-i18n": "lint-i18n --dir ./src/locales" | ||
}, | ||
@@ -33,5 +34,9 @@ "repository": { | ||
"@babel/core": "^7.2.2", | ||
"@babel/node": "^7.2.2" | ||
"@babel/node": "^7.2.2", | ||
"@narando/lint-i18n": "^0.22.1" | ||
}, | ||
"gitHead": "9c8b4f37690914ab272b6fe20cc7efa268186bb1" | ||
"dependencies": { | ||
"@narando/express-i18n-middleware": "^0.22.1" | ||
}, | ||
"gitHead": "bc912950fb8f7d7b72021db395131f47911a0456" | ||
} |
@@ -54,1 +54,32 @@ # @narando/languages | ||
``` | ||
## Utils | ||
Some more useful functions | ||
### Language with select flag | ||
In case you are trying to fill a selectpicker or something comparable. | ||
It could be usefull to get the language object with a selected flag. | ||
```javascript | ||
import { Utils } from "@narnado/languages"; | ||
res.locals.languages = Utils.getLanguagesWithSelection("es-419"); | ||
// The function returns a list with all languages. | ||
// es-419 is the only language with a selected=true | ||
``` | ||
### Get the languages translated | ||
In case you want to get the language object but want to get the translated language names. | ||
The languages are available in English (US) und German (Germany). More languages will be added in the future. | ||
```javascript | ||
import { Utils } from "@narnado/languages"; | ||
res.locals.languages = Utils.translateLanguages("de-DE"); | ||
// example: de-DE is now Deutsch (Deutschland) | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16153
14
402
85
1
4
1
+ Added@narando/errors@0.22.1(transitive)
+ Added@narando/express-i18n-middleware@0.22.1(transitive)
+ Added@narando/negotiate-accepted-language@0.22.1(transitive)
+ Addedcookies@0.7.1(transitive)
+ Addeddepd@1.1.2(transitive)
+ Addedi18next@12.1.0(transitive)
+ Addedi18next-express-middleware@1.9.1(transitive)
+ Addedkeygrip@1.0.3(transitive)