Add the Ol Chiki script (Olck), add getLanguages(), and fix the tests

The tests were using languageData.languages, which was undefined.
This patch adds a method to get all the languages to be able to test.
This commit is contained in:
Amir Aharoni
2018-08-12 19:33:28 +03:00
committed by Niklas Laxström
parent d6912d6c94
commit 87b3fd8666
6 changed files with 25 additions and 14 deletions

View File

@@ -24,6 +24,14 @@ function isRedirect( language ) {
return ( isKnown( language ) && languageData.languages[ language ].length === 1 ) ? languageData.languages[ language ][ 0 ] : false;
}
/**
* Get all the languages
* @return {Object}
*/
function getLanguages() {
return languageData.languages;
}
/**
* Returns the script of the language.
* @param {string} language Language code
@@ -278,6 +286,7 @@ module.exports = {
getAutonyms,
getDir,
getGroupOfScript,
getLanguages,
getLanguagesByScriptGroup,
getLanguagesByScriptGroupInRegion,
getLanguagesByScriptGroupInRegions,