From 182a0aa5cf3d6dab7cbe1cbc9f4220692259ed51 Mon Sep 17 00:00:00 2001 From: dessant Date: Wed, 29 Jan 2020 20:00:25 +0200 Subject: [PATCH] fix: update available languages and API endpoints --- src/_locales/en/messages.json | 178 +++++++++++----------------------- src/options/App.vue | 11 +++ src/utils/config.js | 29 +----- src/utils/data.js | 106 ++++++++++++-------- 4 files changed, 136 insertions(+), 188 deletions(-) diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 6c86354..69792e4 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -49,6 +49,11 @@ "description": "Title of the option." }, + "optionValue_ibmSpeechApiLoc_london": { + "message": "London", + "description": "Value of the option." + }, + "optionValue_ibmSpeechApiLoc_frankfurt": { "message": "Frankfurt", "description": "Value of the option." @@ -79,6 +84,56 @@ "description": "Title of the option." }, + "optionValue_microsoftSpeechApiLoc_eastAu": { + "message": "Australia East", + "description": "Value of the option." + }, + + "optionValue_microsoftSpeechApiLoc_centralCa": { + "message": "Canada Central", + "description": "Value of the option." + }, + + "optionValue_microsoftSpeechApiLoc_centralUs": { + "message": "Central US", + "description": "Value of the option." + }, + + "optionValue_microsoftSpeechApiLoc_centralFr": { + "message": "France Central", + "description": "Value of the option." + }, + + "optionValue_microsoftSpeechApiLoc_centralIn": { + "message": "India Central", + "description": "Value of the option." + }, + + "optionValue_microsoftSpeechApiLoc_eastJp": { + "message": "Japan East", + "description": "Value of the option." + }, + + "optionValue_microsoftSpeechApiLoc_centralKr": { + "message": "Korea Central", + "description": "Value of the option." + }, + + "optionValue_microsoftSpeechApiLoc_northCentralUs": { + "message": "North Central US", + "description": "Value of the option." + }, + + "optionValue_microsoftSpeechApiLoc_southCentralUs": { + "message": "South Central US", + "description": "Value of the option." + }, + + "optionValue_microsoftSpeechApiLoc_southUk": { + "message": "UK South", + "description": "Value of the option." + }, + "optionValue_microsoftSpeechApiLoc_eastUs": { "message": "East US", "description": "Value of the option." @@ -149,31 +204,16 @@ "description": "Title of the option." }, - "optionValue_witSpeechApiLang_afrikaans": { - "message": "Afrikaans", - "description": "Value of the option." - }, - "optionValue_witSpeechApiLang_arabic": { "message": "Arabic", "description": "Value of the option." }, - "optionValue_witSpeechApiLang_azerbaijani": { - "message": "Azerbaijani", - "description": "Value of the option." - }, - "optionValue_witSpeechApiLang_bengali": { "message": "Bengali", "description": "Value of the option." }, - "optionValue_witSpeechApiLang_bulgarian": { - "message": "Bulgarian", - "description": "Value of the option." - }, - "optionValue_witSpeechApiLang_catalan": { "message": "Catalan", "description": "Value of the option." @@ -184,21 +224,6 @@ "description": "Value of the option." }, - "optionValue_witSpeechApiLang_croatian": { - "message": "Croatian", - "description": "Value of the option." - }, - - "optionValue_witSpeechApiLang_czech": { - "message": "Czech", - "description": "Value of the option." - }, - - "optionValue_witSpeechApiLang_danish": { - "message": "Danish", - "description": "Value of the option." - }, - "optionValue_witSpeechApiLang_dutch": { "message": "Dutch", "description": "Value of the option." @@ -209,11 +234,6 @@ "description": "Value of the option." }, - "optionValue_witSpeechApiLang_estonian": { - "message": "Estonian", - "description": "Value of the option." - }, - "optionValue_witSpeechApiLang_finnish": { "message": "Finnish", "description": "Value of the option." @@ -224,41 +244,16 @@ "description": "Value of the option." }, - "optionValue_witSpeechApiLang_georgian": { - "message": "Georgian", - "description": "Value of the option." - }, - "optionValue_witSpeechApiLang_german": { "message": "German", "description": "Value of the option." }, - "optionValue_witSpeechApiLang_greek": { - "message": "Greek", - "description": "Value of the option." - }, - - "optionValue_witSpeechApiLang_hebrew": { - "message": "Hebrew", - "description": "Value of the option." - }, - "optionValue_witSpeechApiLang_hindi": { "message": "Hindi", "description": "Value of the option." }, - "optionValue_witSpeechApiLang_hungarian": { - "message": "Hungarian", - "description": "Value of the option." - }, - - "optionValue_witSpeechApiLang_icelandic": { - "message": "Icelandic", - "description": "Value of the option." - }, - "optionValue_witSpeechApiLang_indonesian": { "message": "Indonesian", "description": "Value of the option." @@ -284,38 +279,13 @@ "description": "Value of the option." }, - "optionValue_witSpeechApiLang_laothian": { - "message": "Laothian", - "description": "Value of the option." - }, - - "optionValue_witSpeechApiLang_latvian": { - "message": "Latvian", - "description": "Value of the option." - }, - - "optionValue_witSpeechApiLang_lithuanian": { - "message": "Lithuanian", - "description": "Value of the option." - }, - "optionValue_witSpeechApiLang_malay": { "message": "Malay", "description": "Value of the option." }, - "optionValue_witSpeechApiLang_mongolian": { - "message": "Mongolian", - "description": "Value of the option." - }, - - "optionValue_witSpeechApiLang_norwegian": { - "message": "Norwegian", - "description": "Value of the option." - }, - - "optionValue_witSpeechApiLang_persian": { - "message": "Persian", + "optionValue_witSpeechApiLang_malayalam": { + "message": "Malayalam", "description": "Value of the option." }, @@ -329,28 +299,13 @@ "description": "Value of the option." }, - "optionValue_witSpeechApiLang_romanian": { - "message": "Romanian", - "description": "Value of the option." - }, - "optionValue_witSpeechApiLang_russian": { "message": "Russian", "description": "Value of the option." }, - "optionValue_witSpeechApiLang_serbian": { - "message": "Serbian", - "description": "Value of the option." - }, - - "optionValue_witSpeechApiLang_slovak": { - "message": "Slovak", - "description": "Value of the option." - }, - - "optionValue_witSpeechApiLang_slovenian": { - "message": "Slovenian", + "optionValue_witSpeechApiLang_sinhala": { + "message": "Sinhala", "description": "Value of the option." }, @@ -359,11 +314,6 @@ "description": "Value of the option." }, - "optionValue_witSpeechApiLang_swahili": { - "message": "Swahili", - "description": "Value of the option." - }, - "optionValue_witSpeechApiLang_swedish": { "message": "Swedish", "description": "Value of the option." @@ -389,11 +339,6 @@ "description": "Value of the option." }, - "optionValue_witSpeechApiLang_ukrainian": { - "message": "Ukrainian", - "description": "Value of the option." - }, - "optionValue_witSpeechApiLang_urdu": { "message": "Urdu", "description": "Value of the option." @@ -404,11 +349,6 @@ "description": "Value of the option." }, - "optionValue_witSpeechApiLang_zulu": { - "message": "Zulu", - "description": "Value of the option." - }, - "inputLabel_apiKey": { "message": "API key", "description": "Label of the input." diff --git a/src/options/App.vue b/src/options/App.vue index bcd86b7..92a4e29 100644 --- a/src/options/App.vue +++ b/src/options/App.vue @@ -223,6 +223,7 @@ export default { 'microsoftSpeechApi' ], ibmSpeechApiLoc: [ + 'london', 'frankfurt', 'dallas', 'washington', @@ -230,6 +231,16 @@ export default { 'tokyo' ], microsoftSpeechApiLoc: [ + 'eastAu', + 'centralCa', + 'centralUs', + 'centralFr', + 'centralIn', + 'eastJp', + 'centralKr', + 'northCentralUs', + 'southCentralUs', + 'southUk', 'eastUs', 'eastUs2', 'westUs', diff --git a/src/utils/config.js b/src/utils/config.js index b964a6f..e56de3b 100644 --- a/src/utils/config.js +++ b/src/utils/config.js @@ -3,58 +3,35 @@ const targetEnv = process.env.TARGET_ENV; const clientAppVersion = '0.2.0'; const witApiKeys = { - afrikaans: 'T3T7A2WS3TQJVBB4L4CTK2EEUI6N7YGZ', arabic: 'AD6RLFYBWRGGJD76SWKALZMUFVGMVCTB', - azerbaijani: 'RMSJ2FEOW4KJDYRF5LNZBIWBRZDW4ZB7', bengali: 'ACETQ4IVS5ITSUTSWBETY2QZKBJVIQAI', - bulgarian: 'PILJVNIC5Y2EBHB5LFBCFCVRMJB6YAHT', catalan: 'YBAZZV6ITGFD3C2QX7CANYQPMGUOI7RK', chinese: 'KBBALJMRKYDJJDMC4NJ32VWCBKFJFIIU', - croatian: 'WNMTNHQVRCIO7LWM3KJ7KSMELXJ7LVHI', - czech: 'LRLFTX2Q66Y6YQX2RA6SN2ULGJJ4ABHY', - danish: 'XNXWQBMCXS4CPGD5XS6J6CSIPG2NLMIO', dutch: 'T43TEUNW4HDQFNUTIA3EYTTD4A22AS4H', english: 'NVYD6ZUJMC26US5XS2ZJJ32EDZZ654TD', - estonian: 'BFR5DZRBITRYUPEUAEC5NBAYH32TZWFW', finnish: '3GOWLMYD7DUY72XTPJW6QTVZSK2QEAPT', french: 'JLNITTO2D4KMEOGQ6MTSN634ADK62VZ7', - georgian: 'MN4WRTLFDM2AESM6HXUF2KXQACTNC2CJ', german: 'LPVVXWRBFTVBOOHZAEJC3QRM6E3UMD7I', - greek: 'VRQCDIURC3D22ZTYPEJAHGZW2PG5MY5T', - hebrew: 'IFNGQOZ63NDYAXHMJTOFGDWUFXTU3XZH', hindi: 'GZY4V5WN75QHO4Q5PMCU5AIDKQZLKP4L', - hungarian: 'U22W2AWXWQHWUUGTJRJZYAMYSSPX44TR', - icelandic: 'KD3DQ2XPQJM4VBYUJPPOPHZYOUQZ55JL', indonesian: 'NBKNPYO6ZTVSSTH2AT3H5DM7OUOIAN3F', italian: 'JNSYW453QWIXNR3TOCE2K7NO5GGU3KYL', japanese: 'S3IDY5JTJVJ6XBISPGZBZQHQXO23BXEB', kannada: 'MZ7NKAQGQI3T4JH6YRIEL6K4AWDCDE3A', korean: '5UWNE4YDBZTSNWWBYC4XZEWJGBUI24YL', - laothian: 'GEM2VG7WS7NIWWYCVUKKW6T2BZDND4J2', - latvian: 'FZ7HMEZDHUTGCA77BGYHRGJ3ENK3H6HD', - lithuanian: 'ZDSKNPEMQJMVPX3AFIKGGT2CGZG3SLDW', malay: 'YW73R7QWXQT23GE5CTM4R2IVNCH2KMS3', - mongolian: '73LDBOC5T55YLADCESZUHS2CI447UMWE', - norwegian: 'TOXJSFSKC7EQAJRMYXOQMMZ5FEYT5ZCF', - persian: 'OQS2XU2VPTCHUNNOGLWAGGVNP4LIFXZI', + malayalam: 'KIZY64QLOGZ7JWJWX2DKE247KV6VHAYT', polish: 'G73FWND7N5O3ZCSBCHF6NDOV2QIXW2MF', portuguese: 'N7D57ZCGWLRSMQNHQYKWC3OHVNTZI5UT', - romanian: '4Q4AMYQP43UCUV2RJOT4TRAONA6JYSMD', russian: 'V2IMQUEC5M7TSYAY3VCKSGQ7HOCWFPFY', - serbian: 'ZQEVSPDJ7TV4GJSTO3EV4JOFQGF2AJYI', - slovak: 'SCXIEULQSWCFQNBCOF7ERG6EHRKYV4SL', - slovenian: 'UKZACHY2BVGVHWZGCWDDB5LQ2WBKZ5XL', + sinhala: 'N4RYKKDHSXB6IID6JILOX5A27UJLBJJ7', spanish: 'JU6JOEJBHRH7IILGSSUVEYO552JUNMG4', - swahili: 'JDXM4LB6AXQNCURNTZ5RT2U5I2CBXLBT', swedish: '33RMFTS5OKLEWV2KGX2HMTP7M3VCKXC4', tamil: 'MNIEHY7BQVMEU6BBJBL57E4QYNHOUIDB', telugu: 'MXE6BFOLRMR72GLUFEK3Y7NOUBPV5W4G', thai: 'MA3JUGAZNCCTBBTO2K7HR3RWJ3LILU6E', turkish: 'HZJRJNL3C3KLBXZQ4BPIODYRKXXRKYCL', - ukrainian: 'OW43DTZJ432PEORIXR72R35V4H6SUUU3', urdu: 'T5FSZMLJ55LNPBIILM2A2SVEA3YIIYL3', - vietnamese: 'ULJN5SUWA3HJKLPKHOSTOH5AJSSWN5H3', - zulu: 'B6OMGRZUYIJ5WLDQZODKCFCXCTH7PHB3' + vietnamese: 'ULJN5SUWA3HJKLPKHOSTOH5AJSSWN5H3' }; export {targetEnv, clientAppVersion, witApiKeys}; diff --git a/src/utils/data.js b/src/utils/data.js index 1dcf609..06164e0 100755 --- a/src/utils/data.js +++ b/src/utils/data.js @@ -89,7 +89,7 @@ const captchaGoogleSpeechApiLangCodes = { zu: 'zu-ZA' // Zulu }; -// https://cloud.ibm.com/apidocs/speech-to-text#recognize-audio +// https://cloud.ibm.com/docs/services/speech-to-text?topic=speech-to-text-models#models const captchaIbmSpeechApiLangCodes = { ar: 'ar-AR_BroadbandModel', // Arabic af: '', // Afrikaans @@ -106,7 +106,7 @@ const captchaIbmSpeechApiLangCodes = { hr: '', // Croatian cs: '', // Czech da: '', // Danish - nl: '', // Dutch + nl: 'nl-NL_BroadbandModel', // Dutch 'en-GB': 'en-GB_BroadbandModel', // English (UK) en: 'en-US_BroadbandModel', // English (US) et: '', // Estonian @@ -126,7 +126,7 @@ const captchaIbmSpeechApiLangCodes = { hu: '', // Hungarian is: '', // Icelandic id: '', // Indonesian - it: '', // Italian + it: 'it-IT_BroadbandModel', // Italian ja: 'ja-JP_BroadbandModel', // Japanese kn: '', // Kannada ko: 'ko-KR_BroadbandModel', // Korean @@ -194,7 +194,7 @@ const captchaMicrosoftSpeechApiLangCodes = { 'de-AT': 'de-DE', // German (Austria) 'de-CH': 'de-DE', // German (Switzerland) el: '', // Greek - gu: '', // Gujarati + gu: 'gu-IN', // Gujarati iw: '', // Hebrew hi: 'hi-IN', // Hindi hu: '', // Hungarian @@ -209,7 +209,7 @@ const captchaMicrosoftSpeechApiLangCodes = { lt: '', // Lithuanian ms: '', // Malay ml: '', // Malayalam - mr: '', // Marathi + mr: 'mr-IN', // Marathi mn: '', // Mongolian no: 'nb-NO', // Norwegian fa: '', // Persian @@ -227,10 +227,10 @@ const captchaMicrosoftSpeechApiLangCodes = { 'es-419': 'es-MX', // Spanish (Latin America) sw: '', // Swahili sv: 'sv-SE', // Swedish - ta: '', // Tamil - te: '', // Telugu + ta: 'ta-IN', // Tamil + te: 'te-IN', // Telugu th: 'th-TH', // Thai - tr: '', // Turkish + tr: 'tr-TR', // Turkish uk: '', // Ukrainian ur: '', // Urdu vi: '', // Vietnamese @@ -239,92 +239,112 @@ const captchaMicrosoftSpeechApiLangCodes = { const captchaWitSpeechApiLangCodes = { ar: 'arabic', // Arabic - af: 'afrikaans', // Afrikaans + af: '', // Afrikaans am: '', // Amharic hy: '', // Armenian - az: 'azerbaijani', // Azerbaijani + az: '', // Azerbaijani eu: '', // Basque bn: 'bengali', // Bengali - bg: 'bulgarian', // Bulgarian + bg: '', // Bulgarian ca: 'catalan', // Catalan 'zh-HK': '', // Chinese (Hong Kong) 'zh-CN': 'chinese', // Chinese (Simplified) 'zh-TW': 'chinese', // Chinese (Traditional) - hr: 'croatian', // Croatian - cs: 'czech', // Czech - da: 'danish', // Danish + hr: '', // Croatian + cs: '', // Czech + da: '', // Danish nl: 'dutch', // Dutch 'en-GB': 'english', // English (UK) en: 'english', // English (US) - et: 'estonian', // Estonian + et: '', // Estonian fil: '', // Filipino fi: 'finnish', // Finnish fr: 'french', // French 'fr-CA': 'french', // French (Canadian) gl: '', // Galician - ka: 'georgian', // Georgian + ka: '', // Georgian de: 'german', // German 'de-AT': 'german', // German (Austria) 'de-CH': 'german', // German (Switzerland) - el: 'greek', // Greek + el: '', // Greek gu: '', // Gujarati - iw: 'hebrew', // Hebrew + iw: '', // Hebrew hi: 'hindi', // Hindi - hu: 'hungarian', // Hungarian - is: 'icelandic', // Icelandic + hu: '', // Hungarian + is: '', // Icelandic id: 'indonesian', // Indonesian it: 'italian', // Italian ja: 'japanese', // Japanese kn: 'kannada', // Kannada ko: 'korean', // Korean - lo: 'laothian', // Laothian - lv: 'latvian', // Latvian - lt: 'lithuanian', // Lithuanian + lo: '', // Laothian + lv: '', // Latvian + lt: '', // Lithuanian ms: 'malay', // Malay - ml: '', // Malayalam + ml: 'malayalam', // Malayalam mr: '', // Marathi - mn: 'mongolian', // Mongolian - no: 'norwegian', // Norwegian - fa: 'persian', // Persian + mn: '', // Mongolian + no: '', // Norwegian + fa: '', // Persian pl: 'polish', // Polish pt: 'portuguese', // Portuguese 'pt-BR': 'portuguese', // Portuguese (Brazil) 'pt-PT': 'portuguese', // Portuguese (Portugal) - ro: 'romanian', // Romanian + ro: '', // Romanian ru: 'russian', // Russian - sr: 'serbian', // Serbian - si: '', // Sinhalese - sk: 'slovak', // Slovak - sl: 'slovenian', // Slovenian + sr: '', // Serbian + si: 'sinhala', // Sinhalese + sk: '', // Slovak + sl: '', // Slovenian es: 'spanish', // Spanish 'es-419': 'spanish', // Spanish (Latin America) - sw: 'swahili', // Swahili + sw: '', // Swahili sv: 'swedish', // Swedish ta: 'tamil', // Tamil te: 'telugu', // Telugu th: 'thai', // Thai tr: 'turkish', // Turkish - uk: 'ukrainian', // Ukrainian + uk: '', // Ukrainian ur: 'urdu', // Urdu vi: 'vietnamese', // Vietnamese - zu: 'zulu' // Zulu + zu: '' // Zulu }; // https://cloud.ibm.com/apidocs/speech-to-text#service-endpoint const ibmSpeechApiUrls = { + london: 'https://api.eu-gb.speech-to-text.watson.cloud.ibm.com/v1/recognize', frankfurt: - 'https://stream-fra.watsonplatform.net/speech-to-text/api/v1/recognize', - dallas: 'https://stream.watsonplatform.net/speech-to-text/api/v1/recognize', + 'https://api.eu-de.speech-to-text.watson.cloud.ibm.com/v1/recognize', + dallas: + 'https://api.us-south.speech-to-text.watson.cloud.ibm.com/v1/recognize', washington: - 'https://gateway-wdc.watsonplatform.net/speech-to-text/api/v1/recognize', - sydney: - 'https://gateway-syd.watsonplatform.net/speech-to-text/api/v1/recognize', - tokyo: - 'https://gateway-tok.watsonplatform.net/speech-to-text/api/v1/recognize' + 'https://api.us-east.speech-to-text.watson.cloud.ibm.com/v1/recognize', + sydney: 'https://api.au-syd.speech-to-text.watson.cloud.ibm.com/v1/recognize', + tokyo: 'https://api.jp-tok.speech-to-text.watson.cloud.ibm.com/v1/recognize' }; -// https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/rest-speech-to-text +// https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/rest-speech-to-text#regions-and-endpoints const microsoftSpeechApiUrls = { + eastAu: + 'https://australiaeast.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1', + centralCa: + 'https://canadacentral.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1', + centralUs: + 'https://centralus.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1', + centralFr: + 'https://francecentral.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1', + centralIn: + 'https://centralindia.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1', + eastJp: + 'https://japaneast.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1', + centralKr: + 'https://koreacentral.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1', + northCentralUs: + 'https://northcentralus.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1', + southCentralUs: + 'https://southcentralus.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1', + southUk: + 'https://uksouth.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1', eastUs: 'https://eastus.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1', eastUs2: