import React from 'react'
import { Dropdown } from '@fluentui/react-northstar';

export const languages_bcp47 = [
    { key: 'af-ZA', text: 'Afrikaans (South Africa)' },
    { key: 'am-ET', text: 'Amharic (Ethiopia)' },
    { key: 'ar-DZ', text: 'Arabic (Algeria)' },
    { key: 'ar-BH', text: 'Arabic (Bahrain), modern standard' },
    { key: 'ar-EG', text: 'Arabic (Egypt)' },
    { key: 'ar-IQ', text: 'Arabic (Iraq)' },
    { key: 'ar-IL', text: 'Arabic (Israel)' },
    { key: 'ar-JO', text: 'Arabic (Jordan)' },
    { key: 'ar-KW', text: 'Arabic (Kuwait)' },
    { key: 'ar-LB', text: 'Arabic (Lebanon)' },
    { key: 'ar-LY', text: 'Arabic (Libya) ' },
    { key: 'ar-MA', text: 'Arabic (Morocco)' },
    { key: 'ar-OM', text: 'Arabic (Oman)' },
    { key: 'ar-PS', text: 'Arabic (Palestinian Authority)' },
    { key: 'ar-QA', text: 'Arabic (Qatar)' },
    { key: 'ar-SA', text: 'Arabic (Saudi Arabia)' },
    { key: 'ar-SY', text: 'Arabic (Syria)' },
    { key: 'ar-TN', text: 'Arabic (Tunisia)' },
    { key: 'ar-AE', text: 'Arabic (United Arab Emirates)' },
    { key: 'ar-YE', text: 'Arabic (Yemen)' },
    { key: 'bn-IN', text: 'Bengali (India)' },
    { key: 'bg-BG', text: 'Bulgarian (Bulgaria' },
    { key: 'my-MM', text: 'Burmese (Myanmar' },
    { key: 'ca-ES', text: 'Catalan (Spain)' },
    { key: 'zh-HK', text: 'Chinese (Cantonese, Traditional)' },
    { key: 'zh-CN', text: 'Chinese (Mandarin, Simplified)' },
    { key: 'zh-TW', text: 'Chinese (Taiwanese Mandarin)' },
    { key: 'hr-HR', text: 'Croatian (Croatia)' },
    { key: 'cs-CZ', text: 'Czech (Czech)' },
    { key: 'da-DK', text: 'Danish (Denmark)' },
    { key: 'nl-BE', text: 'Dutch (Belgium)' },
    { key: 'nl-NL', text: 'Dutch (Netherlands)' },
    { key: 'en-AU', text: 'English (Australia)' },
    { key: 'en-CA', text: 'English (Canada)' },
    { key: 'en-GH', text: 'English (Ghana)' },
    { key: 'en-HK', text: 'English (Hong Kong)' },
    { key: 'en-IN', text: 'English (India)' },
    { key: 'en-IE', text: 'English (Ireland)' },
    { key: 'en-KE', text: 'English (Kenya)' },
    { key: 'en-NZ', text: 'English (New Zealand)' },
    { key: 'en-NG', text: 'English (Nigeria)' },
    { key: 'en-PH', text: 'English (Philippines)' },
    { key: 'en-SG', text: 'English (Singapore)' },
    { key: 'en-ZA', text: 'English (South Africa)' },
    { key: 'en-TZ', text: 'English (Tanzania)' },
    { key: 'en-GB', text: 'English (United Kingdom)' },
    { key: 'en-US', text: 'English (United States)' },
    { key: 'et-EE', text: 'Estonian (Estonia)' },
    { key: 'fil-PH', text: 'Filipino (Philippines)' },
    { key: 'fi-FI', text: 'Finnish (Finland)' },
    { key: 'fr-BE', text: 'French (Belgium)' },
    { key: 'fr-CA', text: 'French (Canada)' },
    { key: 'fr-FR', text: 'French (France)' },
    { key: 'fr-CH', text: 'French (Switzerland)' },
    { key: 'de-AT', text: 'German (Austria)' },
    { key: 'de-DE', text: 'German (Germany)' },
    { key: 'de-CH', text: 'German (Switzerland)' },
    { key: 'el-GR', text: 'Greek (Greece)' },
    { key: 'gu-IN', text: 'Gujarati (Indian)' },
    { key: 'hi-IN', text: 'Hebrew (Israel)' },
    { key: 'hu-HU', text: 'Hungarian (Hungary)' },
    { key: 'is-IS', text: 'Icelandic (Iceland)' },
    { key: 'id-ID', text: 'Indonesian (Indonesia)' },
    { key: 'ga-IE', text: 'Irish (Ireland)' },
    { key: 'it-IT', text: 'Italian (Italy)' },
    { key: 'ja-JP', text: 'Japanese (Japan)' },
    { key: 'jv-ID', text: 'Javanese (Indonesia)' },
    { key: 'kn-IN', text: 'Kannada (India)' },
    { key: 'km-KH', text: 'Khmer (Cambodia)' },
    { key: 'ko-KR', text: 'Korean (Korea)' },
    { key: 'lo-LA', text: 'Lao (Laos)' },
    { key: 'lv-LV', text: 'Latvian (Latvia)' },
    { key: 'lt-LT', text: 'Lithuanian (Lithuania)' },
    { key: 'mk-MK', text: 'Macedonian (North Macedonia)' },
    { key: 'ms-MY', text: 'Malay (Malaysia)' },
    { key: 'mt-MT', text: 'Maltese (Malta)' },
    { key: 'mr-IN', text: 'Marathi (India)' },
    { key: 'nb-NO', text: 'Norwegian (Bokmål, Norway)' },
    { key: 'pt-pt', text: 'Portuguese (Portugal)' },
    { key: 'fa-IR', text: 'Persian (Iran)' },
    { key: 'pl-PL', text: 'Polish (Poland)' },
    { key: 'pt-BR', text: 'Portuguese (Brazil)' },
    { key: 'pt-PT', text: 'Portuguese (Portugal)' },
    { key: 'ro-RO', text: 'Romanian (Romania)' },
    { key: 'ru-RU', text: 'Russian (Russia)' },
    { key: 'sr-RS', text: 'Serbian (Serbia)' },
    { key: 'si-LK', text: 'Sinhala (Sri Lanka)' },
    { key: 'sk-SK', text: 'Slovak (Slovakia)' },
    { key: 'sl-SI', text: 'Slovenian (Slovenia)' },
    { key: 'es-AR', text: 'Spanish (Argentina)' },
    { key: 'es-BO', text: 'Spanish (Bolivia)' },
    { key: 'es-CL', text: 'Spanish (Chile)' },
    { key: 'es-CO', text: 'Spanish (Colombia)' },
    { key: 'es-CR', text: 'Spanish (Costa Rica)' },
    { key: 'es-CU', text: 'Spanish (Cuba)' },
    { key: 'es-DO', text: 'Spanish (Dominican Republic)' },
    { key: 'es-EC', text: 'Spanish (Ecuador)' },
    { key: 'es-SV', text: 'Spanish (El Salvador)' },
    { key: 'es-GQ', text: 'Spanish (Equatorial Guinea)' },
    { key: 'es-GT', text: 'Spanish (Guatemala)' },
    { key: 'es-HN', text: 'Spanish (Honduras)' },
    { key: 'es-MX', text: 'Spanish (Mexico)' },
    { key: 'es-NI', text: 'Spanish (Nicaragua)' },
    { key: 'es-PA', text: 'Spanish (Panama)' },
    { key: 'es-PY', text: 'Spanish (Paraguay)' },
    { key: 'es-PE', text: 'Spanish (Peru)' },
    { key: 'es-PR', text: 'Spanish (Puerto Rico)' },
    { key: 'es-ES', text: 'Spanish (Spain)' },
    { key: 'es-UY', text: 'Spanish (Uruguay)' },
    { key: 'es-US', text: 'Spanish (USA)' },
    { key: 'es-VE', text: 'Spanish (Venezuela)' },
    { key: 'sw-KE', text: 'Swahili (Kenya)' },
    { key: 'sw-TZ', text: 'Swahili (Tanzania)' },
    { key: 'sv-SE', text: 'Swedish (Sweden)' },
    { key: 'ta-IN', text: 'Tamil (India)' },
    { key: 'te-IN', text: 'Telugu (India)' },
    { key: 'th-TH', text: 'Thai (Thailand)' },
    { key: 'tr-TR', text: 'Turkish (Turkey)' },
    { key: 'uk-UA', text: 'Ukrainian (Ukraine)' },
    { key: 'uz-UZ', text: 'Uzbek (Uzbekistan)' },
    { key: 'vi-VN', text: 'Vietnamese (Vietnam)' },
    { key: 'zu-ZA', text: 'Zulu (South Africa)' }
];

