<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <base data-ice="baseUrl" href="../../">
  <title data-ice="title">src/index.js | 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"><h1 data-ice="title">src/index.js</h1>
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">var packagedJson = JSON.parse(require(&apos;lzstring!./packagedJson.json&apos;));
var supportedLangs = require(&apos;json!./supportedLangs.json&apos;);

/**
	 * Returns the list of supported languages
	 * @return {Array} The list of all the supported languages
	 */
var getSupportedLangs = function(){
  return supportedLangs;
};

/**
   * Returns the ISO 3166-1 list of countries translated in the language passed as a parameter
   * @param  {String} lang The desired language for the translation
   * @return {Array}      The countries list
   */
var getCountries = function(lang){
  return packagedJson.countries[lang];
};

  /**
   * Returns the translation for the country code passed as a parameter in the language passed as a parameter
   * @param  {String} lang        The languages desired for the translation
   * @param  {String} countryCode The country code for which to return the country name
   * @return {String}             The translated country name
   */
var  getCountry = function(lang, countryCode){
  return packagedJson.countries[lang][countryCode];
};
  
/**
   * Returns the ISO 639-1 list of languages translated in the language passed as a parameter
   * @param  {String} lang The desired language for the translation
   * @return {Array}      The language list
   */
var getLanguages = function(lang){
  return packagedJson.languages[lang];
};
 
/**
   * Returns the translation for the language code passed as a parameter in the language passed as a parameter
   * @param  {String} lang        The languages desired for the translation
   * @param  {String} langCode The language code for which to return the cuntry name
   * @return {String}             The translated country name
*/
var getLanguage = function(lang, langCode){
  return packagedJson.languages[lang][langCode];
};

module.exports = {
	
  getSupportedLangs: getSupportedLangs,

  getCountries: getCountries,

  getCountry: getCountry,
 
  getLanguages: getLanguages,

  getLanguage: getLanguage

};</code></pre>

</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>