21 lines
531 B
TypeScript
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) => {
|
|
|
|
} |