Skip to content

🔤 Maps the languages currently supported by the Mirage Translator API endpoint.

License

Notifications You must be signed in to change notification settings

mirage-ai-com/mirage-translate-languages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mirage Translate Languages

Build Status NPM Downloads

🔤 Maps the languages currently supported by the Mirage Translate API endpoint. The data auto-updates every 3 days, if needed.

Copyright 2023 Crisp IM SAS. See LICENSE for copying information.

😘 Maintainer: @eliottvincent

Usage

const { isLanguageSupported } = require("mirage-translate-languages");

console.log(isLanguageSupported("en"));
// true

API

Access to supported languages

The raw set of supported languages, as returned by the Mirage Translate API, is made accessible:

const { languages } = require("mirage-translate-languages");

console.log(languages);
// {af: {…}, am: {…}, ar: {…}, as: {…}, az: {…}, …}

// OR
const mirageTranslate = require("mirage-translate-languages");

console.log(mirageTranslate.dataLanguages);
// {af: {…}, am: {…}, ar: {…}, as: {…}, az: {…}, …}

Check if a language is supported

isLanguageSupported(code) returns whether a language is supported or not:

  • code must be a BCP 47 language tag, as per ISO 3166-1
const { isLanguageSupported } = require("mirage-translate-languages");

console.log(isLanguageSupported("en"));
// true