How to use the iso-639-1.getAllCodes function in iso-639-1

To help you get started, we’ve selected a few iso-639-1 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github turt2live / matrix-dimension / web / app / admin / terms / new-edit / new-edit.component.ts View on Github external
templateUrl: "./new-edit.component.html",
    styleUrls: ["./new-edit.component.scss"],
})
export class AdminNewEditTermsComponent implements OnInit {

    // TODO: Multiple language support
    // TODO: Support external URLs

    private shortcode: string;

    public Editor = ClassicEditor;

    public isLoading = true;
    public isUpdating = false;
    public takenShortcodes: string[];
    public chosenLanguage: string = ISO6391.getAllCodes()[0];
    public languages: {
        [languageCode: string]: ILanguage;
    } = {
        "en": {
            name: "",
            text: "",
            langName: "English",
            url: "", // TODO: Calculate
            isExternal: false,
            externalUrl: "",
        },
    };
    public isEditing = false;

    public get chosenLanguageCodes(): string[] {
        return Object.keys(this.languages);
github slidewiki / slidewiki-platform / components / webrtc / SpeechRecognition.js View on Github external
});
                } else
                    that.recognition.stop();
            };

            that.recognition.onend = function (e) {
                if(!that.state.speechRecognitionDisabled){
                    console.warn('Recognition ended itself - stupid thing! Restarting ....', e);
                    that.recognition.start();
                } else {
                    //TODO in StatusObjekt packen
                }
            };

            let tmp = {};
            ISO6391.getAllCodes().forEach((code) => {
                tmp[''+code] = ISO6391.getName(code);
            });

            swal({
                titleText: 'Speech recognition enabled',
                html: '<p>Speech recognition is an experimental feature. If enabled, your voice will be automatically transcribed and displayed at all peers as a transcript.</p><p>Please select the language in which you will talk or disable the feature.</p>',
                type: 'info',
                input: 'select',
                inputValue: that.recognition.lang,
                inputOptions: tmp,
                showCancelButton: true,
                confirmButtonColor: '#3085d6',
                cancelButtonColor: '#d33',
                confirmButtonText: 'Okay',
                cancelButtonText: 'Disable',
                allowOutsideClick: false,
github ibi-group / datatools-ui / lib / common / components / LanguageSelect.js View on Github external
  _getOptions = () => ISO6391.getAllCodes().map(code => ({value: code, label: ISO6391.getName(code)}))
github slidewiki / slidewiki-platform / components / webrtc / Translations.js View on Github external
openChooseLanguageModal() {

        let that = this;
        let tmp = {};
        ISO6391.getAllCodes().forEach((code) =&gt; {
            if(this.languages.includes(''+code))
                tmp[''+code] = '' + ISO6391.getName(code) + (((''+code) === that.deckLanguage) ? ' (default)' : '');
        });

        let dialog = {
            titleText: 'Choose your preferred language',
            html: '<p>Translations of this deck are available. You may choose one of these to view the slides in this langauge instead of the langauge the presenter chose to present (<strong>'+ISO6391.getName(this.deckLanguage)+'</strong>). You can change your decision at any time. Please keep in mind that not all slides might be translated to your chosen language.</p>',
            type: 'info',
            input: 'select',
            inputValue: this.chosenLanguage,
            inputOptions: tmp,
            showCancelButton: true,
            confirmButtonColor: '#3085d6',
            cancelButtonColor: '#d33',
            confirmButtonText: 'Okay',
            cancelButtonText: 'Cancel',
github turt2live / matrix-dimension / web / app / admin / terms / new-edit / new-edit.component.ts View on Github external
public get availableLanguages(): { name: string, code: string }[] {
        return ISO6391.getAllCodes()
            .filter(c => !this.chosenLanguageCodes.includes(c))
            .map(c => {
                return {code: c, name: ISO6391.getName(c)};
            });
    }
github ibi-group / datatools-ui / lib / common / components / LanguageSelect.js View on Github external
  _getOptions = () => ISO6391.getAllCodes().map(code => ({value: code, label: ISO6391.getName(code)}))