Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
@phensley/language-tag
Advanced tools
Changelog
[1.8.0]
LocaleResolver
class to split a merged declaration with the Locale
interface.Readme
Implements BCP 47 language tag parsing and construction.
NPM:
npm install --save @phensley/language-tag
Yarn:
yarn add @phensley/language-tag
const IDS = ['en', 'es', 'es-419', 'und-AR', 'und-Hant', 'iw', 'i-klingon'];
for (const id of IDS) {
const tag = parseLanguageTag(id);
console.log(`${tag.compact().padStart(10)} ${tag.expanded()}`);
}
en en-Zzzz-ZZ
es es-Zzzz-ZZ
es-419 es-Zzzz-419
und-AR und-Zzzz-AR
und-Hant und-Hant-ZZ
iw iw-Zzzz-ZZ
tlh tlh-Zzzz-ZZ
const t = new LanguageTag(undefined, 'latn', 'us', 'PoSiX', {
u: ['ca-gregory']
});
console.log(t.expanded());
und-Latn-US-posix-u-ca-gregory
FAQs
Parsing and construction of BCP 47 language tags
The npm package @phensley/language-tag receives a total of 1,810 weekly downloads. As such, @phensley/language-tag popularity was classified as popular.
We found that @phensley/language-tag demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.