What are language codes in Chrome's implementation of the HTML5 speech recognition API?

后端 未结 4 1194
迷失自我
迷失自我 2021-01-30 05:40

Chrome implemented the HTML5 speech recognition API. Many languages are supported. I wanna know which languages are supported and each language\'s corresponding code which is us

4条回答
  •  旧巷少年郎
    2021-01-30 06:03

    Here you have @TimHayes in a LinkedHashMap where you can fetch the values. Im using LinkedHashMap so I can get the position of the map.

        LinkedHashMap country = new LinkedHashMap();
    
    
        country.put("South Africa", "af-ZA");
        country.put("Algeria", "ar-DZ");
        country.put("Bahrain", "ar-BH");
        country.put("Egypt", "ar-EG");
        country.put("Israel", "ar-IL");
        country.put("Iraq", "ar-IQ");
        country.put("Jordan", "ar-JO");
        country.put("Kuwait", "ar-KW");
        country.put("Lebanon", "ar-LB");
        country.put("Morocco", "ar-MA");
        country.put("Oman", "ar-OM");
        country.put("Palestinian Territory", "ar-PS");
        country.put("Qatar", "ar-QA");
        country.put("Saudi Arabia", "ar-SA");
        country.put("Tunisia", "ar-TN");
        country.put("UAE", "ar-AE");
        country.put("Spain", "eu-ES");
        country.put("Bulgaria", "bg-BG");
        country.put("Spain", "ca-ES");
        country.put("China (Simp.)", "cmn-Hans-CN");
        country.put("Hong Kong SAR (Trad.)", "cmn-Hans-HK");
        country.put("Taiwan (Trad.)", "cmn-Hant-TW");
        country.put("Hong Kong", "yue-Hant-HK");
        country.put("Croatia", "hr_HR");
        country.put("Czech Republic", "cs-CZ");
        country.put("Denmark", "da-DK");
        country.put("Australia", "en-AU");
        country.put("Canada", "en-CA");
        country.put("India", "en-IN");
        country.put("Ireland", "en-IE");
        country.put("New Zealand", "en-NZ");
        country.put("Philippines", "en-PH");
        country.put("South Africa", "en-ZA");
        country.put("United Kingdom", "en-GB");
        country.put("United States", "en-US");
        country.put("Iran", "fa-IR");
        country.put("France", "fr-FR");
        country.put("Philippines", "fil-PH");
        country.put("Spain", "gl-ES");
        country.put("Germany", "de-DE");
        country.put("Greece", "el-GR");
        country.put("Finland", "fi-FI");
        country.put("Israel", "he-IL");
        country.put("India", "hi-IN");
        country.put("Hungary", "hu-HU");
        country.put("Indonesia", "id-ID");
        country.put("Iceland", "is-IS");
        country.put("Italy", "it-IT");
        country.put("Switzerland", "it-CH");
        country.put("Japan", "ja-JP");
        country.put("Korea", "ko-KR");
        country.put("Lithuania", "lt-LT");
        country.put("Malaysia", "ms-MY");
        country.put("Netherlands", "nl-NL");
        country.put("Norway", "nb-NO");
        country.put("Poland", "pl-PL");
        country.put("Brazil", "pt-BR");
        country.put("Portugal", "pt-PT");
        country.put("Romania", "ro-RO");
        country.put("Russia", "ru-RU");
        country.put("Serbia", "sr-RS");
        country.put("Slovakia", "sk-SK");
        country.put("Slovenia", "sl-SI");
        country.put("Argentina", "es-AR");
        country.put("Bolivia", "es-BO");
        country.put("Chile", "es-CL");
        country.put("Colombia", "es-CO");
        country.put("Costa Rica", "es-CR");
        country.put("Dominican Republic", "es-DO");
        country.put("Ecuador", "es-EC");
        country.put("El Salvador", "es-SV");
        country.put("Guatemala", "es-GT");
        country.put("Honduras", "es-HN");
        country.put("México", "es-MX");
        country.put("Nicaragua", "es-NI");
        country.put("Panamá", "es-PA");
        country.put("Paraguay", "es-PY");
        country.put("Perú", "es-PE");
        country.put("Puerto Rico", "es-PR");
        country.put("Spain", "es-ES");
        country.put("Uruguay", "es-UY");
        country.put("United States", "es-US");
        country.put("Venezuela", "es-VE");
        country.put("Sweden", "sv-SE");
        country.put("Thailand", "th-TH");
        country.put("Turkey", "tr-TR");
        country.put("Ukraine", "uk-UA");
        country.put("Viet Nam", "vi-VN");
        country.put("South Africa", "zu-ZA");
    

提交回复
热议问题