From d2590f4222b47e10efe6dff9740746ca054eeb52 Mon Sep 17 00:00:00 2001 From: Leendert de Borst Date: Fri, 12 Sep 2025 18:02:42 +0200 Subject: [PATCH] Add offline banner translations (#1103) --- apps/mobile-app/components/OfflineBanner.tsx | 10 ++++++---- apps/mobile-app/i18n/locales/en.json | 16 +++++++++++----- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/apps/mobile-app/components/OfflineBanner.tsx b/apps/mobile-app/components/OfflineBanner.tsx index 7dc55c8e0..fe0b2e2ce 100644 --- a/apps/mobile-app/components/OfflineBanner.tsx +++ b/apps/mobile-app/components/OfflineBanner.tsx @@ -3,6 +3,7 @@ import { StyleSheet, View } from 'react-native'; import Toast from 'react-native-toast-message'; import { useColors } from '@/hooks/useColorScheme'; +import { useTranslation } from '@/hooks/useTranslation'; import { useVaultSync } from '@/hooks/useVaultSync'; import { ThemedText } from '@/components/themed/ThemedText'; @@ -17,6 +18,7 @@ import { useAuth } from '@/context/AuthContext'; export function OfflineBanner(): React.ReactNode { const { isOffline } = useAuth(); const colors = useColors(); + const { t } = useTranslation(); const { syncVault } = useVaultSync(); if (!isOffline) { @@ -42,7 +44,7 @@ export function OfflineBanner(): React.ReactNode { onSuccess: () => { Toast.show({ type: 'success', - text1: 'Back online', + text1: t('app.offline.backOnline'), position: 'bottom' }); }, @@ -52,7 +54,7 @@ export function OfflineBanner(): React.ReactNode { onOffline: () => { Toast.show({ type: 'error', - text1: 'Still offline', + text1: t('app.offline.stillOffline'), position: 'bottom' }); }, @@ -63,7 +65,7 @@ export function OfflineBanner(): React.ReactNode { onError: (error: string) => { Toast.show({ type: 'error', - text1: 'Still offline', + text1: t('app.offline.stillOffline'), text2: error, position: 'bottom' }); @@ -99,7 +101,7 @@ export function OfflineBanner(): React.ReactNode { - Offline mode (read-only) + {t('app.offline.banner')}