Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Node.js lib helps to retrieve a list of supported languages to be used in web apps UI.
Node.js lib helps to retrieve a list of supported languages to be used in web apps UI.
var LangList = require('lang-list');
This function will retrieve a list of supported languages to be used in web apps UI based on the passed config object.
Arguments:
NAME | TYPE | DEFAULT | REQUIRED | DESCRIPTION |
---|---|---|---|---|
supportedLangs | Array of Strings | YES | Retrieve only the supported languages for your web app. | |
strict | Boolean | false | NO | Retrieve only the supported languages with strict codes only |
Examples:
var languagesArr = LangList.getList({ supportedLangs: ['ar', 'en', 'fr', 'es'] });
/*
languagesArr will be:
[
{
"code": "ar",
"int": "Arabic",
"native": "العربية",
},
{
"code": "en",
"int": "English",
"native": "English",
},
{
"code": "fr",
"int": "French",
"native": "Français",
},
{
"code": "es",
"int": "Spanish",
"native": "Español",
}
]
*/
// calling `getList` with strict = true.
var strictLanguagesArr = LangList.getList({ supportedLangs: ['ar_AR', 'en_US', 'fr_CA', 'es_ES'], strict: true );
/*
languagesArr will be:
[
{
"code": "ar_AR",
"int": "Arabic",
"native": "العربية"
},
{
"code": "en_US",
"int": "English (US)",
"native": "English (US)"
},
{
"code": "fr_CA",
"int": "French (Canada)",
"native": "Français (Canada)"
},
{
"code": "es_ES",
"int": "Spanish (Spain)",
"native": "Español (España)"
},
}
]
*/
With Handlebars Example:
<ul class="dropdown-menu">
{{#each languagesArr}}
<li><a href="?lang={{code}}">{{native}}</a>
{{/each}}
</ul>
Copyright 2016, Yahoo Inc.
Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
FAQs
Node.js lib helps to retrieve a list of supported languages to be used in web apps UI.
The npm package lang-list receives a total of 228 weekly downloads. As such, lang-list popularity was classified as not popular.
We found that lang-list demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.