diff --git a/Views/Groups.js b/Views/Groups.js index cd777f3..0859bac 100644 --- a/Views/Groups.js +++ b/Views/Groups.js @@ -4,6 +4,7 @@ import { StyleSheet, SafeAreaView, FlatList, View, ActivityIndicator } from 'rea import API from "../API"; import GroupCard from "../components/GroupCard"; import AsyncStorage from '@react-native-async-storage/async-storage'; +import i18n from "../i18nMessages.js"; const GROUPS_CACHE_KEY = 'groups_following'; @@ -113,7 +114,7 @@ const Groups = ({navigation}) => { }} /> : { /> } - {searchQuery ? "Results:" : "Your Groups:"} + {searchQuery ? i18n.t("message.results") : i18n.t("message.yourGroups")} } style={{backgroundColor: "#edf2f7",}} diff --git a/Views/Invite.js b/Views/Invite.js index 2160936..e1d6cde 100644 --- a/Views/Invite.js +++ b/Views/Invite.js @@ -72,10 +72,12 @@ let InviteView = ()=>{ onPress={()=>{setChecked(!checked)}} /> - + ) } -export default InviteView; \ No newline at end of file +export default InviteView; diff --git a/Views/Login.js b/Views/Login.js index b8547d2..7040f78 100644 --- a/Views/Login.js +++ b/Views/Login.js @@ -30,7 +30,7 @@ export default function App({ navigation, route }) { style={styles.logo} source={require('./../assets/icon.png')} /> - EMI Fellowship + {i18n.t("message.appName")} { /> - Private group - Require approval before people can join. + {i18n.t("message.privateGroup")} + {i18n.t("message.requireApprovalBeforeJoin")} @@ -155,7 +156,7 @@ const NewGroup = ({ navigation }) => { disabled={isSubmitting} style={styles.button} > - Create Group + {i18n.t("message.createGroupAction")} diff --git a/Views/NewPost.js b/Views/NewPost.js index 6300327..d175ce5 100644 --- a/Views/NewPost.js +++ b/Views/NewPost.js @@ -170,7 +170,7 @@ let NewPostView = (props) => { { toProfile._id ? - Posting on: {toProfile.profile?.firstName} {toProfile.profile?.lastName} + {i18n.t("message.postingOn")}: {toProfile.profile?.firstName} {toProfile.profile?.lastName} : null } @@ -178,7 +178,7 @@ let NewPostView = (props) => { { {/* Button to pick images from the gallery */} {isUploading && ( )} {/* Display uploading state and selected image preview */} {photo && ( - Uploading... + {i18n.t("message.uploading")} { {/* Display upload progress if in progress */} { uploadProgress > 0 && uploadProgress < 100 && ( - Upload Progress: {uploadProgress.toFixed(2)}% + {i18n.t("message.uploadProgress")}: {uploadProgress.toFixed(2)}% ) } {/* Display media content if extra content is available */} @@ -229,4 +229,4 @@ let NewPostView = (props) => { ) } -export default NewPostView; \ No newline at end of file +export default NewPostView; diff --git a/Views/Profile.js b/Views/Profile.js index 1be2542..e48ae6b 100644 --- a/Views/Profile.js +++ b/Views/Profile.js @@ -9,6 +9,7 @@ import ProfileHeader from '../components/ProfileHeader.js'; import AsyncStorage from '@react-native-async-storage/async-storage'; import { useSnapshot } from 'valtio'; import GlobalState from '../contexts/GlobalState.js'; +import i18n from "../i18nMessages.js"; const PROFILE_LOG_PREFIX = '[Profile]'; const logProfile = (...args) => { @@ -203,18 +204,18 @@ let Profile = ({ navigation, route }) => { navigation.navigate('NewPost', {toProfile: profile._id}) }} /> - - + - + + }}>{tag == 'embedded' ? i18n.t("message.files") : ''} {isOwnedGroup ? ( @@ -226,7 +227,7 @@ let Profile = ({ navigation, route }) => { disabled={isDeletingGroup} onPress={handleDeleteGroup} > - Delete Group + {i18n.t("message.deleteGroup")} ) : <>} diff --git a/Views/ProfileSettings.js b/Views/ProfileSettings.js index b10fa5e..94c5ee5 100644 --- a/Views/ProfileSettings.js +++ b/Views/ProfileSettings.js @@ -41,12 +41,12 @@ let ProfileSettings = () => { }; const languageOptions = [ - { value: "es", label: "Español" }, - { value: "en", label: "English" }, - { value: "da", label: "Danish" }, - { value: "fr", label: "French" }, + { value: "es", label: i18n.t("message.languageSpanish") }, + { value: "en", label: i18n.t("message.languageEnglish") }, + { value: "da", label: i18n.t("message.languageDanish") }, + { value: "fr", label: i18n.t("message.languageFrench") }, ]; - const currentLanguageLabel = languageOptions.find((opt) => opt.value === language)?.label || "English"; + const currentLanguageLabel = languageOptions.find((opt) => opt.value === language)?.label || i18n.t("message.languageEnglish"); const pickImage = async () => { if (uploading) return; @@ -176,8 +176,10 @@ let ProfileSettings = () => { - Profile Setting - + {i18n.t("message.profileSetting")} + { value={description} onChangeText={text => setDescription(text)} /> - Language: + {i18n.t("message.language")}: { const viewer = useSnapshot(GlobalState).me; @@ -47,7 +48,7 @@ const Search = () => { return ( @@ -66,7 +67,7 @@ const Search = () => { data={followers} renderItem={renderFollowing} keyExtractor={item => item} - ListHeaderComponent={Recently Following} + ListHeaderComponent={{i18n.t("message.recentlyFollowing")}} /> } diff --git a/Views/SelectProfile.js b/Views/SelectProfile.js index 65e4f4f..fb77650 100644 --- a/Views/SelectProfile.js +++ b/Views/SelectProfile.js @@ -43,23 +43,23 @@ let MenuView = ({ navigation }) => { style={{ paddingTop: 10 }} imageStyle={{ resizeMode: "contain", opacity: 0.05 }} > - + - + { navigation.navigate("ProfileSettings") }} left={props => } /> } /> { navigation.navigate("Logout") }} left={props => } /> - + { navigation.navigate("Invite") }} left={props => } /> } /> - Language: + {i18n.t("message.language")}: changeLang(newValue)} value={value}> - - + + @@ -67,4 +67,4 @@ let MenuView = ({ navigation }) => { ) } -export default MenuView; \ No newline at end of file +export default MenuView; diff --git a/components/Login.js b/components/Login.js index d16de49..248e90c 100644 --- a/components/Login.js +++ b/components/Login.js @@ -46,7 +46,7 @@ let LoginForm = () => { style={styles.input} onChangeText={text => setEmail(text)} defaultValue={email} - placeholder="email" + placeholder={i18n.t("message.email")} label={i18n.t("message.email")} autoCapitalize='none' autoComplete='email' @@ -61,7 +61,7 @@ let LoginForm = () => { style={styles.input} onChangeText={text => setPassword(text)} defaultValue={password} - placeholder="password" + placeholder={i18n.t("message.password")} textContentType="password" label={i18n.t("message.password")} secureTextEntry={true} @@ -113,4 +113,4 @@ const styles = StyleSheet.create({ marginTop: 10, } -}); \ No newline at end of file +}); diff --git a/components/NewComment.js b/components/NewComment.js index 100249e..1200683 100644 --- a/components/NewComment.js +++ b/components/NewComment.js @@ -4,6 +4,7 @@ import { TextInput, Button } from 'react-native-paper'; import API from './../API.js'; import { useNavigation } from '@react-navigation/native'; import AwesomeIcon from 'react-native-vector-icons/FontAwesome'; +import i18n from "../i18nMessages.js"; let NewComment = ({ postid, newComentAdded }) => { @@ -13,7 +14,7 @@ let NewComment = ({ postid, newComentAdded }) => { return ( { {photo && ( - Uploading... + {i18n.t("message.uploading")} { - Delete + {i18n.t("message.delete")} diff --git a/components/Register.js b/components/Register.js index f3e38f4..5238b22 100644 --- a/components/Register.js +++ b/components/Register.js @@ -57,7 +57,7 @@ let RegisterForm = () => { style={styles.input} onChangeText={text => setPassword(text)} defaultValue={password} - placeholder="password" + placeholder={i18n.t("message.password")} textContentType="password" label={i18n.t("message.password")} secureTextEntry={true} @@ -70,7 +70,7 @@ let RegisterForm = () => { style={styles.input} onChangeText={text => setPassword2(text)} defaultValue={password} - placeholder="same password" + placeholder={i18n.t("message.rpassword")} textContentType="same password" label={i18n.t("message.rpassword")} secureTextEntry={true} @@ -83,7 +83,7 @@ let RegisterForm = () => { style={styles.input} onChangeText={text => setFirstName(text)} defaultValue={firstName} - placeholder="First Name" + placeholder={i18n.t("message.firstName")} label={i18n.t("message.name")} autoCapitalize='words' autoComplete='name' @@ -94,7 +94,7 @@ let RegisterForm = () => { style={styles.input} onChangeText={text => setLastName(text)} defaultValue={lastName} - placeholder="Last Name" + placeholder={i18n.t("message.lastName")} label={i18n.t("message.lastName")} autoCapitalize='words' autoComplete='name' @@ -105,7 +105,7 @@ let RegisterForm = () => { style={styles.input} onChangeText={text => setDescription(text)} defaultValue={description} - placeholder="Description so others can know you" + placeholder={i18n.t("message.describeYourself")} label={i18n.t("message.describeYourself")} autoCapitalize='sentences' autoComplete='description' @@ -121,7 +121,7 @@ let RegisterForm = () => { style={styles.input} onChangeText={text => setEmail(text)} defaultValue={email} - placeholder="email" + placeholder={i18n.t("message.email")} label={i18n.t("message.email")} autoCapitalize='none' autoComplete='email' @@ -162,4 +162,4 @@ const styles = StyleSheet.create({ marginTop: 10, } -}); \ No newline at end of file +}); diff --git a/i18nMessages.js b/i18nMessages.js index a3f623e..10b0eeb 100644 --- a/i18nMessages.js +++ b/i18nMessages.js @@ -79,6 +79,44 @@ const messages = { ocupation: "Ocupation", country: 'Country', clickToSeeAllPhotos: "Click to see all photos", + recentlyFollowing: "Recently Following", + changeActiveProfile: "Change Active Profile", + userActions: "User Actions", + fellowshipApp: "Fellowship App", + appLanguage: "App Language", + language: "Language", + languageSpanish: "Spanish", + languageEnglish: "English", + languageDanish: "Danish", + languageFrench: "French", + version: "Version", + channel: "Channel", + postingOn: "Posting on", + whatIsOnYourMindToday: "What is on your mind today?", + addPhotos: "Add Photos", + cancelUpload: "Cancel Upload", + uploading: "Uploading...", + uploadProgress: "Upload Progress", + newGroup: "New Group", + changeImage: "Change image", + addGroupImage: "Add group image", + groupName: "Group name", + subtitleOptional: "Subtitle (optional)", + requireApprovalBeforeJoin: "Require approval before people can join.", + createGroupAction: "Create Group", + newComment: "New Comment", + currentProfile: "Current Profile", + profileSetting: "Profile Setting", + searchGroups: "Search Groups", + results: "Results:", + yourGroups: "Your Groups:", + images: "Images", + media: "Media", + embedded: "Embedded", + files: "Files", + deleteGroup: "Delete Group", + delete: "Delete", + appName: "EMI Fellowship", }, }, es: { @@ -153,6 +191,44 @@ const messages = { ocupation: 'Ocupación', country: 'País', clickToSeeAllPhotos: "Haz clic para ver todas las fotos", + recentlyFollowing: "Siguiendo recientemente", + changeActiveProfile: "Cambiar perfil activo", + userActions: "Acciones de usuario", + fellowshipApp: "App Fellowship", + appLanguage: "Idioma de la app", + language: "Idioma", + languageSpanish: "Español", + languageEnglish: "Inglés", + languageDanish: "Danés", + languageFrench: "Francés", + version: "Versión", + channel: "Canal", + postingOn: "Publicando en", + whatIsOnYourMindToday: "¿Qué tienes en mente hoy?", + addPhotos: "Agregar fotos", + cancelUpload: "Cancelar carga", + uploading: "Subiendo...", + uploadProgress: "Progreso de carga", + newGroup: "Nuevo grupo", + changeImage: "Cambiar imagen", + addGroupImage: "Agregar imagen del grupo", + groupName: "Nombre del grupo", + subtitleOptional: "Subtítulo (opcional)", + requireApprovalBeforeJoin: "Requiere aprobación antes de que las personas puedan unirse.", + createGroupAction: "Crear grupo", + newComment: "Nuevo comentario", + currentProfile: "Perfil actual", + profileSetting: "Configuración del perfil", + searchGroups: "Buscar grupos", + results: "Resultados:", + yourGroups: "Tus grupos:", + images: "Imágenes", + media: "Multimedia", + embedded: "Integrado", + files: "Archivos", + deleteGroup: "Eliminar grupo", + delete: "Eliminar", + appName: "EMI Fellowship", } }, fr: { @@ -227,6 +303,44 @@ const messages = { ocupation: 'Occupation', country: 'Pays', clickToSeeAllPhotos: "Cliquez pour voir toutes les photos", + recentlyFollowing: "Abonnements récents", + changeActiveProfile: "Changer le profil actif", + userActions: "Actions utilisateur", + fellowshipApp: "Application Fellowship", + appLanguage: "Langue de l'application", + language: "Langue", + languageSpanish: "Espagnol", + languageEnglish: "Anglais", + languageDanish: "Danois", + languageFrench: "Français", + version: "Version", + channel: "Canal", + postingOn: "Publication sur", + whatIsOnYourMindToday: "Qu'avez-vous en tête aujourd'hui ?", + addPhotos: "Ajouter des photos", + cancelUpload: "Annuler le téléversement", + uploading: "Téléversement...", + uploadProgress: "Progression du téléversement", + newGroup: "Nouveau groupe", + changeImage: "Changer l'image", + addGroupImage: "Ajouter l'image du groupe", + groupName: "Nom du groupe", + subtitleOptional: "Sous-titre (facultatif)", + requireApprovalBeforeJoin: "Nécessite une approbation avant que les personnes puissent rejoindre.", + createGroupAction: "Créer le groupe", + newComment: "Nouveau commentaire", + currentProfile: "Profil actuel", + profileSetting: "Paramètres du profil", + searchGroups: "Rechercher des groupes", + results: "Résultats :", + yourGroups: "Vos groupes :", + images: "Images", + media: "Médias", + embedded: "Intégré", + files: "Fichiers", + deleteGroup: "Supprimer le groupe", + delete: "Supprimer", + appName: "EMI Fellowship", } }, da: { @@ -301,6 +415,44 @@ const messages = { ocupation: "Beskæftigelse", country: 'Land', clickToSeeAllPhotos: "Klik for at se alle billeder", + recentlyFollowing: "For nylig fulgt", + changeActiveProfile: "Skift aktiv profil", + userActions: "Brugerhandlinger", + fellowshipApp: "Fellowship App", + appLanguage: "App-sprog", + language: "Sprog", + languageSpanish: "Spansk", + languageEnglish: "Engelsk", + languageDanish: "Dansk", + languageFrench: "Fransk", + version: "Version", + channel: "Kanal", + postingOn: "Udgiver på", + whatIsOnYourMindToday: "Hvad tænker du på i dag?", + addPhotos: "Tilføj billeder", + cancelUpload: "Annuller upload", + uploading: "Uploader...", + uploadProgress: "Uploadforløb", + newGroup: "Ny gruppe", + changeImage: "Skift billede", + addGroupImage: "Tilføj gruppebillede", + groupName: "Gruppenavn", + subtitleOptional: "Undertitel (valgfri)", + requireApprovalBeforeJoin: "Kræver godkendelse før folk kan deltage.", + createGroupAction: "Opret gruppe", + newComment: "Ny kommentar", + currentProfile: "Nuværende profil", + profileSetting: "Profilindstillinger", + searchGroups: "Søg grupper", + results: "Resultater:", + yourGroups: "Dine grupper:", + images: "Billeder", + media: "Medier", + embedded: "Indlejret", + files: "Filer", + deleteGroup: "Slet gruppe", + delete: "Slet", + appName: "EMI Fellowship", } } }