From 48f5f53f22dcd5c0f09c34eb65b81a85efd73e6d Mon Sep 17 00:00:00 2001 From: balzack Date: Sat, 21 Oct 2023 08:51:59 -0700 Subject: [PATCH] fixed a few translations --- app/mobile/src/constants/Strings.js | 23 ++++++ .../src/session/conversation/Conversation.jsx | 8 +- .../conversation/topicItem/TopicItem.jsx | 81 +------------------ .../topicItem/useTopicItem.hook.js | 6 +- 4 files changed, 32 insertions(+), 86 deletions(-) diff --git a/app/mobile/src/constants/Strings.js b/app/mobile/src/constants/Strings.js index 9dd9f3c6..3224a114 100644 --- a/app/mobile/src/constants/Strings.js +++ b/app/mobile/src/constants/Strings.js @@ -195,6 +195,10 @@ const Strings = [ connect: 'Connect With People', start: 'Start a Conversation', started: 'Get Started', + + deleteMessage: 'Delete Message', + blockMessage: 'Block Message', + reportMessage: 'Report Message', }, { languageCode: 'fr', @@ -386,6 +390,10 @@ const Strings = [ connect: 'Se Connecter Avec d\'Autres', start: 'Créer une Conversation', started: 'Commencer', + + deleteMessage: 'Supprimer le Message', + blockMessage: 'Bloquer le Message', + reportMessage: 'Signaler le Message', }, { languageCode: 'es', @@ -577,6 +585,10 @@ const Strings = [ connect: 'Conéctate Con Gente', start: 'Iniciar una Conversación', started: 'Empezar', + + deleteMessage: 'Borrar Mensaje', + blockMessage: 'Bloquear Mensaje', + reportMessage: 'Reportar Mensaje', }, { languageCode: 'de', @@ -768,6 +780,10 @@ const Strings = [ connect: 'Verbinde dich mit Menschen', start: 'Eine Konversation Beginnen', started: 'Loslegen', + + deleteMessage: 'Nachricht Löschen', + blockMessage: 'Blockieren Sie die Nachricht', + reportMessage: 'Melden Sie die Nachricht', }, { languageCode: 'pt', @@ -944,6 +960,10 @@ const Strings = [ connect: 'Conecte-se Com As Pessoas', start: 'Crie Uma Conversa', started: 'Iniciar', + + deleteMessage: 'Apagar Mensagem', + blockMessage: 'Bloquear Mensagem', + reportMessage: 'Denunciar Mensagem', }, { languageCode: 'ru', @@ -1119,6 +1139,9 @@ const Strings = [ connect: 'Свяжитесь с людьми', start: 'Начните разговор', started: 'Начало' + deleteMessage: 'Удаленное сообщение', + blockMessage: 'Заблокировать сообщение', + reportMessage: 'Пожаловаться на сообщение', } ]; diff --git a/app/mobile/src/session/conversation/Conversation.jsx b/app/mobile/src/session/conversation/Conversation.jsx index 6a329b65..3aa2d3d6 100644 --- a/app/mobile/src/session/conversation/Conversation.jsx +++ b/app/mobile/src/session/conversation/Conversation.jsx @@ -21,8 +21,8 @@ export function Conversation({ navigation, cardId, channelId, closeConversation, catch (err) { console.log(err); Alert.alert( - 'Failed to Load More Messages', - 'Please try again', + state.strings.error, + state.strings.tryAgain, ) } } @@ -35,8 +35,8 @@ export function Conversation({ navigation, cardId, channelId, closeConversation, catch (err) { console.log(err); Alert.alert( - 'Failed to Update Message', - 'Please try again.', + state.strings.error, + state.strings.tryAgain, ) } } diff --git a/app/mobile/src/session/conversation/topicItem/TopicItem.jsx b/app/mobile/src/session/conversation/topicItem/TopicItem.jsx index 9a27cd10..79004b97 100644 --- a/app/mobile/src/session/conversation/topicItem/TopicItem.jsx +++ b/app/mobile/src/session/conversation/topicItem/TopicItem.jsx @@ -21,31 +21,6 @@ import { SafeAreaView, SafeAreaProvider } from 'react-native-safe-area-context'; export function TopicItem({ item, focused, focus, hosting, remove, update, block, report, contentKey }) { const { state, actions } = useTopicItem(item, hosting, remove, contentKey); - const erase = () => { - Alert.alert( - "Removing Message", - "Confirm?", - [ - { text: "Cancel", - onPress: () => {}, - }, - { text: "Remove", - onPress: async () => { - try { - await remove(item.topicId); - } - catch (err) { - console.log(err); - Alert.alert( - 'Failed to Remove Message', - 'Please try again.' - ) - } - }, - } - ] - ); - } const shareMessage = async () => { try { @@ -54,64 +29,12 @@ export function TopicItem({ item, focused, focus, hosting, remove, update, block catch(err) { console.log(err); Alert.alert( - 'Failed to Share Message', - 'Please try again.' + state.strings.error, + state.strings.tryAgain, ) } } - const reportMessage = () => { - Alert.alert( - "Report Message", - "Confirm?", - [ - { text: "Cancel", - onPress: () => {}, - }, - { text: "Report", - onPress: async () => { - try { - await report(item.topicId); - } - catch (err) { - console.log(err); - Alert.alert( - 'Failed to Report Message', - 'Please try again.' - ) - } - }, - } - ] - ); - } - - const hideMessage = () => { - Alert.alert( - "Blocking Message", - "Confirm?", - [ - { text: "Cancel", - onPress: () => {}, - }, - { text: "Block", - onPress: async () => { - try { - await block(item.topicId); - } - catch (err) { - console.log(err); - Alert.alert( - 'Failed to Block Message', - 'Please try again.' - ) - } - }, - } - ] - ); - } - const renderThumb = (thumb) => { return ( diff --git a/app/mobile/src/session/conversation/topicItem/useTopicItem.hook.js b/app/mobile/src/session/conversation/topicItem/useTopicItem.hook.js index cc397105..4f72af04 100644 --- a/app/mobile/src/session/conversation/topicItem/useTopicItem.hook.js +++ b/app/mobile/src/session/conversation/topicItem/useTopicItem.hook.js @@ -431,7 +431,7 @@ export function useTopicItem(item, hosting, remove, contentKey) { }, promptBlock: (block) => { display.actions.showPrompt({ - title: state.strings.blockTopic, + title: state.strings.blockMessage, centerButtons: true, ok: { label: state.strings.confirmBlock, action: async () => await block(item.topicId), failed: () => { Alert.alert( @@ -444,7 +444,7 @@ export function useTopicItem(item, hosting, remove, contentKey) { }, promptReport: (report) => { display.actions.showPrompt({ - title: state.strings.reportTopic, + title: state.strings.reportMessage, centerButtons: true, ok: { label: state.strings.confirmReport, action: async () => await report(item.topicId), failed: () => { Alert.alert( @@ -457,7 +457,7 @@ export function useTopicItem(item, hosting, remove, contentKey) { }, promptRemove: (remove) => { display.actions.showPrompt({ - title: state.strings.deleteTopic, + title: state.strings.deleteMessage, centerButtons: true, ok: { label: state.strings.confirmDelete, action: async () => await remove(item.topicId), failed: () => { Alert.alert(