<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <base data-ice="baseUrl"> <title data-ice="title">API Document</title> <link type="text/css" rel="stylesheet" href="css/style.css"> <link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css"> <script src="script/prettify/prettify.js"></script> <script src="script/manual.js"></script> </head> <body class="layout-container" data-ice="rootContainer"> <header> <a href="./">Home</a> <a href="identifiers.html">Reference</a> <a href="source.html">Source</a> <a data-ice="repoURL" href="https://bitbucket.org/pinturic/iso-countries-languages">Repository</a> <div class="search-box"> <span> <img src="./image/search.png"> <span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span> </span> <ul class="search-result"></ul> </div> </header> <nav class="navigation" data-ice="nav"><div> <ul> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getCountries">getCountries</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getCountry">getCountry</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getLanguage">getLanguage</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getLanguages">getLanguages</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getSupportedLangs">getSupportedLangs</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-packagedJson">packagedJson</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-supportedLangs">supportedLangs</a></span></span></li> </ul> </div> </nav> <div class="content" data-ice="content"><div data-ice="index" class="github-markdown"><p><a href="https://www.bithound.io/bitbucket/pinturic/iso-countries-languages"><img src="https://www.bithound.io/bitbucket/pinturic/iso-countries-languages/badges/score.svg" alt="bitHound Overall Score"></a> <a href="https://www.bithound.io/bitbucket/pinturic/crema/d2f4223edec3a203961fbd7b4f528e5bf15b2921/dependencies/npm"><img src="https://www.bithound.io/bitbucket/pinturic/iso-countries-languages/badges/dependencies.svg" alt="bitHound Dependencies"></a> <a href="https://www.bithound.io/bitbucket/pinturic/crema/d2f4223edec3a203961fbd7b4f528e5bf15b2921/dependencies/npm"><img src="https://www.bithound.io/bitbucket/pinturic/iso-countries-languages/badges/devDependencies.svg" alt="bitHound Dev Dependencies"></a> <a href="https://www.bithound.io/bitbucket/pinturic/iso-countries-languages"><img src="https://www.bithound.io/bitbucket/pinturic/iso-countries-languages/badges/code.svg" alt="bitHound Code"></a> <img src="./esdoc/badge.svg" alt=" Code documentation "></p> <h1 id="iso-countries-languages">iso-countries-languages</h1> <p>This library provides the full list of <a href="https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes">ISO 639-1 languages</a> and the full list of <a href="https://en.wikipedia.org/wiki/ISO_3166-1">ISO 3166-1 countries</a>. The library supports 89 languages (the full list is available by querying the library API itself) and it is designed to be easy to import and use.</p> <h1 id="code-documentation">Code documentation</h1> <p><a href="./esdoc/index.html"> Code documentation </a></p> <h2 id="api-list">API list</h2> <h3 id="getsupportedlangs">getSupportedLangs</h3> <p>Returns the list of supported languages.</p> <pre><code><code class="source-code prettyprint">var isoCountriesLanguages = require('../lib/iso-countries-languages.js'); var supportedLangs = isoCountriesLanguages.getSupportedLangs(); console.log("Supported languages: "); console.log(supportedLangs);</code> </code></pre><h4 id="output">Output</h4> <pre><code><code class="source-code prettyprint">Supported languages: [ 'af', 'am', 'ar', 'az', 'ba', ... 'udm', 'uk', 'ur', 'uz', 'vi', 'xh', 'yi', 'zh' ]</code> </code></pre><h3 id="getcountries">getCountries</h3> <p>Returns the ISO 3166-1 list of countries translated in the language passed as a parameter.</p> <pre><code><code class="source-code prettyprint">var isoCountriesLanguages = require('../lib/iso-countries-languages.js'); var countriesInFrench = isoCountriesLanguages.getCountries('fr'); console.log("Countries in french: "); console.log(countriesInFrench);</code> </code></pre><h4 id="output">Output</h4> <pre><code><code class="source-code prettyprint">Countries in french: { AF: 'Afghanistan', AX: 'Les Îles D\'Åland', AL: 'L\'albanie', DZ: 'L\'algérie', AS: 'Samoa Américaines', AD: 'Andorre', ... WF: 'Wallis-et-Futuna', EH: 'Sahara Occidental', YE: 'Yémen', ZM: 'La zambie', ZW: 'Zimbabwe' }</code> </code></pre><h3 id="getcountry">getCountry</h3> <p>Returns the translation for the country code passed as a parameter in the language passed as a parameter.</p> <pre><code><code class="source-code prettyprint">var isoCountriesLanguages = require('../lib/iso-countries-languages.js'); var italyInFrench = isoCountriesLanguages.getCountry('fr', 'IT'); console.log("Italy in french: "); console.log(italyInFrench);</code> </code></pre><h4 id="output">Output</h4> <pre><code><code class="source-code prettyprint">Italy in french: Italie</code> </code></pre><h3 id="getlanguages">getLanguages</h3> <p>Returns the ISO 639-1 list of languages translated in the language passed as a parameter</p> <pre><code><code class="source-code prettyprint">var isoCountriesLanguages = require('../lib/iso-countries-languages.js'); var languagesInItalian = isoCountriesLanguages.getLanguages('it'); console.log("Languages in italian: "); console.log(languagesInItalian);</code> </code></pre><h4 id="output">Output</h4> <pre><code><code class="source-code prettyprint">Languages in italian: { ab: 'Di abcasia', aa: 'Lontano', af: 'Afrikaans', ak: 'Akan', sq: 'Albanese', am: 'Amarico', ar: 'Arabo', ... xh: 'Xhosa', yi: 'Yiddish', yo: 'Yoruba', za: 'Zhuang, Chuang', zu: 'Zulu' }</code> </code></pre><h3 id="getlanguage">getLanguage</h3> <p>Returns the translation for the language code passed as a parameter in the language passed as a parameter</p> <pre><code><code class="source-code prettyprint">var isoCountriesLanguages = require('../lib/iso-countries-languages.js'); var spanishInItalian = isoCountriesLanguages.getLanguage('it', 'es'); console.log("Spanish in italian: "); console.log(spanishInItalian);</code> </code></pre><h4 id="output">Output</h4> <pre><code><code class="source-code prettyprint">Spanish in italian: Spagnolo</code> </code></pre></div> </div> <footer class="footer"> Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(0.4.8)</span></a> </footer> <script src="script/search_index.js"></script> <script src="script/search.js"></script> <script src="script/pretty-print.js"></script> <script src="script/inherited-summary.js"></script> <script src="script/test-summary.js"></script> <script src="script/inner-link.js"></script> <script src="script/patch-for-local.js"></script> </body> </html>