8.17.116 • Published 10 months ago

@diotoborg/itaque-incidunt-optio v8.17.116

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Build Status npm version Maintainability Test Coverage

i18n-iso-languages

i18n for ISO 639 language codes. We support Alpha-2, Alpha-3 B and T codes from https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes

This packages is heavily based on i18n-iso-countries.

We intent to keep the interface of i18n-iso-languages as close as possible to i18n-iso-countries.

Installing

Install it using npm: npm install @diotoborg/itaque-incidunt-optio

If used in a browser environment, you will need to manually install the local you wish to support.

var languages = require("@diotoborg/itaque-incidunt-optio");

// Support german & english languages.
languages.registerLocale(require("@diotoborg/itaque-incidunt-optio/langs/en.json"));
languages.registerLocale(require("@diotoborg/itaque-incidunt-optio/langs/de.json"));

Code to Language

Get the name of a language by it's ISO 639-1 (Alpha-2), ISO 639-2/T or B (Alpha-3) code

var languages = require("@diotoborg/itaque-incidunt-optio");
console.log("de (639-1/Alpha-2) => " + languages.getName("de", "en")); // German
console.log("en (639-1/Alpha-2) => " + languages.getName("de", "de")); // Deutsch
console.log("de (639-2T/Alpha-3) => " + languages.getName("deu", "en")); // German
console.log("de (639-2B/Alpha-3) => " + languages.getName("ger", "en")); // German

Get all names by their ISO 639-1 code

var languages = require("@diotoborg/itaque-incidunt-optio");
console.log(languages.getNames("en")); // { 'ab': 'Abkhazian', 'aa': 'Afar', [...], 'za': 'Zhuang', 'zu': 'Zulu' }

Supported languages (ISO 639-1)

List of ISO 639-1 codes

Language to Code

var languages = require("@diotoborg/itaque-incidunt-optio");
console.log("German => " + languages.getAlpha2Code('German', 'en'));
// German => de

console.log("German => " + languages.getAlpha3TCode('German', 'en'));
// German => deu

console.log("German => " + languages.getAlpha3BCode('German', 'en'));
// German => ger

Codes

Convert ISO 639-2 (Alpha-3) to ISO 639-1 (Alpha-2) code

var languages = require("@diotoborg/itaque-incidunt-optio");
console.log("deu (Alpha-3) => " + languages.alpha3ToAlpha2("deu") + " (Alpha-2)");
// deu (Alpha-3 T) => de (Alpha-2)

var languages = require("@diotoborg/itaque-incidunt-optio");
console.log("ger (Alpha-3 B) => " + languages.alpha3ToAlpha2("ger") + " (Alpha-2)");
// ger (Alpha-3 B) => de (Alpha-2)

Convert ISO 639-1 (Alpha-2) to ISO 639-2 (Alpha-3) code

var languages = require("@diotoborg/itaque-incidunt-optio");
console.log("de (Alpha-2) => " + languages.alpha2ToAlpha3T("de") + " (Alpha-3 T)");
// de (Alpha-2) => deu (Alpha-3 T)

var languages = require("@diotoborg/itaque-incidunt-optio");
console.log("de (Alpha-2) => " + languages.alpha2ToAlpha3B("de") + " (Alpha-3 B)");
// de (Alpha-2) => ger (Alpha-3 B)

Get all ISO 639-1 (Alpha-2) codes

var languages = require("@diotoborg/itaque-incidunt-optio");
console.log(languages.getAlpha2Codes());
// { 'aa': 'aar', 'ab': 'abk', [...], 'za': 'zha', 'zu': 'zul' }

Get all ISO 639-2 (Alpha-3) codes

var languages = require("@diotoborg/itaque-incidunt-optio");
console.log(languages.getAlpha3TCodes());
// { 'aar': 'aa', 'abk': 'ab', [...], 'zha': 'za', 'zul': 'zu' }

var languages = require("@diotoborg/itaque-incidunt-optio");
console.log(languages.getAlpha3BCodes());
// { 'aar': 'aa', 'abk': 'ab', [...], 'zha': 'za', 'zul': 'zu' }

