![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
The iso-639-1 npm package provides utilities for working with ISO 639-1 language codes. It allows you to get language names from codes, get codes from language names, and check if a language code is valid.
Get Language Name from Code
This feature allows you to get the name of a language given its ISO 639-1 code. In the example, the code 'en' returns 'English'.
const ISO6391 = require('iso-639-1');
const languageName = ISO6391.getName('en');
console.log(languageName); // Output: English
Get Language Code from Name
This feature allows you to get the ISO 639-1 code of a language given its name. In the example, the name 'English' returns the code 'en'.
const ISO6391 = require('iso-639-1');
const languageCode = ISO6391.getCode('English');
console.log(languageCode); // Output: en
Check if a Language Code is Valid
This feature allows you to check if a given ISO 639-1 code is valid. In the example, the code 'en' is validated and returns true.
const ISO6391 = require('iso-639-1');
const isValid = ISO6391.validate('en');
console.log(isValid); // Output: true
Get All Language Codes
This feature allows you to get an array of all ISO 639-1 language codes. The example returns an array containing all the codes.
const ISO6391 = require('iso-639-1');
const allCodes = ISO6391.getAllCodes();
console.log(allCodes); // Output: Array of all ISO 639-1 language codes
Get All Language Names
This feature allows you to get an array of all ISO 639-1 language names. The example returns an array containing all the names.
const ISO6391 = require('iso-639-1');
const allNames = ISO6391.getAllNames();
console.log(allNames); // Output: Array of all ISO 639-1 language names
The iso-639 package provides similar functionality for working with ISO 639 language codes, including both ISO 639-1 and ISO 639-2. It offers methods to get language names, codes, and validate codes. Compared to iso-639-1, it supports a broader range of language codes.
The language-codes package provides a comprehensive list of language codes and their corresponding names, including ISO 639-1, ISO 639-2, and ISO 639-3. It offers more extensive data and supports multiple standards, making it more versatile than iso-639-1.
The langs package provides utilities for working with language codes, including ISO 639-1, ISO 639-2, and ISO 639-3. It offers methods to get language names, codes, and validate codes. It is more comprehensive than iso-639-1, supporting multiple ISO standards.
Simple interface for ISO-639-1 language codes
npm install iso-639-1
const ISO6391 = require('iso-639-1');
console.log(ISO6391.getName('en')); // 'English'
import ISO6391 from 'iso-639-1';
console.log(ISO6391.getName('en')); // 'English'
HTML
<script type="text/javascript" src="./node_modules/iso-639-1/build/index.js"></script>
Visit global variable ISO6391 in js
console.log(ISO6391.getName('en')); // 'English'
Lookup language english name by code
Get array of all language english names
Lookup language native name by code
Get array of all language native names
Lookup code by english name or native name
Get array of all codes
Check whether the given code is in the list of ISO-639-1
Get the array of the language objects by the given codes
const ISO6391 = require('iso-639-1')
console.log(ISO6391.getName('zh')) // 'Chinese'
console.log(ISO6391.getNativeName('zh')) // '中文'
console.log(ISO6391.getAllNames()) // ['Afar','Abkhaz', ... ,'Zulu']
console.log(ISO6391.getAllNativeNames()) //['Afaraf','аҧсуа бызшәа', ... ,'isiZulu' ]
console.log(ISO6391.getCode('Chinese')) // 'zh'
console.log(ISO6391.getCode('中文')) // 'zh'
console.log(ISO6391.getAllCodes()) //['aa','ab',...,'zu']
console.log(ISO6391.validate('en')) // true
console.log(ISO6391.validate('xx')) // false
console.log(ISO6391.getLanguages(['en', 'zh']))
// [{code:'en',name:'English',nativeName:'English'},{code:'zh',name:'Chinese',nativeName:'中文'}]
FAQs
ISO-639-1 codes
The npm package iso-639-1 receives a total of 3,244 weekly downloads. As such, iso-639-1 popularity was classified as popular.
We found that iso-639-1 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.