add langs flags repo.
This commit is contained in:
@ -1,5 +1,8 @@
|
||||
import AsyncStorage from '@react-native-async-storage/async-storage';
|
||||
import { CachedTranslator } from "@/app/i18n/api"
|
||||
import { language_t } from "@/app/i18n/lang"
|
||||
import { longLang } from "@/app/i18n/lang"
|
||||
import { useEffect, useRef, useState } from "react"
|
||||
import { Button } from "react-native"
|
||||
|
||||
type ISpeakButtonProps = {
|
||||
country: string,
|
||||
@ -7,7 +10,7 @@ type ISpeakButtonProps = {
|
||||
}
|
||||
|
||||
function iSpeak(language : string) {
|
||||
return `I speak ${language}.`
|
||||
return `I speak ${longLang(language)}.`
|
||||
}
|
||||
|
||||
async function iSpeakTr(targetLang : string, sourceLang = "en") {
|
||||
@ -17,5 +20,18 @@ async function iSpeakTr(targetLang : string, sourceLang = "en") {
|
||||
}
|
||||
|
||||
const ISpeakButton = (props : ISpeakButtonProps) => {
|
||||
|
||||
}
|
||||
|
||||
const [title, setTitle] = useState("");
|
||||
|
||||
useEffect(() => {
|
||||
async function () {
|
||||
setTitle(await iSpeakTr(props.language) as string);
|
||||
}
|
||||
}, []);
|
||||
|
||||
<Button onPress={setLanguage} title={}>
|
||||
|
||||
</Button>
|
||||
}
|
||||
|
||||
export default ISpeakButton;
|
Reference in New Issue
Block a user