Validate language code

var languages = require("@diotoborg/itaque-incidunt-optio");
console.log(languages.isValid("de"), languages.isValid("ger"), languages.isValid("xx")));
// true, true, false

Contribution

To add a language:

  • add a json file under langs/ (in alphabetical order)
  • add the language to the data object in enty-node.js at the top (in alphabetical order)
  • add language to section Supported languages in README.md (in alphabetical order)
  • add language to keywords in package.json (in alphabetical order)
  • add language to the "unreleased" section of the changelog
  • run npm install && make test to make sure that tests are passing
  • open a PR on GitHub

Please do not change the version in package.json, package-lock.json or changelog.md.

protocol-bufferspropUint16Arraydeep3dnamees2015accessibilityObject.entrieslook-updom-testing-librarybinariesshebangdateconcattoSortedsideparsingtouchtelephone0parentyamlworkflowredacts3mimetypeses-shimseslint-pluginflatisConcatSpreadablestyleguideconcurrencyargseast-asian-widthebsECMAScript 2017speedchildRxdependenciesownstyleinferencefull-widthlengthdomES3xdgstatelesssimpledbspinnerimportwgetWebSocketsemitextendutilitiesponyfillamazonbundlerES7libphonenumberqsmruES2023busyform-validationes8pathUint8ArrayArray.prototype.filterenumerabletoolkittrimEndwrapCSSStyleDeclarationcreateObject.keyscolourmergebrowserlistlaunchchineseshimweaksetupregular expressionarttsjestquotebyteOffsetpersistentspringfixed-widthmobilexmlreact posewidthmonorepoawait256streams2cmdtypeerrorURLtrimRightruntimedeletejssnsMapdayjssymlinkpruneindicatorsyntaxcode pointsidentifiersmimeglaciertypescriptPromisescheme-validationreact-hook-formes-shim APIstringifierweakmapJSON-SchemajQueryenvironmentskeysvarscallboundkeyfindfsTypeScripttransformObservablenpmES2016globalstestersqsserializemkdirpprocesstypesafehasOwnPropertyi18nbddastStreamrequireArrayBuffermatchAlltapeidletypedarrayformses5airbnbstylingfile systemreducerstylesstringpostcss-pluginexecuteasciiposeObject.getPrototypeOfECMAScript 2019commandchromiumvalidate_.extendec2foldereslintpluginUint32ArraygroupWeakSettaskextensionvpcStreamsbufferES2019fromroute53elbautoscalingtyped arrayiteratemodulesmkdirseslintconfigansirequestprivate datatestRFC-6455graphql-clientassigntypanionquerystringsubprocessiersscryptorobustcall-boundArray.prototype.findLastIndexurlssuperstructlazyArray.prototype.includescallbindReactiveExtensionsstoragegatewayTypeBoxapolloconsoleincludeskarmacensores7Object.fromEntrieshashfeedschemeflattenes-abstractbyteLengthtake__proto__Int16Arrayobjectstreamspropertiesdescriptorsharedesgetintrinsicisshellnegative zeroStyleSheetremovephonestdlibmake dirUnderscorerfc4122has-ownloadbalancingWeakMapdragroutinginbinaryArray.prototype.flatMapratelimitutil.inspectjsxinternal slotemojicloudformationgetterpackage managerprotoexecutablecachepropertyquerysliceinspectpyyamllanguageObservablesspinnerssesfast-deep-clonecjkexeFloat64Arraycommandercircularfullwidthtypeofregexpparserarraysoffsetfast-deep-copyflagstermhelperminimalUint8ClampedArrayYAMLes2017ECMAScript 2018ES2018cloudfrontfilterfastclonecharacterFunction.prototype.namecollectioncolumnpromisemakeexecfunctionspushenderdynamodbreal-timeasserttrimStartcloudsearchdatastructureargumentsserializerunicodehasOwnconcatMapdependency managerInt8Arrayasync
8.17.116

