Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Localize credential and email tabs (#993)

Leendert de Borst8e89673cc9ed
diff --git a/apps/mobile-app/app/(tabs)/_layout.tsx b/apps/mobile-app/app/(tabs)/_layout.tsx
index 1a477142c..af5464193 100644
--- a/apps/mobile-app/app/(tabs)/_layout.tsx
+++ b/apps/mobile-app/app/(tabs)/_layout.tsx
@@ -1,6 +1,7 @@
import { Tabs, router } from 'expo-router';
import React, { useEffect } from 'react';
import { Platform, StyleSheet, View } from 'react-native';
+import { useTranslation } from 'react-i18next';
import emitter from '@/utils/EventEmitter';
@@ -20,6 +21,7 @@ export default function TabLayout() : React.ReactNode {
const colors = useColors();
const authContext = useAuth();
const dbContext = useDb();
+ const { t } = useTranslation();
// Check if user is authenticated and database is available
const isFullyInitialized = authContext.isInitialized && dbContext.dbInitialized;
@@ -95,7 +97,7 @@ export default function TabLayout() : React.ReactNode {
<Tabs.Screen
name="credentials"
options={{
- title: 'Credentials',
+ title: t('navigation.credentials'),
/**
* Icon for the credentials tab.
*/
@@ -105,7 +107,7 @@ export default function TabLayout() : React.ReactNode {
<Tabs.Screen
name="emails"
options={{
- title: 'Emails',
+ title: t('navigation.emails'),
/**
* Icon for the emails tab.
*/
@@ -115,7 +117,7 @@ export default function TabLayout() : React.ReactNode {
<Tabs.Screen
name="settings"
options={{
- title: 'Settings',
+ title: t('navigation.settings'),
/**
* Icon for the settings tab.
*/
diff --git a/apps/mobile-app/app/(tabs)/credentials/add-edit.tsx b/apps/mobile-app/app/(tabs)/credentials/add-edit.tsx
index 83fa0d2ef..b0ab34e70 100644
--- a/apps/mobile-app/app/(tabs)/credentials/add-edit.tsx
+++ b/apps/mobile-app/app/(tabs)/credentials/add-edit.tsx
@@ -7,6 +7,7 @@ import { Resolver, useForm } from 'react-hook-form';
import { StyleSheet, View, TouchableOpacity, Alert, Keyboard, KeyboardAvoidingView, Platform, Pressable } from 'react-native';
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
import Toast from 'react-native-toast-message';
+import { useTranslation } from 'react-i18next';
import { CreateIdentityGenerator, IdentityHelperUtils, IdentityGenerator } from '@/utils/dist/shared/identity-generator';
import type { Credential } from '@/utils/dist/shared/models/vault';
@@ -47,6 +48,7 @@ export default function AddEditCredentialScreen() : React.ReactNode {
const serviceNameRef = useRef<ValidatedFormFieldRef>(null);
const [isSyncing, setIsSyncing] = useState(false);
const [isSaveDisabled, setIsSaveDisabled] = useState(false);
+ const { t } = useTranslation();
const { control, handleSubmit, setValue, watch } = useForm<Credential>({
resolver: yupResolver(credentialSchema) as Resolver<Credential>,
@@ -92,8 +94,8 @@ export default function AddEditCredentialScreen() : React.ReactNode {
console.error('Error loading credential:', err);
Toast.show({
type: 'error',
- text1: 'Failed to load credential',
- text2: 'Please try again'
+ text1: t('credentials.errors.loadFailed'),
+ text2: t('auth.errors.enterPassword')
});
}
}, [id, dbContext.sqliteClient, setValue]);
@@ -108,7 +110,7 @@ export default function AddEditCredentialScreen() : React.ReactNode {
setTimeout(() => {
Toast.show({
type: 'error',
- text1: 'You are offline and in read-only mode. Please connect to the internet to add or edit a credential.',
+ text1: t('credentials.offlineMessage'),
position: 'bottom'
});
}, 100);
@@ -306,7 +308,7 @@ export default function AddEditCredentialScreen() : React.ReactNode {
setTimeout(() => {
Toast.show({
type: 'success',
- text1: isEditMode ? 'Credential updated successfully' : 'Credential created successfully',
+ text1: isEditMode ? t('credentials.toasts.credentialUpdated') : t('credentials.toasts.credentialCreated'),
position: 'bottom'
});
}, 200);
@@ -334,8 +336,8 @@ export default function AddEditCredentialScreen() : React.ReactNode {
console.error('Error generating random username:', error);
Toast.show({
type: 'error',
- text1: 'Failed to generate username',
- text2: 'Please try again'
+ text1: t('credentials.errors.generateUsernameFailed'),
+ text2: t('auth.errors.enterPassword')
});
}
};
@@ -353,8 +355,8 @@ export default function AddEditCredentialScreen() : React.ReactNode {
console.error('Error generating random password:', error);
Toast.show({
type: 'error',
- text1: 'Failed to generate password',
- text2: 'Please try again'
+ text1: t('credentials.errors.generatePasswordFailed'),
+ text2: t('auth.errors.enterPassword')
});
}
};
@@ -370,15 +372,15 @@ export default function AddEditCredentialScreen() : React.ReactNode {
Keyboard.dismiss();
Alert.alert(
- "Delete Credential",
- "Are you sure you want to delete this credential? This action cannot be undone.",
+ t('credentials.deleteCredential'),
+ t('credentials.deleteConfirm'),
[
{
- text: "Cancel",
+ text: t('common.cancel'),
style: "cancel"
},
{
- text: "Delete",
+ text: t('common.delete'),
style: "destructive",
/**
* Delete the credential.
@@ -394,7 +396,7 @@ export default function AddEditCredentialScreen() : React.ReactNode {
setTimeout(() => {
Toast.show({
type: 'success',
- text1: 'Credential deleted successfully',
+ text1: t('credentials.toasts.credentialDeleted'),
position: 'bottom'
});
}, 200);
@@ -518,7 +520,7 @@ export default function AddEditCredentialScreen() : React.ReactNode {
onPress={() => router.back()}
style={styles.headerLeftButton}
>
- <ThemedText style={styles.headerLeftButtonText}>Cancel</ThemedText>
+ <ThemedText style={styles.headerLeftButtonText}>{t('common.cancel')}</ThemedText>
</TouchableOpacity>
),
/**
@@ -557,7 +559,7 @@ export default function AddEditCredentialScreen() : React.ReactNode {
return (
<>
- <Stack.Screen options={{ title: isEditMode ? 'Edit Credential' : 'Add Credential' }} />
+ <Stack.Screen options={{ title: isEditMode ? t('credentials.editCredential') : t('credentials.addCredential') }} />
{(isSyncing) && (
<LoadingOverlay status={syncStatus} />
)}
@@ -584,7 +586,7 @@ export default function AddEditCredentialScreen() : React.ReactNode {
color={mode === 'random' ? colors.primarySurfaceText : colors.text}
/>
<ThemedText style={[styles.modeButtonText, mode === 'random' && styles.modeButtonTextActive]}>
- Random Alias
+ {t('credentials.randomAlias')}
</ThemedText>
</TouchableOpacity>
<TouchableOpacity
@@ -597,36 +599,36 @@ export default function AddEditCredentialScreen() : React.ReactNode {
color={mode === 'manual' ? colors.primarySurfaceText : colors.text}
/>
<ThemedText style={[styles.modeButtonText, mode === 'manual' && styles.modeButtonTextActive]}>
- Manual
+ {t('credentials.manual')}
</ThemedText>
</TouchableOpacity>
</View>
)}
<View style={styles.section}>
- <ThemedText style={styles.sectionTitle}>Service</ThemedText>
+ <ThemedText style={styles.sectionTitle}>{t('credentials.service')}</ThemedText>
<ValidatedFormField
ref={serviceNameRef}
control={control}
name="ServiceName"
- label="Service Name"
+ label={t('credentials.serviceName')}
required
/>
<ValidatedFormField
control={control}
name="ServiceUrl"
- label="Service URL"
+ label={t('credentials.serviceUrl')}
/>
</View>
{(mode === 'manual' || isEditMode) && (
<>
<View style={styles.section}>
- <ThemedText style={styles.sectionTitle}>Login credentials</ThemedText>
+ <ThemedText style={styles.sectionTitle}>{t('credentials.loginCredentials')}</ThemedText>
<ValidatedFormField
control={control}
name="Username"
- label="Username"
+ label={t('credentials.username')}
buttons={[
{
icon: "refresh",
@@ -637,7 +639,7 @@ export default function AddEditCredentialScreen() : React.ReactNode {
<ValidatedFormField
control={control}
name="Password"
- label="Password"
+ label={t('credentials.password')}
secureTextEntry={!isPasswordVisible}
buttons={[
{
@@ -655,52 +657,52 @@ export default function AddEditCredentialScreen() : React.ReactNode {
/>
<TouchableOpacity style={styles.generateButton} onPress={handleGenerateRandomAlias}>
<MaterialIcons name="auto-fix-high" size={20} color="#fff" />
- <ThemedText style={styles.generateButtonText}>Generate Random Alias</ThemedText>
+ <ThemedText style={styles.generateButtonText}>{t('credentials.generateRandomAlias')}</ThemedText>
</TouchableOpacity>
<ValidatedFormField
control={control}
name="Alias.Email"
- label="Email"
+ label={t('credentials.email')}
/>
</View>
<View style={styles.section}>
- <ThemedText style={styles.sectionTitle}>Alias</ThemedText>
+ <ThemedText style={styles.sectionTitle}>{t('credentials.alias')}</ThemedText>
<ValidatedFormField
control={control}
name="Alias.FirstName"
- label="First Name"
+ label={t('credentials.firstName')}
/>
<ValidatedFormField
control={control}
name="Alias.LastName"
- label="Last Name"
+ label={t('credentials.lastName')}
/>
<ValidatedFormField
control={control}
name="Alias.NickName"
- label="Nick Name"
+ label={t('credentials.nickName')}
/>
<ValidatedFormField
control={control}
name="Alias.Gender"
- label="Gender"
+ label={t('credentials.gender')}
/>
<ValidatedFormField
control={control}
name="Alias.BirthDate"
- label="Birth Date"
- placeholder="YYYY-MM-DD"
+ label={t('credentials.birthDate')}
+ placeholder={t('credentials.birthDatePlaceholder')}
/>
</View>
<View style={styles.section}>
- <ThemedText style={styles.sectionTitle}>Metadata</ThemedText>
+ <ThemedText style={styles.sectionTitle}>{t('credentials.metadata')}</ThemedText>
<ValidatedFormField
control={control}
name="Notes"
- label="Notes"
+ label={t('credentials.notes')}
multiline={true}
numberOfLines={4}
textAlignVertical="top"
@@ -713,7 +715,7 @@ export default function AddEditCredentialScreen() : React.ReactNode {
style={styles.deleteButton}
onPress={handleDelete}
>
- <ThemedText style={styles.deleteButtonText}>Delete Credential</ThemedText>
+ <ThemedText style={styles.deleteButtonText}>{t('credentials.deleteCredential')}</ThemedText>
</TouchableOpacity>
)}
</>
diff --git a/apps/mobile-app/app/(tabs)/credentials/autofill-credential-created.tsx b/apps/mobile-app/app/(tabs)/credentials/autofill-credential-created.tsx
index aec667d91..59976a2ff 100644
--- a/apps/mobile-app/app/(tabs)/credentials/autofill-credential-created.tsx
+++ b/apps/mobile-app/app/(tabs)/credentials/autofill-credential-created.tsx
@@ -2,6 +2,7 @@ import MaterialIcons from '@expo/vector-icons/MaterialIcons';
import { useNavigation, useRouter } from 'expo-router';
import { useCallback, useEffect } from 'react';
import { StyleSheet, View, TouchableOpacity, AppState } from 'react-native';
+import { useTranslation } from 'react-i18next';
import { useColors } from '@/hooks/useColorScheme';
@@ -16,6 +17,7 @@ export default function AutofillCredentialCreatedScreen() : React.ReactNode {
const router = useRouter();
const colors = useColors();
const navigation = useNavigation();
+ const { t } = useTranslation();
/**
* Handle the stay in app button press.
@@ -83,7 +85,7 @@ export default function AutofillCredentialCreatedScreen() : React.ReactNode {
onPress={handleStayInApp}
style={styles.headerRightButton}
>
- <ThemedText style={{ color: colors.primary }}>Dismiss</ThemedText>
+ <ThemedText style={{ color: colors.primary }}>{t('common.cancel')}</ThemedText>
</TouchableOpacity>
),
});
@@ -100,13 +102,13 @@ export default function AutofillCredentialCreatedScreen() : React.ReactNode {
/>
</View>
- <ThemedText style={styles.title}>Credential Created!</ThemedText>
+ <ThemedText style={styles.title}>{t('credentials.credentialCreated')}</ThemedText>
<ThemedText style={styles.message}>
- Your new credential has been added to your vault and is now available for password autofill.
+ {t('credentials.credentialCreatedMessage')}
</ThemedText>
<ThemedText style={[styles.message, styles.boldMessage]}>
- Switch back to your browser to continue.
+ {t('credentials.switchBackToBrowser')}
</ThemedText>
</ThemedView>
</ThemedSafeAreaView>
diff --git a/apps/mobile-app/app/(tabs)/credentials/index.tsx b/apps/mobile-app/app/(tabs)/credentials/index.tsx
index d3bbf338c..a0e0b0514 100644
--- a/apps/mobile-app/app/(tabs)/credentials/index.tsx
+++ b/apps/mobile-app/app/(tabs)/credentials/index.tsx
@@ -6,6 +6,7 @@ import { useState, useEffect, useCallback, useRef } from 'react';
import { StyleSheet, Text, FlatList, TouchableOpacity, TextInput, RefreshControl, Platform, Animated, Alert } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import Toast from 'react-native-toast-message';
+import { useTranslation } from 'react-i18next';
import type { Credential } from '@/utils/dist/shared/models/vault';
import emitter from '@/utils/EventEmitter';
@@ -37,6 +38,7 @@ export default function CredentialsScreen() : React.ReactNode {
const { syncVault } = useVaultSync();
const webApi = useWebApi();
const colors = useColors();
+ const { t } = useTranslation();
const flatListRef = useRef<FlatList>(null);
const scrollY = useRef(new Animated.Value(0)).current;
const navigation = useNavigation();
@@ -69,7 +71,7 @@ export default function CredentialsScreen() : React.ReactNode {
// Error loading credentials, show error toast
Toast.show({
type: 'error',
- text1: 'Error loading credentials',
+ text1: t('credentials.errorLoadingCredentials'),
text2: err instanceof Error ? err.message : 'Unknown error',
});
setIsLoadingCredentials(false);
@@ -140,7 +142,7 @@ export default function CredentialsScreen() : React.ReactNode {
setTimeout(() => {
Toast.show({
type: 'success',
- text1: hasNewVault ? 'Vault synced successfully' : 'Vault is up-to-date',
+ text1: hasNewVault ? t('credentials.vaultSyncedSuccessfully') : t('credentials.vaultUpToDate'),
position: 'top',
visibilityTime: 1200,
});
@@ -156,7 +158,7 @@ export default function CredentialsScreen() : React.ReactNode {
setTimeout(() => {
Toast.show({
type: 'error',
- text1: 'You are offline. Please connect to the internet to sync your vault.',
+ text1: t('credentials.offlineMessage'),
position: 'bottom',
});
}, 200);
@@ -188,7 +190,7 @@ export default function CredentialsScreen() : React.ReactNode {
setIsLoadingCredentials(false);
Toast.show({
type: 'error',
- text1: 'Vault sync failed',
+ text1: t('credentials.vaultSyncFailed'),
text2: err instanceof Error ? err.message : 'Unknown error',
});
}
@@ -297,7 +299,7 @@ export default function CredentialsScreen() : React.ReactNode {
* Define custom header which is shown on Android. iOS displays the custom CollapsibleHeader component instead.
* @returns
*/
- headerTitle: (): React.ReactNode => Platform.OS === 'android' ? <AndroidHeader title="Credentials" /> : <Text>Credentials</Text>,
+ headerTitle: (): React.ReactNode => Platform.OS === 'android' ? <AndroidHeader title={t('credentials.title')} /> : <Text>{t('credentials.title')}</Text>,
});
}, [navigation]);
@@ -332,7 +334,7 @@ export default function CredentialsScreen() : React.ReactNode {
<LoadingOverlay status={syncStatus} />
)}
<CollapsibleHeader
- title="Credentials"
+ title={t('credentials.title')}
scrollY={scrollY}
showNavigationHeader={true}
alwaysVisible={true}
@@ -366,7 +368,7 @@ export default function CredentialsScreen() : React.ReactNode {
removeClippedSubviews={false}
ListHeaderComponent={
<ThemedView>
- <TitleContainer title="Credentials" />
+ <TitleContainer title={t('credentials.title')} />
{serviceUrl && (
<ServiceUrlNotice
serviceUrl={serviceUrl}
@@ -382,7 +384,7 @@ export default function CredentialsScreen() : React.ReactNode {
/>
<TextInput
style={styles.searchInput}
- placeholder="Search credentials..."
+ placeholder={t('credentials.searchPlaceholder')}
placeholderTextColor={colors.textMuted}
value={searchQuery}
autoCorrect={false}
@@ -419,13 +421,13 @@ export default function CredentialsScreen() : React.ReactNode {
ListEmptyComponent={
!isLoadingCredentials ? (
<Text style={styles.emptyText}>
- {searchQuery ? 'No matching credentials found' : 'No credentials found. Create one to get started. Tip: you can also login to the AliasVault web app to import credentials from other password managers.'}
+ {searchQuery ? t('credentials.noMatchingCredentials') : t('credentials.noCredentialsFound')}
</Text>
) : null
}
/>
</ThemedView>
- {isLoading && <LoadingOverlay status={syncStatus || 'Deleting credential...'} />}
+ {isLoading && <LoadingOverlay status={syncStatus || t('credentials.deletingCredential')} />}
</ThemedContainer>
);
}
\ No newline at end of file
diff --git a/apps/mobile-app/app/(tabs)/emails/[id].tsx b/apps/mobile-app/app/(tabs)/emails/[id].tsx
index cd8aba63f..907b937d1 100644
--- a/apps/mobile-app/app/(tabs)/emails/[id].tsx
+++ b/apps/mobile-app/app/(tabs)/emails/[id].tsx
@@ -4,6 +4,7 @@ import { useLocalSearchParams, useRouter, useNavigation, Stack } from 'expo-rout
import React, { useEffect, useState, useCallback } from 'react';
import { StyleSheet, View, TouchableOpacity, ActivityIndicator, Alert, Share, useColorScheme, TextInput, Linking } from 'react-native';
import { WebView } from 'react-native-webview';
+import { useTranslation } from 'react-i18next';
import type { Credential } from '@/utils/dist/shared/models/vault';
import type { Email } from '@/utils/dist/shared/models/webapi';
@@ -29,6 +30,7 @@ export default function EmailDetailsScreen() : React.ReactNode {
const dbContext = useDb();
const webApi = useWebApi();
const colors = useColors();
+ const { t } = useTranslation();
const [error, setError] = useState<string | null>(null);
const [email, setEmail] = useState<Email | null>(null);
const [isLoading, setIsLoading] = useState(true);
@@ -70,7 +72,7 @@ export default function EmailDetailsScreen() : React.ReactNode {
setHtmlView(false);
}
} catch (err) {
- setError(err instanceof Error ? err.message : 'An error occurred');
+ setError(err instanceof Error ? err.message : t('emails.errors.generic'));
} finally {
setIsLoading(false);
}
@@ -85,15 +87,15 @@ export default function EmailDetailsScreen() : React.ReactNode {
*/
const handleDelete = useCallback(async () : Promise<void> => {
Alert.alert(
- 'Delete Email',
- 'Are you sure you want to delete this email? This action is permanent and cannot be undone.',
+ t('emails.deleteEmail'),
+ t('emails.deleteEmailConfirm'),
[
{
- text: 'Cancel',
+ text: t('common.cancel'),
style: 'cancel',
},
{
- text: 'Delete',
+ text: t('common.delete'),
style: 'destructive',
/**
* Handle the delete button press.
@@ -109,7 +111,7 @@ export default function EmailDetailsScreen() : React.ReactNode {
// Go back to the emails list screen.
router.back();
} catch (err) {
- setError(err instanceof Error ? err.message : 'Failed to delete email');
+ setError(err instanceof Error ? err.message : t('emails.errors.deleteFailed'));
}
},
},
@@ -127,7 +129,7 @@ export default function EmailDetailsScreen() : React.ReactNode {
);
if (!dbContext?.sqliteClient || !email) {
- setError('Database context or email not available');
+ setError(t('emails.errors.dbNotAvailable'));
return;
}
@@ -139,7 +141,7 @@ export default function EmailDetailsScreen() : React.ReactNode {
);
if (!decryptedBytes) {
- setError('Failed to decrypt attachment');
+ setError(t('emails.errors.decryptFailed'));
return;
}
@@ -158,7 +160,7 @@ export default function EmailDetailsScreen() : React.ReactNode {
await FileSystem.deleteAsync(tempFile);
} catch (err) {
console.error('handleDownloadAttachment error', err);
- setError(err instanceof Error ? err.message : 'Failed to download attachment');
+ setError(err instanceof Error ? err.message : t('emails.errors.downloadFailed'));
}
};
@@ -341,7 +343,7 @@ export default function EmailDetailsScreen() : React.ReactNode {
if (isLoading) {
return (
<ThemedView style={styles.centerContainer}>
- <Stack.Screen options={{ title: 'Email Details' }} />
+ <Stack.Screen options={{ title: t('emails.title') }} />
<ActivityIndicator size="large" />
</ThemedView>
);
@@ -350,7 +352,7 @@ export default function EmailDetailsScreen() : React.ReactNode {
if (error) {
return (
<ThemedView style={styles.centerContainer}>
- <ThemedText style={styles.errorText}>Error: {error}</ThemedText>
+ <ThemedText style={styles.errorText}>{t('common.error')}: {error}</ThemedText>
</ThemedView>
);
}
@@ -358,7 +360,7 @@ export default function EmailDetailsScreen() : React.ReactNode {
if (!email) {
return (
<ThemedView style={styles.centerContainer}>
- <ThemedText style={styles.emptyText}>Email not found</ThemedText>
+ <ThemedText style={styles.emptyText}>{t('emails.emailNotFound')}</ThemedText>
</ThemedView>
);
}
@@ -383,7 +385,7 @@ export default function EmailDetailsScreen() : React.ReactNode {
<View style={styles.metadataContainer}>
<View style={styles.metadataRow}>
<View style={styles.metadataLabel}>
- <ThemedText style={styles.metadataHeading}>Subject:</ThemedText>
+ <ThemedText style={styles.metadataHeading}>{t('emails.subject')}</ThemedText>
</View>
<View style={styles.metadataValue}>
<ThemedText style={styles.metadataText}>{email.subject}</ThemedText>
@@ -406,7 +408,7 @@ export default function EmailDetailsScreen() : React.ReactNode {
<View style={styles.metadataRow}>
<View style={styles.metadataLabel}>
- <ThemedText style={styles.metadataHeading}>Date:</ThemedText>
+ <ThemedText style={styles.metadataHeading}>{t('emails.date')}</ThemedText>
</View>
<View style={styles.metadataValue}>
<ThemedText style={styles.metadataText}>
@@ -418,7 +420,7 @@ export default function EmailDetailsScreen() : React.ReactNode {
<View style={styles.metadataRow}>
<View style={styles.metadataLabel}>
- <ThemedText style={styles.metadataHeading}>From:</ThemedText>
+ <ThemedText style={styles.metadataHeading}>{t('emails.from')}</ThemedText>
</View>
<View style={styles.metadataValue}>
<ThemedText style={styles.metadataText}>
@@ -430,7 +432,7 @@ export default function EmailDetailsScreen() : React.ReactNode {
<View style={styles.metadataRow}>
<View style={styles.metadataLabel}>
- <ThemedText style={styles.metadataHeading}>To:</ThemedText>
+ <ThemedText style={styles.metadataHeading}>{t('emails.to')}</ThemedText>
</View>
<View style={styles.metadataValue}>
<ThemedText style={styles.metadataText}>
@@ -463,7 +465,7 @@ export default function EmailDetailsScreen() : React.ReactNode {
emailView = (
<TextInput
style={[styles.plainText, isDarkMode ? styles.textDark : styles.textLight]}
- value={email.messagePlain || 'This email does not contain any plain-text.'}
+ value={email.messagePlain || t('emails.noPlainText')}
editable={false}
multiline
/>
@@ -472,12 +474,12 @@ export default function EmailDetailsScreen() : React.ReactNode {
return (
<ThemedView style={styles.container}>
- <Stack.Screen options={{ title: 'Email Details' }} />
+ <Stack.Screen options={{ title: t('emails.title') }} />
{metadataView}
{emailView}
{email.attachments && email.attachments.length > 0 && (
<View style={styles.attachments}>
- <ThemedText style={styles.attachmentsTitle}>Attachments</ThemedText>
+ <ThemedText style={styles.attachmentsTitle}>{t('emails.attachments')}</ThemedText>
{email.attachments.map((attachment) => (
<TouchableOpacity
key={attachment.id}
@@ -486,7 +488,7 @@ export default function EmailDetailsScreen() : React.ReactNode {
>
<Ionicons name="attach" size={20} color="#666" />
<ThemedText style={styles.attachmentName}>
- {attachment.filename} ({Math.ceil(attachment.filesize / 1024)} KB)
+ {attachment.filename} ({Math.ceil(attachment.filesize / 1024)} {t('emails.sizeKB')})
</ThemedText>
</TouchableOpacity>
))}
diff --git a/apps/mobile-app/app/_layout.tsx b/apps/mobile-app/app/_layout.tsx
index e835bd9d8..2a6adf20e 100644
--- a/apps/mobile-app/app/_layout.tsx
+++ b/apps/mobile-app/app/_layout.tsx
@@ -41,17 +41,18 @@ function RootLayoutNav() : React.ReactNode {
const hasBooted = useRef(false);
useEffect(() => {
- if (hasBooted.current) {
- return;
- }
+ const initializeApp = async () => {
+ if (hasBooted.current) {
+ return;
+ }
- // Install the react-native-quick-crypto library which is used by the EncryptionUtility
- install();
+ // Install the react-native-quick-crypto library which is used by the EncryptionUtility
+ install();
- // Initialize i18n
- initI18n();
+ // Initialize i18n and wait for it to be ready
+ await initI18n();
- hasBooted.current = true;
+ hasBooted.current = true;
/**
* Handle vault unlocking process.
@@ -183,7 +184,10 @@ function RootLayoutNav() : React.ReactNode {
});
};
- initialize();
+ initialize();
+ };
+
+ initializeApp();
}, [dbContext, syncVault, initializeAuth, webApi]);
useEffect(() => {
diff --git a/apps/mobile-app/components/credentials/details/AliasDetails.tsx b/apps/mobile-app/components/credentials/details/AliasDetails.tsx
index 3e67b5ad4..94dd9e09e 100644
--- a/apps/mobile-app/components/credentials/details/AliasDetails.tsx
+++ b/apps/mobile-app/components/credentials/details/AliasDetails.tsx
@@ -1,5 +1,6 @@
import { IdentityHelperUtils } from '@/utils/dist/shared/identity-generator';
import type { Credential } from '@/utils/dist/shared/models/vault';
+import { useTranslation } from 'react-i18next';
import FormInputCopyToClipboard from '@/components/form/FormInputCopyToClipboard';
import { ThemedText } from '@/components/themed/ThemedText';
@@ -13,6 +14,7 @@ type AliasDetailsProps = {
* Alias details component.
*/
export const AliasDetails: React.FC<AliasDetailsProps> = ({ credential }) : React.ReactNode => {
+ const { t } = useTranslation();
const hasName = Boolean(credential.Alias?.FirstName?.trim() ?? credential.Alias?.LastName?.trim());
const fullName = [credential.Alias?.FirstName, credential.Alias?.LastName].filter(Boolean).join(' ');
@@ -22,34 +24,34 @@ export const AliasDetails: React.FC<AliasDetailsProps> = ({ credential }) : Reac
return (
<ThemedView style={styles.section}>
- <ThemedText type="subtitle">Alias</ThemedText>
+ <ThemedText type="subtitle">{t('credentials.alias')}</ThemedText>
{hasName && (
<FormInputCopyToClipboard
- label="Full Name"
+ label={t('credentials.fullName')}
value={fullName}
/>
)}
{credential.Alias?.FirstName && (
<FormInputCopyToClipboard
- label="First Name"
+ label={t('credentials.firstName')}
value={credential.Alias.FirstName}
/>
)}
{credential.Alias?.LastName && (
<FormInputCopyToClipboard
- label="Last Name"
+ label={t('credentials.lastName')}
value={credential.Alias.LastName}
/>
)}
{credential.Alias?.NickName && (
<FormInputCopyToClipboard
- label="Nickname"
+ label={t('credentials.nickName')}
value={credential.Alias.NickName}
/>
)}
{IdentityHelperUtils.isValidBirthDate(credential.Alias?.BirthDate) && (
<FormInputCopyToClipboard
- label="Birth Date"
+ label={t('credentials.birthDate')}
value={IdentityHelperUtils.normalizeBirthDateForDisplay(credential.Alias.BirthDate)}
/>
)}
diff --git a/apps/mobile-app/components/credentials/details/EmailPreview.tsx b/apps/mobile-app/components/credentials/details/EmailPreview.tsx
index fc977b7fd..8d88aa7c8 100644
--- a/apps/mobile-app/components/credentials/details/EmailPreview.tsx
+++ b/apps/mobile-app/components/credentials/details/EmailPreview.tsx
@@ -2,6 +2,7 @@ import { useFocusEffect } from '@react-navigation/native';
import { router } from 'expo-router';
import React, { useState, useEffect, useCallback } from 'react';
import { View, StyleSheet, TouchableOpacity, Linking, AppState } from 'react-native';
+import { useTranslation } from 'react-i18next';
import { AppInfo } from '@/utils/AppInfo';
import type { ApiErrorResponse, MailboxEmail } from '@/utils/dist/shared/models/webapi';
@@ -35,6 +36,7 @@ export const EmailPreview: React.FC<EmailPreviewProps> = ({ email }) : React.Rea
const dbContext = useDb();
const authContext = useAuth();
const colors = useColors();
+ const { t } = useTranslation();
/**
* Check if the email is a public domain.
@@ -121,7 +123,7 @@ export const EmailPreview: React.FC<EmailPreviewProps> = ({ email }) : React.Rea
});
if (!response.ok) {
- setError('An error occurred while loading emails. Please try again later.');
+ setError(t('credentials.emailLoadError'));
return;
}
@@ -179,16 +181,16 @@ export const EmailPreview: React.FC<EmailPreviewProps> = ({ email }) : React.Rea
const apiErrorResponse = response as ApiErrorResponse;
if (apiErrorResponse?.code === 'CLAIM_DOES_NOT_MATCH_USER') {
- setError('The current chosen email address is already in use. Please change the email address by editing this credential.');
+ setError(t('credentials.emailClaimError'));
} else if (apiErrorResponse?.code === 'CLAIM_DOES_NOT_EXIST') {
- setError('An error occurred while trying to load the emails. Please try to edit and save the credential entry to synchronize the database, then try again.');
+ setError(t('credentials.emailSyncError'));
} else {
- setError('An error occurred while loading emails. Please try again later.');
+ setError(t('credentials.emailLoadError'));
}
return;
}
} catch {
- setError('An error occurred while loading emails. Please try again later.');
+ setError(t('credentials.emailLoadError'));
return;
} finally {
setLoading(false);
@@ -196,7 +198,7 @@ export const EmailPreview: React.FC<EmailPreviewProps> = ({ email }) : React.Rea
}
} catch (err) {
console.error('Error loading emails:', err);
- setError('An unexpected error occurred while loading emails. Please try again later.');
+ setError(t('credentials.emailUnexpectedError'));
}
};
@@ -275,7 +277,7 @@ export const EmailPreview: React.FC<EmailPreviewProps> = ({ email }) : React.Rea
return (
<ThemedView style={styles.section}>
<View style={styles.titleContainer}>
- <ThemedText type="title" style={styles.title}>Recent emails</ThemedText>
+ <ThemedText type="title" style={styles.title}>{t('credentials.recentEmails')}</ThemedText>
</View>
<View style={styles.errorContainer}>
<ThemedText style={styles.errorText}>{error}</ThemedText>
@@ -288,10 +290,10 @@ export const EmailPreview: React.FC<EmailPreviewProps> = ({ email }) : React.Rea
return (
<ThemedView style={styles.section}>
<View style={styles.titleContainer}>
- <ThemedText type="title" style={styles.title}>Recent emails</ThemedText>
+ <ThemedText type="title" style={styles.title}>{t('credentials.recentEmails')}</ThemedText>
<PulseDot />
</View>
- <ThemedText style={styles.placeholderText}>Loading emails...</ThemedText>
+ <ThemedText style={styles.placeholderText}>{t('credentials.loadingEmails')}</ThemedText>
</ThemedView>
);
}
@@ -300,9 +302,9 @@ export const EmailPreview: React.FC<EmailPreviewProps> = ({ email }) : React.Rea
return (
<ThemedView style={styles.section}>
<View style={styles.titleContainer}>
- <ThemedText type="title" style={styles.title}>Recent emails</ThemedText>
+ <ThemedText type="title" style={styles.title}>{t('credentials.recentEmails')}</ThemedText>
</View>
- <ThemedText style={styles.placeholderText}>You are offline. Please connect to the internet to load your emails.</ThemedText>
+ <ThemedText style={styles.placeholderText}>{t('credentials.offlineEmailsMessage')}</ThemedText>
</ThemedView>
);
}
@@ -311,10 +313,10 @@ export const EmailPreview: React.FC<EmailPreviewProps> = ({ email }) : React.Rea
return (
<ThemedView style={styles.section}>
<View style={styles.titleContainer}>
- <ThemedText type="title" style={styles.title}>Recent emails</ThemedText>
+ <ThemedText type="title" style={styles.title}>{t('credentials.recentEmails')}</ThemedText>
<PulseDot />
</View>
- <ThemedText style={styles.placeholderText}>No emails received yet.</ThemedText>
+ <ThemedText style={styles.placeholderText}>{t('credentials.noEmailsYet')}</ThemedText>
</ThemedView>
);
}
diff --git a/apps/mobile-app/components/credentials/details/LoginCredentials.tsx b/apps/mobile-app/components/credentials/details/LoginCredentials.tsx
index 13e45ce5f..029005eee 100644
--- a/apps/mobile-app/components/credentials/details/LoginCredentials.tsx
+++ b/apps/mobile-app/components/credentials/details/LoginCredentials.tsx
@@ -1,4 +1,5 @@
import type { Credential } from '@/utils/dist/shared/models/vault';
+import { useTranslation } from 'react-i18next';
import FormInputCopyToClipboard from '@/components/form/FormInputCopyToClipboard';
import { ThemedText } from '@/components/themed/ThemedText';
@@ -12,6 +13,7 @@ type LoginCredentialsProps = {
* Login credentials component.
*/
export const LoginCredentials: React.FC<LoginCredentialsProps> = ({ credential }) : React.ReactNode => {
+ const { t } = useTranslation();
const email = credential.Alias?.Email?.trim();
const username = credential.Username?.trim();
const password = credential.Password?.trim();
@@ -25,22 +27,22 @@ export const LoginCredentials: React.FC<LoginCredentialsProps> = ({ credential }
return (
<ThemedView style={styles.section}>
- <ThemedText type="subtitle">Login credentials</ThemedText>
+ <ThemedText type="subtitle">{t('credentials.loginCredentials')}</ThemedText>
{email && (
<FormInputCopyToClipboard
- label="Email"
+ label={t('credentials.email')}
value={email}
/>
)}
{username && (
<FormInputCopyToClipboard
- label="Username"
+ label={t('credentials.username')}
value={username}
/>
)}
{password && (
<FormInputCopyToClipboard
- label="Password"
+ label={t('credentials.password')}
value={password}
type="password"
/>
diff --git a/apps/mobile-app/components/credentials/details/NotesSection.tsx b/apps/mobile-app/components/credentials/details/NotesSection.tsx
index 568ebb3a9..ff1873984 100644
--- a/apps/mobile-app/components/credentials/details/NotesSection.tsx
+++ b/apps/mobile-app/components/credentials/details/NotesSection.tsx
@@ -1,4 +1,5 @@
import { View, Text, StyleSheet, Linking, Pressable } from 'react-native';
+import { useTranslation } from 'react-i18next';
import type { Credential } from '@/utils/dist/shared/models/vault';
@@ -63,6 +64,7 @@ const splitTextAndUrls = (text: string): { type: 'text' | 'url', content: string
* Notes section component.
*/
export const NotesSection: React.FC<NotesSectionProps> = ({ credential }) : React.ReactNode => {
+ const { t } = useTranslation();
const colors = useColors();
if (!credential.Notes) {
@@ -101,7 +103,7 @@ export const NotesSection: React.FC<NotesSectionProps> = ({ credential }) : Reac
return (
<ThemedView style={styles.section}>
- <ThemedText type="subtitle">Notes</ThemedText>
+ <ThemedText type="subtitle">{t('credentials.notes')}</ThemedText>
<View style={styles.notesContainer}>
{parts.map((part, index) => {
if (part.type === 'url') {
diff --git a/apps/mobile-app/components/credentials/details/TotpSection.tsx b/apps/mobile-app/components/credentials/details/TotpSection.tsx
index e4619f1ba..5f2cb14e7 100644
--- a/apps/mobile-app/components/credentials/details/TotpSection.tsx
+++ b/apps/mobile-app/components/credentials/details/TotpSection.tsx
@@ -3,6 +3,7 @@ import * as OTPAuth from 'otpauth';
import React, { useState, useEffect } from 'react';
import { View, StyleSheet, TouchableOpacity, Platform } from 'react-native';
import Toast from 'react-native-toast-message';
+import { useTranslation } from 'react-i18next';
import type { Credential, TotpCode } from '@/utils/dist/shared/models/vault';
@@ -24,6 +25,7 @@ export const TotpSection: React.FC<TotpSectionProps> = ({ credential }) : React.
const [currentCodes, setCurrentCodes] = useState<Record<string, string>>({});
const colors = useColors();
const dbContext = useDb();
+ const { t } = useTranslation();
/**
* Get the remaining seconds.
@@ -75,7 +77,7 @@ export const TotpSection: React.FC<TotpSectionProps> = ({ credential }) : React.
// Only show toast on iOS, Android already shows a native toast on clipboard interactions.
Toast.show({
type: 'success',
- text1: 'Copied to clipboard',
+ text1: t('common.copied'),
position: 'bottom',
visibilityTime: 2000,
});
@@ -186,7 +188,7 @@ export const TotpSection: React.FC<TotpSectionProps> = ({ credential }) : React.
return (
<ThemedView style={styles.container}>
<ThemedText type="subtitle">
- Two-factor authentication
+ {t('credentials.twoFactorAuth')}
</ThemedText>
{totpCodes.map(totpCode => (
<TouchableOpacity
@@ -197,7 +199,7 @@ export const TotpSection: React.FC<TotpSectionProps> = ({ credential }) : React.
<View style={styles.codeContainer}>
<View>
<ThemedText style={styles.label}>
- TOTP Code
+ {t('credentials.totpCode')}
</ThemedText>
<ThemedText style={styles.code}>
{currentCodes[totpCode.Id]}
diff --git a/apps/mobile-app/i18n/index.ts b/apps/mobile-app/i18n/index.ts
index 8375907e7..db841cb52 100644
--- a/apps/mobile-app/i18n/index.ts
+++ b/apps/mobile-app/i18n/index.ts
@@ -19,7 +19,7 @@ const initI18n = async (): Promise<void> => {
const deviceLanguage = locales[0]?.languageCode ?? 'en';
const selectedLanguage = resources[deviceLanguage as keyof typeof resources] ? deviceLanguage : 'en';
- i18n
+ await i18n
.use(initReactI18next)
.init({
compatibilityJSON: 'v3',
diff --git a/apps/mobile-app/i18n/locales/en.json b/apps/mobile-app/i18n/locales/en.json
index 194c4b976..3130599d7 100644
--- a/apps/mobile-app/i18n/locales/en.json
+++ b/apps/mobile-app/i18n/locales/en.json
@@ -52,6 +52,7 @@
"confirmLogout": "Are you sure you want to logout? You need to login again with your master password to access your vault."
},
"credentials": {
+ "title": "Credentials",
"addCredential": "Add Credential",
"editCredential": "Edit Credential",
"deleteCredential": "Delete Credential",
@@ -68,6 +69,7 @@
"firstName": "First Name",
"lastName": "Last Name",
"nickName": "Nick Name",
+ "fullName": "Full Name",
"gender": "Gender",
"birthDate": "Birth Date",
"birthDatePlaceholder": "YYYY-MM-DD",
@@ -75,6 +77,29 @@
"randomAlias": "Random Alias",
"manual": "Manual",
"generateRandomAlias": "Generate Random Alias",
+ "searchPlaceholder": "Search credentials...",
+ "noMatchingCredentials": "No matching credentials found",
+ "noCredentialsFound": "No credentials found. Create one to get started. Tip: you can also login to the AliasVault web app to import credentials from other password managers.",
+ "recentEmails": "Recent emails",
+ "loadingEmails": "Loading emails...",
+ "noEmailsYet": "No emails received yet.",
+ "offlineEmailsMessage": "You are offline. Please connect to the internet to load your emails.",
+ "emailLoadError": "An error occurred while loading emails. Please try again later.",
+ "emailClaimError": "The current chosen email address is already in use. Please change the email address by editing this credential.",
+ "emailSyncError": "An error occurred while trying to load the emails. Please try to edit and save the credential entry to synchronize the database, then try again.",
+ "emailUnexpectedError": "An unexpected error occurred while loading emails. Please try again later.",
+ "password": "Password",
+ "deletingCredential": "Deleting credential...",
+ "errorLoadingCredentials": "Error loading credentials",
+ "vaultSyncFailed": "Vault sync failed",
+ "vaultSyncedSuccessfully": "Vault synced successfully",
+ "vaultUpToDate": "Vault is up-to-date",
+ "offlineMessage": "You are offline. Please connect to the internet to sync your vault.",
+ "credentialCreated": "Credential Created!",
+ "credentialCreatedMessage": "Your new credential has been added to your vault and is ready to use.",
+ "switchBackToBrowser": "Switch back to your browser to continue.",
+ "twoFactorAuth": "Two-factor authentication",
+ "totpCode": "TOTP Code",
"actions": {
"copyUsername": "Copy Username",
"copyEmail": "Copy Email",
@@ -85,7 +110,8 @@
"emailCopied": "Email copied to clipboard",
"passwordCopied": "Password copied to clipboard",
"credentialUpdated": "Credential updated successfully",
- "credentialCreated": "Credential created successfully"
+ "credentialCreated": "Credential created successfully",
+ "credentialDeleted": "Credential deleted successfully"
},
"errors": {
"loadFailed": "Failed to load credential",
@@ -133,5 +159,25 @@
},
"offline": {
"banner": "You are offline. Some features may not be available."
+ },
+ "emails": {
+ "title": "Email Details",
+ "subject": "Subject:",
+ "date": "Date:",
+ "from": "From:",
+ "to": "To:",
+ "attachments": "Attachments",
+ "deleteEmail": "Delete Email",
+ "deleteEmailConfirm": "Are you sure you want to delete this email? This action is permanent and cannot be undone.",
+ "emailNotFound": "Email not found",
+ "noPlainText": "This email does not contain any plain-text.",
+ "sizeKB": "KB",
+ "errors": {
+ "generic": "An error occurred",
+ "deleteFailed": "Failed to delete email",
+ "dbNotAvailable": "Database context or email not available",
+ "decryptFailed": "Failed to decrypt attachment",
+ "downloadFailed": "Failed to download attachment"
+ }
}
}
\ No newline at end of file
diff --git a/apps/mobile-app/i18n/locales/nl.json b/apps/mobile-app/i18n/locales/nl.json
index 27d3d1e28..91d512482 100644
--- a/apps/mobile-app/i18n/locales/nl.json
+++ b/apps/mobile-app/i18n/locales/nl.json
@@ -52,6 +52,7 @@
"confirmLogout": "Weet u zeker dat u wilt uitloggen? U moet opnieuw inloggen met uw hoofdwachtwoord om toegang te krijgen tot uw kluis."
},
"credentials": {
+ "title": "Referenties",
"addCredential": "Referentie Toevoegen",
"editCredential": "Referentie Bewerken",
"deleteCredential": "Referentie Verwijderen",
@@ -68,6 +69,7 @@
"firstName": "Voornaam",
"lastName": "Achternaam",
"nickName": "Bijnaam",
+ "fullName": "Volledige Naam",
"gender": "Geslacht",
"birthDate": "Geboortedatum",
"birthDatePlaceholder": "JJJJ-MM-DD",
@@ -75,6 +77,29 @@
"randomAlias": "Willekeurige Alias",
"manual": "Handmatig",
"generateRandomAlias": "Genereer Willekeurige Alias",
+ "searchPlaceholder": "Zoek referenties...",
+ "noMatchingCredentials": "Geen overeenkomende referenties gevonden",
+ "noCredentialsFound": "Geen referenties gevonden. Maak er een aan om te beginnen. Tip: u kunt ook inloggen op de AliasVault webapp om referenties te importeren uit andere wachtwoordbeheerders.",
+ "recentEmails": "Recente e-mails",
+ "loadingEmails": "E-mails laden...",
+ "noEmailsYet": "Nog geen e-mails ontvangen.",
+ "offlineEmailsMessage": "U bent offline. Maak verbinding met het internet om uw e-mails te laden.",
+ "emailLoadError": "Er is een fout opgetreden bij het laden van e-mails. Probeer het later opnieuw.",
+ "emailClaimError": "Het gekozen e-mailadres is al in gebruik. Wijzig het e-mailadres door deze referentie te bewerken.",
+ "emailSyncError": "Er is een fout opgetreden bij het laden van de e-mails. Probeer de referentie te bewerken en op te slaan om de database te synchroniseren, en probeer het opnieuw.",
+ "emailUnexpectedError": "Er is een onverwachte fout opgetreden bij het laden van e-mails. Probeer het later opnieuw.",
+ "password": "Wachtwoord",
+ "deletingCredential": "Referentie verwijderen...",
+ "errorLoadingCredentials": "Fout bij het laden van referenties",
+ "vaultSyncFailed": "Kluis synchronisatie mislukt",
+ "vaultSyncedSuccessfully": "Kluis succesvol gesynchroniseerd",
+ "vaultUpToDate": "Kluis is up-to-date",
+ "offlineMessage": "U bent offline. Maak verbinding met het internet om uw kluis te synchroniseren.",
+ "credentialCreated": "Referentie Aangemaakt!",
+ "credentialCreatedMessage": "Uw nieuwe referentie is toegevoegd aan uw kluis en is klaar voor gebruik.",
+ "switchBackToBrowser": "Schakel terug naar uw browser om door te gaan.",
+ "twoFactorAuth": "Twee-factor authenticatie",
+ "totpCode": "TOTP Code",
"actions": {
"copyUsername": "Kopieer Gebruikersnaam",
"copyEmail": "Kopieer E-mail",
@@ -85,7 +110,8 @@
"emailCopied": "E-mail gekopieerd naar klembord",
"passwordCopied": "Wachtwoord gekopieerd naar klembord",
"credentialUpdated": "Referentie succesvol bijgewerkt",
- "credentialCreated": "Referentie succesvol aangemaakt"
+ "credentialCreated": "Referentie succesvol aangemaakt",
+ "credentialDeleted": "Referentie succesvol verwijderd"
},
"errors": {
"loadFailed": "Laden van referentie mislukt",
@@ -133,5 +159,25 @@
},
"offline": {
"banner": "U bent offline. Sommige functies zijn mogelijk niet beschikbaar."
+ },
+ "emails": {
+ "title": "E-mail Details",
+ "subject": "Onderwerp:",
+ "date": "Datum:",
+ "from": "Van:",
+ "to": "Aan:",
+ "attachments": "Bijlagen",
+ "deleteEmail": "E-mail Verwijderen",
+ "deleteEmailConfirm": "Weet u zeker dat u deze e-mail wilt verwijderen? Deze actie is permanent en kan niet ongedaan worden gemaakt.",
+ "emailNotFound": "E-mail niet gevonden",
+ "noPlainText": "Deze e-mail bevat geen platte tekst.",
+ "sizeKB": "KB",
+ "errors": {
+ "generic": "Er is een fout opgetreden",
+ "deleteFailed": "E-mail verwijderen mislukt",
+ "dbNotAvailable": "Database context of e-mail niet beschikbaar",
+ "decryptFailed": "Bijlage ontsleutelen mislukt",
+ "downloadFailed": "Bijlage downloaden mislukt"
+ }
}
}
\ No newline at end of file