Skip to content

Commit

Permalink
Add 6 more languages (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
pycui authored Jul 29, 2023
1 parent 922f586 commit c356f43
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 5 deletions.
26 changes: 25 additions & 1 deletion client/mobile/ios/rac/rac/Welcome/Settings/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ enum LlmOption: RawRepresentable, Hashable, CaseIterable, Identifiable, Codable

enum LanguageOption: RawRepresentable, Hashable, CaseIterable, Identifiable, Codable {

case english, spanish
case english, spanish, french, german, italian, portuguese, polish, hindi

init?(rawValue: String) {
for option in LanguageOption.allCases {
Expand All @@ -68,6 +68,18 @@ enum LanguageOption: RawRepresentable, Hashable, CaseIterable, Identifiable, Cod
return "en-US"
case .spanish:
return "es-ES"
case .french:
return "fr-FR"
case .german:
return "de-DE"
case .italian:
return "it-IT"
case .portuguese:
return "pt-PT"
case .polish:
return "pl-PL"
case .hindi:
return "hi-IN"
}
}

Expand All @@ -77,6 +89,18 @@ enum LanguageOption: RawRepresentable, Hashable, CaseIterable, Identifiable, Cod
return "English"
case .spanish:
return "Spanish"
case .french:
return "French"
case .german:
return "German"
case .italian:
return "Italian"
case .portuguese:
return "Portuguese"
case .polish:
return "Polish"
case .hindi:
return "Hindi"
}
}

Expand Down
5 changes: 3 additions & 2 deletions client/web/src/components/Languages/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
import React from 'react';
import './style.css'

const Languages = ({preferredLanguage, setPreferredLanguage}) => {
const languages = ["English", "Spanish"];
const Languages = ({ preferredLanguage, setPreferredLanguage }) => {
const languages = ["English", "Spanish", "French", "German", "Hindi", "Italian", "Polish",
"Portuguese"];

return (
<div className="languages-container">
Expand Down
6 changes: 4 additions & 2 deletions client/web/src/hooks/languageCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ export const languageCode = {
"Korean": "ko-KR",
"Portuguese": "pt-PT",
"Russian": "ru-RU",
"Spanish": "es-ES"
}
"Spanish": "es-ES",
"Indian": "hi-IN",
"Polish": "pl-PL"
}
6 changes: 6 additions & 0 deletions realtime_ai_character/audio/speech_to_text/whisper.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
WHISPER_LANGUAGE_CODE_MAPPING = {
"en-US": "en",
"es-ES": "es",
"fr-FR": "fr",
"de-DE": "de",
"it-IT": "it",
"pt-PT": "pt",
"hi-IN": "hi",
"pl-PL": "pl",
}

class Whisper(Singleton, SpeechToText):
Expand Down
6 changes: 6 additions & 0 deletions realtime_ai_character/websocket_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
GREETING_TXT_MAP = {
"en-US": "Hi, my friend, what brings you here today?",
"es-ES": "Hola, mi amigo, ¿qué te trae por aquí hoy?",
"fr-FR": "Salut mon ami, qu'est-ce qui t'amène ici aujourd'hui?",
"de-DE": "Hallo mein Freund, was bringt dich heute hierher?",
"it-IT": "Ciao amico mio, cosa ti porta qui oggi?",
"pt-PT": "Olá meu amigo, o que te traz aqui hoje?",
"hi-IN": "नमस्ते मेरे दोस्त, आज आपको यहां क्या लाया है?",
"pl-PL": "Cześć mój przyjacielu, co cię tu dziś przynosi?",
}


Expand Down

0 comments on commit c356f43

Please sign in to comment.