Skip to content

Instantly share code, notes, and snippets.

View coryl's full-sized avatar

Cory Liu coryl

  • iOS / OS X Developer
  • Toronto, Canada
View GitHub Profile
@coryl
coryl / GoogleSpeechLanguage.swift
Last active July 20, 2021 17:10
Google Speech-to-Text Language Enum: A convenient enum for categorizing language codes. Useful for filling in dropdown fields.
// GoogleSpeechLanguage.swift
//
// Created by Cory Liu on 2020/12/31.
//https://cloud.google.com/speech-to-text/docs/languages
//Note: Google accepts BCP47 language codes with capital letters ie. "en-US" as well as lower case BPC47 codes ie. "en-us".
//However in their response they return lowercase: "en-us". For the purposes of my project, I needed to reinitialize Google's response
//into this language enum object. Hence all case values are lower case.
enum GoogleSpeechLanguage: String, CaseIterable {