diff options
author | StefanVukovic99 <stefanvukovic44@gmail.com> | 2024-06-27 18:08:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-27 16:08:42 +0000 |
commit | 603c2c7e1b50d8b06c06848c3e83d241da9437e6 (patch) | |
tree | 2e04bdb57475c630170315678d789751bfeb6444 /ext/js/language | |
parent | 4e3f23e942252dacb31780de30f0233eccf1d9f8 (diff) |
add lingua libre audio source (#1129)
* add lingua libre audio source
* mvp
* run file requests in parallel
* remove redundant language var
* redundant api function
---------
Co-authored-by: Cashew <52880648+cashewnuttynuts@users.noreply.github.com>
Diffstat (limited to 'ext/js/language')
-rw-r--r-- | ext/js/language/language-descriptors.js | 31 | ||||
-rwxr-xr-x | ext/js/language/languages.js | 4 |
2 files changed, 33 insertions, 2 deletions
diff --git a/ext/js/language/language-descriptors.js b/ext/js/language/language-descriptors.js index f9fb4f09..2e8ece55 100644 --- a/ext/js/language/language-descriptors.js +++ b/ext/js/language/language-descriptors.js @@ -50,6 +50,7 @@ const capitalizationPreprocessors = { const languageDescriptors = [ { iso: 'ar', + iso639_3: 'ara', name: 'Arabic', exampleText: 'قَرَأَ', textPreprocessors: { @@ -58,6 +59,7 @@ const languageDescriptors = [ }, { iso: 'de', + iso639_3: 'deu', name: 'German', exampleText: 'gelesen', textPreprocessors: { @@ -68,12 +70,14 @@ const languageDescriptors = [ }, { iso: 'el', + iso639_3: 'ell', name: 'Greek', exampleText: 'διαβάζω', textPreprocessors: capitalizationPreprocessors, }, { iso: 'en', + iso639_3: 'eng', name: 'English', exampleText: 'read', textPreprocessors: capitalizationPreprocessors, @@ -81,6 +85,7 @@ const languageDescriptors = [ }, { iso: 'es', + iso639_3: 'spa', name: 'Spanish', exampleText: 'leer', textPreprocessors: capitalizationPreprocessors, @@ -88,6 +93,7 @@ const languageDescriptors = [ }, { iso: 'fa', + iso639_3: 'fas', name: 'Persian', exampleText: 'خواندن', textPreprocessors: { @@ -96,18 +102,21 @@ const languageDescriptors = [ }, { iso: 'fi', + iso639_3: 'fin', name: 'Finnish', exampleText: 'lukea', textPreprocessors: capitalizationPreprocessors, }, { iso: 'fr', + iso639_3: 'fra', name: 'French', exampleText: 'lire', textPreprocessors: capitalizationPreprocessors, }, { iso: 'grc', + iso639_3: 'grc', name: 'Ancient Greek', exampleText: 'γράφω', textPreprocessors: { @@ -117,24 +126,28 @@ const languageDescriptors = [ }, { iso: 'hu', + iso639_3: 'hun', name: 'Hungarian', exampleText: 'olvasni', textPreprocessors: capitalizationPreprocessors, }, { iso: 'id', + iso639_3: 'ind', name: 'Indonesian', exampleText: 'membaca', textPreprocessors: capitalizationPreprocessors, }, { iso: 'it', + iso639_3: 'ita', name: 'Italian', exampleText: 'leggere', textPreprocessors: capitalizationPreprocessors, }, { iso: 'la', + iso639_3: 'lat', name: 'Latin', exampleText: 'legere', textPreprocessors: { @@ -145,11 +158,13 @@ const languageDescriptors = [ }, { iso: 'lo', + iso639_3: 'lao', name: 'Lao', exampleText: 'ອ່ານ', }, { iso: 'ja', + iso639_3: 'jpn', name: 'Japanese', exampleText: '読め', isTextLookupWorthy: isStringPartiallyJapanese, @@ -165,11 +180,13 @@ const languageDescriptors = [ }, { iso: 'km', + iso639_3: 'khm', name: 'Khmer', exampleText: 'អាន', }, { iso: 'ko', + iso639_3: 'kor', name: 'Korean', exampleText: '읽어', textPreprocessors: { @@ -182,24 +199,28 @@ const languageDescriptors = [ }, { iso: 'nl', + iso639_3: 'nld', name: 'Dutch', exampleText: 'lezen', textPreprocessors: capitalizationPreprocessors, }, { iso: 'pl', + iso639_3: 'pol', name: 'Polish', exampleText: 'czytacie', textPreprocessors: capitalizationPreprocessors, }, { iso: 'pt', + iso639_3: 'por', name: 'Portuguese', exampleText: 'ler', textPreprocessors: capitalizationPreprocessors, }, { iso: 'ro', + iso639_3: 'ron', name: 'Romanian', exampleText: 'citit', textPreprocessors: { @@ -209,6 +230,7 @@ const languageDescriptors = [ }, { iso: 'ru', + iso639_3: 'rus', name: 'Russian', exampleText: 'читать', textPreprocessors: { @@ -219,6 +241,7 @@ const languageDescriptors = [ }, { iso: 'sga', + iso639_3: 'sga', name: 'Old Irish', exampleText: 'légaid', textPreprocessors: { @@ -229,6 +252,7 @@ const languageDescriptors = [ }, { iso: 'sh', + iso639_3: 'hbs', name: 'Serbo-Croatian', exampleText: 'čitaše', textPreprocessors: { @@ -238,6 +262,7 @@ const languageDescriptors = [ }, { iso: 'sq', + iso639_3: 'sqi', name: 'Albanian', exampleText: 'ndihmojme', textPreprocessors: capitalizationPreprocessors, @@ -245,23 +270,27 @@ const languageDescriptors = [ }, { iso: 'sv', + iso639_3: 'swe', name: 'Swedish', exampleText: 'läsa', textPreprocessors: capitalizationPreprocessors, }, { iso: 'th', + iso639_3: 'tha', name: 'Thai', exampleText: 'อ่าน', }, { iso: 'tr', + iso639_3: 'tur', name: 'Turkish', exampleText: 'okuyor', textPreprocessors: capitalizationPreprocessors, }, { iso: 'vi', + iso639_3: 'vie', name: 'Vietnamese', exampleText: 'đọc', textPreprocessors: { @@ -271,11 +300,13 @@ const languageDescriptors = [ }, { iso: 'yue', + iso639_3: 'yue', name: 'Cantonese', exampleText: '讀', }, { iso: 'zh', + iso639_3: 'zho', name: 'Chinese', exampleText: '读', isTextLookupWorthy: isStringPartiallyChinese, diff --git a/ext/js/language/languages.js b/ext/js/language/languages.js index 7759fda5..96f7a080 100755 --- a/ext/js/language/languages.js +++ b/ext/js/language/languages.js @@ -22,8 +22,8 @@ import {languageDescriptorMap} from './language-descriptors.js'; */ export function getLanguageSummaries() { const results = []; - for (const {name, iso, exampleText} of languageDescriptorMap.values()) { - results.push({name, iso, exampleText}); + for (const {name, iso, iso639_3, exampleText} of languageDescriptorMap.values()) { + results.push({name, iso, iso639_3, exampleText}); } return results; } |