export const languages = [
    { key: 'af', text: 'Afrikaans' },
    { key: 'sq', text: 'Albanian' },
    { key: 'am', text: 'Amharic' },
    { key: 'ar', text: 'Arabic' },
    { key: 'hy', text: 'Armenian' },
    { key: 'as', text: 'Assamese' },
    { key: 'az', text: 'Azerbaijani' },
    { key: 'bn', text: 'Bangla' },
    { key: 'ba', text: 'Bashkir' },
    { key: 'eu', text: 'Basque' },
    { key: 'bs', text: 'Bosnian ' },
    { key: 'bg', text: 'Bulgarian' },
    { key: 'yue', text: 'Cantonese ' },
    { key: 'ca', text: 'Catalan' },
    { key: 'lzh', text: 'Chinese ' },
    { key: 'zh-Hans', text: 'Chinese Simplified' },
    { key: 'zh-Hant', text: 'Chinese Traditional' },
    { key: 'hr', text: 'Croatian' },
    { key: 'cs', text: 'Czech' },
    { key: 'da', text: 'Danish' },
    { key: 'prs', text: 'Dari' },
    { key: 'dv', text: 'Divehi' },
    { key: 'nl', text: 'Dutch' },
    { key: 'en', text: 'English' },
    { key: 'et', text: 'Estonian' },
    { key: 'fo', text: 'Faroese' },
    { key: 'fj', text: 'Fijian' },
    { key: 'fil', text: 'Filipino' },
    { key: 'fi', text: 'Finnish' },
    { key: 'fr', text: 'French' },
    { key: 'fr-ca', text: 'French (Canada)' },
    { key: 'gl', text: 'Galician' },
    { key: 'ka', text: 'Georgian' },
    { key: 'de', text: 'German' },
    { key: 'el', text: 'Greek' },
    { key: 'gu', text: 'Gujarati' },
    { key: 'ht', text: 'Haitian Creole' },
    { key: 'he', text: 'Hebrew' },
    { key: 'hi', text: 'Hindi' },
    { key: 'mww', text: 'Hmong Daw (Latin)' },
    { key: 'hu', text: 'Hungarian' },
    { key: 'is', text: 'Icelandic' },
    { key: 'id', text: 'Indonesian' },
    { key: 'ikt', text: 'Inuinnaqtun' },
    { key: 'iu', text: 'Inuktitut' },
    { key: 'iu-Latn', text: 'Inuktitut (Latin)' },
    { key: 'ga', text: 'Irish' },
    { key: 'it', text: 'Italian' },
    { key: 'ja', text: 'Japanese' },
    { key: 'kn', text: 'Kannada' },
    { key: 'kk', text: 'Kazakh' },
    { key: 'km', text: 'Khmer' },
    { key: 'tlh-Latn', text: 'Klingon' },
    { key: 'tlh-Piqd', text: 'Klingon (plqaD)' },
    { key: 'ko', text: 'Korean' },
    { key: 'ku', text: 'Kurdish (Central)' },
    { key: 'kmr', text: 'Kurdish (Northern)' },
    { key: 'ky', text: 'Kyrgyz (Cyrillic)' },
    { key: 'lo', text: 'Lao' },
    { key: 'lv', text: 'Latvian	' },
    { key: 'lt', text: 'Lithuanian' },
    { key: 'mk', text: 'Macedonian' },
    { key: 'mg', text: 'Malagasy' },
    { key: 'ms', text: 'Malay (Latin)' },
    { key: 'ml', text: 'Malayalam' },
    { key: 'mt', text: 'Maltese' },
    { key: 'mi', text: 'Maori' },
    { key: 'mr', text: 'Marathi' },
    { key: 'mn-Cyrl', text: 'Mongolian (Cyrillic)' },
    { key: 'mn-Mong', text: 'Mongolian (Traditional)' },
    { key: 'my', text: 'Myanmar' },
    { key: 'ne', text: 'Nepali' },
    { key: 'nb', text: 'Norwegian' },
    { key: 'or', text: 'Odia' },
    { key: 'ps', text: 'Pashto' },
    { key: 'fa', text: 'Persian' },
    { key: 'pl', text: 'Polish' },
    { key: 'pt', text: 'Portuguese (Brazil)' },
    { key: 'pt-pt', text: 'Portuguese (Portugal)' },
    { key: 'pa', text: 'Punjabi' },
    { key: 'otq', text: 'Queretaro Otomi' },
    { key: 'ro', text: 'Romanian' },
    { key: 'ru', text: 'Russian' },
    { key: 'sm', text: 'Samoan (Latin)' },
    { key: 'sr-Cyrl', text: 'Serbian (Cyrillic)' },
    { key: 'sr-Latn', text: 'Serbian (Latin)' },
    { key: 'sk', text: 'Slovak' },
    { key: 'sl', text: 'Slovenian' },
    { key: 'so', text: 'Somali (Arabic)' },
    { key: 'es', text: 'Spanish' },
    { key: 'sw', text: 'Swahili (Latin)' },
    { key: 'sv', text: 'Swedish' },
    { key: 'ty', text: 'Tahitian' },
    { key: 'ta', text: 'Tamil' },
    { key: 'tt', text: 'Tatar (Latin)' },
    { key: 'te', text: 'Telugu' },
    { key: 'th', text: 'Thai' },
    { key: 'bo', text: 'Tibetan' },
    { key: 'ti', text: 'Tigrinya' },
    { key: 'to', text: 'Tongan' },
    { key: 'tr', text: 'Turkish' },
    { key: 'tk', text: 'Turkmen (Latin)' },
    { key: 'uk', text: 'Ukrainian' },
    { key: 'hsb', text: 'Upper Sorbian' },
    { key: 'ur', text: 'Urdu' },
    { key: 'ug', text: 'Uyghur (Arabic)' },
    { key: 'uz', text: 'Uzbek (Latin)' },
    { key: 'vi', text: 'Vietnamese' },
    { key: 'cy', text: 'Welsh' },
    { key: 'yua', text: 'Yucatec Maya' },
    { key: 'zu', text: 'Zulu' }
];

export default function LanguageDialog(props) {

    const languagesToStrings = () => {
        const out = []
        for (const l of props.languages) {
            out.push(l.text)
        }
        return out
    }

    return (
        <Dropdown
            search
            placeholder="Select a language"
            label="Languages"
            items={languagesToStrings()}
            onChange={props.onDialogChange}
        />
    )
} 