Skip to content

This repository contains ISO-639-1 and ISO-639-3 Language Code dictionaries.

License

Notifications You must be signed in to change notification settings

theRealProHacker/iso-codes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iso-codes

This repository contains ISO-639-1 and ISO-639-3 Language Code dictionaries.

Usage

A short python code example to use this dictionary. To do this you have to put the iso-639-1/iso_simp.min.json file into your filesystem with the python script

  #python
  import json #the advantage is that you have no new dependencies
  def get_language_as_iso_code():
    #some function that returns an ISO-639-1-Code
    return "en"
  with open("iso_simp.min.json","r") as file:
    iso_codes=json.load(file)
  myISOCode=get_language_as_iso_code()
  print(iso_codes[myISOCode]) #-> "english"

Another example in JavaScript

  //javaScript
  function get_language_as_iso_code(){
    return "en"
  }
  let iso_codes=require("iso_simp.min.json")
  let myISOCode=get_language_as_iso()
  console.log(iso_codes[myISOCode])

About

This repository contains ISO-639-1 and ISO-639-3 Language Code dictionaries.

Topics

Resources

License

Stars

Watchers

Forks