translation-terrace/components/ui/ISpeakButton.tsx
2025-01-22 18:57:32 -08:00

21 lines
531 B
TypeScript

import { CachedTranslator } from "@/app/i18n/api"
import { language_t } from "@/app/i18n/lang"
type ISpeakButtonProps = {
country: string,
language: string,
}
function iSpeak(language : string) {
return `I speak ${language}.`
}
async function iSpeakTr(targetLang : string, sourceLang = "en") {
const sourceStr = iSpeak(targetLang)
const translator = new CachedTranslator(sourceLang, targetLang);
return await translator.translate(sourceStr)
}
const ISpeakButton = (props : ISpeakButtonProps) => {
}