10 months ago

8.17.115

10 months ago

8.17.106

10 months ago

8.17.105

10 months ago

8.17.108

10 months ago

8.17.107

10 months ago

8.17.102

10 months ago

8.17.101

10 months ago

8.17.104

10 months ago

6.9.59

12 months ago

8.17.103

10 months ago

6.9.58

12 months ago

3.5.19

1 year ago

8.17.109

10 months ago

6.9.57

12 months ago

5.8.38

1 year ago

6.9.56

1 year ago

5.8.39

1 year ago

8.17.111

10 months ago

6.9.55

1 year ago

8.17.110

10 months ago

6.9.54

1 year ago

6.9.53

1 year ago

6.9.52

1 year ago

6.9.51

1 year ago

6.9.50

1 year ago

8.17.79

11 months ago

8.17.78

11 months ago

8.17.77

11 months ago

3.5.20

1 year ago

8.17.76

11 months ago

8.17.75

11 months ago

4.6.30

1 year ago

7.10.61

12 months ago

4.6.31

1 year ago

7.10.60

12 months ago

8.17.74

11 months ago

8.17.73

11 months ago

8.17.100

10 months ago

4.7.31

1 year ago

7.9.59

12 months ago

4.7.32

1 year ago

4.7.33

1 year ago

8.16.70

11 months ago

8.16.71

11 months ago

8.16.72

11 months ago

2.4.16

1 year ago

8.16.73

11 months ago

8.17.113

10 months ago

7.9.60

12 months ago

8.17.112

10 months ago

5.9.50

1 year ago

8.17.114

10 months ago

7.15.69

12 months ago

7.15.68

12 months ago

7.15.67

12 months ago

7.15.66

12 months ago

7.15.65

12 months ago

7.12.61

12 months ago

7.12.62

12 months ago

7.12.63

12 months ago

5.7.38

1 year ago

5.7.37

1 year ago

5.7.34

1 year ago

5.7.33

1 year ago

5.7.36

1 year ago

5.7.35

1 year ago

7.11.61

12 months ago

5.9.49

1 year ago

3.4.16

1 year ago

3.4.17

1 year ago

3.4.18

1 year ago

3.4.19

1 year ago

2.3.8

1 year ago

7.13.65

12 months ago

2.3.9

1 year ago

7.13.64

12 months ago

7.13.63

12 months ago

4.5.21

1 year ago

4.5.22

1 year ago

4.5.20

1 year ago

4.5.25

1 year ago

4.5.26

1 year ago

4.5.23

1 year ago

4.5.24

1 year ago

8.17.89

11 months ago

8.17.88

11 months ago

8.17.87

11 months ago

8.17.86

11 months ago

7.14.65

12 months ago

8.15.69

11 months ago

4.6.26

1 year ago

4.6.27

1 year ago

8.17.85

11 months ago

8.17.84

11 months ago

8.17.83

11 months ago

4.6.28

1 year ago

8.17.82

11 months ago

4.6.29

1 year ago

8.17.81

11 months ago

8.17.80

11 months ago

5.8.41

1 year ago

5.8.42

1 year ago

5.8.43

1 year ago

5.8.44

1 year ago

8.17.99

10 months ago

8.17.98

10 months ago

8.17.97

10 months ago

5.8.40

1 year ago

2.3.16

1 year ago

2.3.13

1 year ago

8.15.70

11 months ago

2.3.12

1 year ago

2.3.15

1 year ago

2.3.14

1 year ago

8.17.96

11 months ago

5.8.49

1 year ago

8.17.95

11 months ago

8.17.94

11 months ago

2.3.11

1 year ago

8.17.93

11 months ago

2.3.10

1 year ago

8.17.92

11 months ago

5.8.45

1 year ago

8.17.91

11 months ago

5.8.46

1 year ago

8.17.90

11 months ago

5.8.47

1 year ago

5.8.48

1 year ago

2.3.7

1 year ago

1.3.7

1 year ago

1.2.7

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago