From d2cec19b43ff3b97fad35137da1a42d5dd94bb5a Mon Sep 17 00:00:00 2001 From: Roland Osborne Date: Tue, 3 Oct 2023 14:22:57 -0700 Subject: [PATCH] translating add topic component --- app/mobile/src/constants/Strings.js | 32 +++++++++++++++++++ .../conversation/addTopic/AddTopic.jsx | 24 +++++++------- .../conversation/addTopic/AddTopic.styled.js | 4 +-- .../conversation/addTopic/useAddTopic.hook.js | 2 ++ 4 files changed, 48 insertions(+), 14 deletions(-) diff --git a/app/mobile/src/constants/Strings.js b/app/mobile/src/constants/Strings.js index 1fa88be4..9422734d 100644 --- a/app/mobile/src/constants/Strings.js +++ b/app/mobile/src/constants/Strings.js @@ -160,6 +160,14 @@ const Strings = [ relayUrl: 'Relay URL', relayUsername: 'Relay Username', relayPassword: 'Relay Password', + + newMessage: 'New Message', + fontSize: 'Font Size', + small: 'Small', + medium: 'Medium', + large: 'Large', + fontColor: 'Font Color', + selectedColor: 'Selected Color', }, { visibleRegistry: 'Visible dans le Registre', @@ -316,6 +324,14 @@ const Strings = [ relayUrl: 'URL de Relais', relayUsername: 'Nom d\'Utilisateur du Relais', relayPassword: 'Mot de Passe du Relais', + + newMessage: 'Nouveau Message', + fontSize: 'Taille du Texte', + small: 'Petit', + medium: 'Moyen', + large: 'Grand', + fontColor: 'Couleur du Texte', + selectedColor: 'Couleur Sélectionnée', }, { visibleRegistry: 'Visible en el Registro', @@ -472,6 +488,14 @@ const Strings = [ relayUrl: 'URL para Llamadas', relayUsername: 'Nombre de Usuario para Llamadas', relayPassword: 'Contraseña para Llamadas', + + newMessage: 'Nuevo Mensaje', + fontSize: 'Tamano del Texto', + small: 'Pequeño', + medium: 'Medio', + large: 'Grande', + fontColor: 'Color de Texto', + selectedColor: 'Color Seleccionado', }, { visibleRegistry: 'Sichtbar in der Registrierung', @@ -628,6 +652,14 @@ const Strings = [ relayUrl: 'URL für Anrufe', relayUsername: 'Benutzername für Anrufe', relayPassword: 'Passwort für Anrufe', + + newMessage: 'Neue Nachricht', + fontSize: 'Textgröße', + small: 'Klein', + medium: 'Mittel', + large: 'Groß', + fontColor: 'Textfarbe', + selectedColor: 'Ausgewählte Farbe', } ]; diff --git a/app/mobile/src/session/conversation/addTopic/AddTopic.jsx b/app/mobile/src/session/conversation/addTopic/AddTopic.jsx index f16ec894..c4eb5ae0 100644 --- a/app/mobile/src/session/conversation/addTopic/AddTopic.jsx +++ b/app/mobile/src/session/conversation/addTopic/AddTopic.jsx @@ -175,7 +175,7 @@ export function AddTopic({ contentKey, shareIntent, setShareIntent }) { + autoCapitalize="sentences" placeholder={state.strings.newMessage} multiline={true} /> { state.enableImage && ( @@ -232,43 +232,43 @@ export function AddTopic({ contentKey, shareIntent, setShareIntent }) { - Font Size: + { state.strings.fontSize } { state.size === 'small' && ( - Small + { state.strings.small } )} { state.size !== 'small' && ( actions.setFontSize('small')}> - Small + { state.strings.small } )} { state.size === 'medium' && ( - Medium + { state.strings.medium } )} { state.size !== 'medium' && ( actions.setFontSize('medium')}> - Medium + { state.strings.medium } )} { state.size === 'large' && ( - Large + { state.strings.large } )} { state.size !== 'large' && ( actions.setFontSize('large')}> - Large + { state.strings.large } )} - Close + { state.strings.close } @@ -286,7 +286,7 @@ export function AddTopic({ contentKey, shareIntent, setShareIntent }) { - Font Color: + { state.strings.fontColor } - Set Color: + { state.strings.selectedColor } - Close + { state.strings.close } diff --git a/app/mobile/src/session/conversation/addTopic/AddTopic.styled.js b/app/mobile/src/session/conversation/addTopic/AddTopic.styled.js index e90c86b0..668d26f0 100644 --- a/app/mobile/src/session/conversation/addTopic/AddTopic.styled.js +++ b/app/mobile/src/session/conversation/addTopic/AddTopic.styled.js @@ -22,8 +22,8 @@ export const styles = StyleSheet.create({ alignItems: 'center', justifyContent: 'center', borderRadius: 4, - marginLeft: 8, - marginRight: 8, + marginLeft: 4, + marginRight: 4, }, input: { marginLeft: 16, diff --git a/app/mobile/src/session/conversation/addTopic/useAddTopic.hook.js b/app/mobile/src/session/conversation/addTopic/useAddTopic.hook.js index 78036689..50bd487f 100644 --- a/app/mobile/src/session/conversation/addTopic/useAddTopic.hook.js +++ b/app/mobile/src/session/conversation/addTopic/useAddTopic.hook.js @@ -7,10 +7,12 @@ import { encryptBlock, decryptBlock, getChannelSeals, getContentKey, encryptTopi import { AccountContext } from 'context/AccountContext'; import RNFS from 'react-native-fs'; import ImageResizer from '@bam.tech/react-native-image-resizer'; +import { getLanguageStrings } from 'constants/Strings'; export function useAddTopic(contentKey) { const [state, setState] = useState({ + strings: getLanguageStrings(), message: null, assets: [], fontSize: false,