Skip to content

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

Mobile app i18n scaffolding (#993)

Leendert de Borste1497b74aa19
diff --git a/apps/mobile-app/app/(tabs)/settings/index.tsx b/apps/mobile-app/app/(tabs)/settings/index.tsx
index 5614f5897..d6f39c7b4 100644
--- a/apps/mobile-app/app/(tabs)/settings/index.tsx
+++ b/apps/mobile-app/app/(tabs)/settings/index.tsx
@@ -1,13 +1,14 @@
import { Ionicons } from '@expo/vector-icons';
import { router, useFocusEffect } from 'expo-router';
import { useRef, useState, useCallback } from 'react';
-import { StyleSheet, View, ScrollView, TouchableOpacity, Animated, Platform, Alert } from 'react-native';
+import { StyleSheet, View, ScrollView, TouchableOpacity, Animated, Platform, Alert, Linking } from 'react-native';
import { useApiUrl } from '@/utils/ApiUrlUtility';
import { AppInfo } from '@/utils/AppInfo';
import { useColors } from '@/hooks/useColorScheme';
import { useMinDurationLoading } from '@/hooks/useMinDurationLoading';
+import { useTranslation } from '@/hooks/useTranslation';
import { ThemedContainer } from '@/components/themed/ThemedContainer';
import { ThemedText } from '@/components/themed/ThemedText';
@@ -24,6 +25,7 @@ import { useWebApi } from '@/context/WebApiContext';
export default function SettingsScreen() : React.ReactNode {
const webApi = useWebApi();
const colors = useColors();
+ const { t } = useTranslation();
const { getAuthMethodDisplay, shouldShowAutofillReminder } = useAuth();
const { getAutoLockTimeout } = useAuth();
const { loadApiUrl, getDisplayUrl } = useApiUrl();
@@ -40,24 +42,24 @@ export default function SettingsScreen() : React.ReactNode {
*/
const loadAutoLockDisplay = async () : Promise<void> => {
const autoLockTimeout = await getAutoLockTimeout();
- let display = 'Never';
+ let display = t('common.never');
if (autoLockTimeout === 5) {
- display = '5 seconds';
+ display = t('settings.autoLockOptions.5seconds');
} else if (autoLockTimeout === 30) {
- display = '30 seconds';
+ display = t('settings.autoLockOptions.30seconds');
} else if (autoLockTimeout === 60) {
- display = '1 minute';
+ display = t('settings.autoLockOptions.1minute');
} else if (autoLockTimeout === 900) {
- display = '15 minutes';
+ display = t('settings.autoLockOptions.15minutes');
} else if (autoLockTimeout === 1800) {
- display = '30 minutes';
+ display = t('settings.autoLockOptions.30minutes');
} else if (autoLockTimeout === 3600) {
- display = '1 hour';
+ display = t('settings.autoLockOptions.1hour');
} else if (autoLockTimeout === 14400) {
- display = '4 hours';
+ display = t('settings.autoLockOptions.4hours');
} else if (autoLockTimeout === 28800) {
- display = '8 hours';
+ display = t('settings.autoLockOptions.8hours');
}
setAutoLockDisplay(display);
@@ -80,7 +82,7 @@ export default function SettingsScreen() : React.ReactNode {
};
loadData();
- }, [getAutoLockTimeout, getAuthMethodDisplay, setIsFirstLoad, loadApiUrl])
+ }, [getAutoLockTimeout, getAuthMethodDisplay, setIsFirstLoad, loadApiUrl, t])
);
/**
@@ -89,11 +91,11 @@ export default function SettingsScreen() : React.ReactNode {
const handleLogout = async () : Promise<void> => {
// Show native confirmation dialog
Alert.alert(
- 'Logout',
- 'Are you sure you want to logout? You need to login again with your master password to access your vault.',
+ t('auth.logout'),
+ t('auth.confirmLogout'),
[
- { text: 'Cancel', style: 'cancel' },
- { text: 'Logout', style: 'destructive',
+ { text: t('common.cancel'), style: 'cancel' },
+ { text: t('auth.logout'), style: 'destructive',
/**
* Handle the logout.
*/
@@ -141,6 +143,32 @@ export default function SettingsScreen() : React.ReactNode {
router.push('/(tabs)/settings/identity-generator');
};
+ /**
+ * Handle the language settings press.
+ */
+ const handleLanguagePress = (): void => {
+ Alert.alert(
+ t('settings.language'),
+ t('settings.languageSystemMessage'),
+ [
+ { text: t('common.cancel'), style: 'cancel' },
+ {
+ text: t('settings.openSettings'),
+ style: 'default',
+ /**
+ * Open iOS settings
+ */
+ onPress: (): void => {
+ // Open iOS Settings app
+ if (Platform.OS === 'ios') {
+ Linking.openURL('app-settings:');
+ }
+ }
+ }
+ ]
+ );
+ };
+
const styles = StyleSheet.create({
scrollContent: {
paddingBottom: 40,
@@ -224,7 +252,7 @@ export default function SettingsScreen() : React.ReactNode {
return (
<ThemedContainer>
<CollapsibleHeader
- title="Settings"
+ title={t('settings.title')}
scrollY={scrollY}
showNavigationHeader={false}
/>
@@ -239,7 +267,7 @@ export default function SettingsScreen() : React.ReactNode {
scrollIndicatorInsets={{ bottom: 40 }}
style={styles.scrollView}
>
- <TitleContainer title="Settings" />
+ <TitleContainer title={t('settings.title')} />
<UsernameDisplay />
<View style={styles.section}>
{Platform.OS === 'ios' && (
@@ -252,7 +280,7 @@ export default function SettingsScreen() : React.ReactNode {
<Ionicons name="key-outline" size={20} color={colors.text} />
</View>
<View style={styles.settingItemContent}>
- <ThemedText style={styles.settingItemText}>iOS Autofill</ThemedText>
+ <ThemedText style={styles.settingItemText}>{t('settings.iosAutofill')}</ThemedText>
{shouldShowAutofillReminder && (
<View style={styles.settingItemBadge}>
<ThemedText style={styles.settingItemBadgeText}>1</ThemedText>
@@ -274,7 +302,7 @@ export default function SettingsScreen() : React.ReactNode {
<Ionicons name="key-outline" size={20} color={colors.text} />
</View>
<View style={styles.settingItemContent}>
- <ThemedText style={styles.settingItemText}>Android Autofill</ThemedText>
+ <ThemedText style={styles.settingItemText}>{t('settings.androidAutofill')}</ThemedText>
{shouldShowAutofillReminder && (
<View style={styles.settingItemBadge}>
<ThemedText style={styles.settingItemBadgeText}>1</ThemedText>
@@ -294,7 +322,7 @@ export default function SettingsScreen() : React.ReactNode {
<Ionicons name="lock-closed" size={20} color={colors.text} />
</View>
<View style={styles.settingItemContent}>
- <ThemedText style={styles.settingItemText}>Vault Unlock Method</ThemedText>
+ <ThemedText style={styles.settingItemText}>{t('settings.vaultUnlock')}</ThemedText>
{isFirstLoad ? (
<InlineSkeletonLoader width={100} style={styles.skeletonLoader} />
) : (
@@ -312,7 +340,7 @@ export default function SettingsScreen() : React.ReactNode {
<Ionicons name="timer-outline" size={20} color={colors.text} />
</View>
<View style={styles.settingItemContent}>
- <ThemedText style={styles.settingItemText}>Auto-lock Timeout</ThemedText>
+ <ThemedText style={styles.settingItemText}>{t('settings.autoLock')}</ThemedText>
{isFirstLoad ? (
<InlineSkeletonLoader width={80} style={styles.skeletonLoader} />
) : (
@@ -321,6 +349,22 @@ export default function SettingsScreen() : React.ReactNode {
<Ionicons name="chevron-forward" size={20} color={colors.textMuted} />
</View>
</TouchableOpacity>
+ <View style={styles.separator} />
+ <TouchableOpacity
+ style={styles.settingItem}
+ onPress={handleLanguagePress}
+ >
+ <View style={styles.settingItemIcon}>
+ <Ionicons name="language" size={20} color={colors.text} />
+ </View>
+ <View style={styles.settingItemContent}>
+ <ThemedText style={styles.settingItemText}>{t('settings.language')}</ThemedText>
+ <ThemedText style={styles.settingItemValue}>
+ {t('settings.systemLanguage')}
+ </ThemedText>
+ <Ionicons name="chevron-forward" size={20} color={colors.textMuted} />
+ </View>
+ </TouchableOpacity>
</View>
<View style={styles.section}>
@@ -332,7 +376,7 @@ export default function SettingsScreen() : React.ReactNode {
<Ionicons name="person-outline" size={20} color={colors.text} />
</View>
<View style={styles.settingItemContent}>
- <ThemedText style={styles.settingItemText}>Identity Generator</ThemedText>
+ <ThemedText style={styles.settingItemText}>{t('settings.identityGenerator')}</ThemedText>
<Ionicons name="chevron-forward" size={20} color={colors.textMuted} />
</View>
</TouchableOpacity>
@@ -345,7 +389,7 @@ export default function SettingsScreen() : React.ReactNode {
<Ionicons name="shield-checkmark" size={20} color={colors.text} />
</View>
<View style={styles.settingItemContent}>
- <ThemedText style={styles.settingItemText}>Security</ThemedText>
+ <ThemedText style={styles.settingItemText}>{t('settings.security')}</ThemedText>
<Ionicons name="chevron-forward" size={20} color={colors.textMuted} />
</View>
</TouchableOpacity>
@@ -360,13 +404,13 @@ export default function SettingsScreen() : React.ReactNode {
<Ionicons name="log-out" size={20} color={colors.primary} />
</View>
<View style={styles.settingItemContent}>
- <ThemedText style={[styles.settingItemText, { color: colors.primary }]}>Logout</ThemedText>
+ <ThemedText style={[styles.settingItemText, { color: colors.primary }]}>{t('auth.logout')}</ThemedText>
</View>
</TouchableOpacity>
</View>
<View style={styles.versionContainer}>
- <ThemedText style={styles.versionText}>App version {AppInfo.VERSION} ({getDisplayUrl()})</ThemedText>
+ <ThemedText style={styles.versionText}>{t('settings.appVersion', { version: AppInfo.VERSION, url: getDisplayUrl() })}</ThemedText>
</View>
</Animated.ScrollView>
</ThemedContainer>
diff --git a/apps/mobile-app/app/_layout.tsx b/apps/mobile-app/app/_layout.tsx
index 1625e96a5..e835bd9d8 100644
--- a/apps/mobile-app/app/_layout.tsx
+++ b/apps/mobile-app/app/_layout.tsx
@@ -18,6 +18,7 @@ import { AliasVaultToast } from '@/components/Toast';
import { AuthProvider, useAuth } from '@/context/AuthContext';
import { DbProvider, useDb } from '@/context/DbContext';
import { useWebApi, WebApiProvider } from '@/context/WebApiContext';
+import { initI18n } from '@/i18n';
import NativeVaultManager from '@/specs/NativeVaultManager';
SplashScreen.preventAutoHideAsync();
@@ -47,6 +48,9 @@ function RootLayoutNav() : React.ReactNode {
// Install the react-native-quick-crypto library which is used by the EncryptionUtility
install();
+ // Initialize i18n
+ initI18n();
+
hasBooted.current = true;
/**
diff --git a/apps/mobile-app/app/login.tsx b/apps/mobile-app/app/login.tsx
index d6a520c5a..c62109809 100644
--- a/apps/mobile-app/app/login.tsx
+++ b/apps/mobile-app/app/login.tsx
@@ -16,6 +16,7 @@ import { SrpUtility } from '@/utils/SrpUtility';
import { ApiAuthError } from '@/utils/types/errors/ApiAuthError';
import { useColors } from '@/hooks/useColorScheme';
+import { useTranslation } from '@/hooks/useTranslation';
import { useVaultSync } from '@/hooks/useVaultSync';
import Logo from '@/assets/images/logo.svg';
@@ -31,6 +32,7 @@ import { useWebApi } from '@/context/WebApiContext';
*/
export default function LoginScreen() : React.ReactNode {
const colors = useColors();
+ const { t } = useTranslation();
const [fadeAnim] = useState(new Animated.Value(0));
const { loadApiUrl, getDisplayUrl } = useApiUrl();
@@ -90,11 +92,11 @@ export default function LoginScreen() : React.ReactNode {
if (isBiometricsEnabledOnDevice) {
// Show biometric prompt if biometrics are available (faceid or fingerprint enrolled) on device.
Alert.alert(
- `Enable ${biometricDisplayName}?`,
- `Would you like to use ${biometricDisplayName} to unlock your vault?`,
+ t('auth.enableBiometric', { biometric: biometricDisplayName }),
+ t('auth.biometricPrompt', { biometric: biometricDisplayName }),
[
{
- text: 'No',
+ text: t('common.no'),
style: 'destructive',
/**
* Handle disabling biometric authentication
@@ -111,7 +113,7 @@ export default function LoginScreen() : React.ReactNode {
}
},
{
- text: 'Yes',
+ text: t('common.yes'),
isPreferred: true,
/**
* Handle enabling biometric authentication
@@ -185,7 +187,7 @@ export default function LoginScreen() : React.ReactNode {
checkSuccess = false;
// Show modal with error message
- Alert.alert('Error', message);
+ Alert.alert(t('common.error'), message);
webApi.logout(message);
setIsLoading(false);
},
@@ -231,12 +233,12 @@ export default function LoginScreen() : React.ReactNode {
// Sanity check: if username or password is empty, return
if (!credentials.username || !credentials.password) {
- setError('Username and password are required');
+ setError(t('auth.errors.credentialsRequired'));
setIsLoading(false);
return;
}
- setLoginStatus('Logging in');
+ setLoginStatus(t('auth.loggingIn'));
await new Promise(resolve => requestAnimationFrame(resolve));
try {
@@ -254,7 +256,7 @@ export default function LoginScreen() : React.ReactNode {
const passwordHashString = Buffer.from(passwordHash).toString('hex').toUpperCase();
const passwordHashBase64 = Buffer.from(passwordHash).toString('base64');
- setLoginStatus('Validating credentials');
+ setLoginStatus(t('auth.validatingCredentials'));
await new Promise(resolve => requestAnimationFrame(resolve));
const validationResponse = await srpUtil.validateLogin(
ConversionUtility.normalizeUsername(credentials.username),
@@ -277,7 +279,7 @@ export default function LoginScreen() : React.ReactNode {
throw new Error('Login failed -- no token returned');
}
- setLoginStatus('Syncing vault');
+ setLoginStatus(t('auth.syncingVault'));
await new Promise(resolve => requestAnimationFrame(resolve));
const vaultResponseJson = await webApi.authFetch<VaultResponse>('Vault', { method: 'GET', headers: {
'Authorization': `Bearer ${validationResponse.token.token}`
@@ -317,7 +319,7 @@ export default function LoginScreen() : React.ReactNode {
*/
const handleTwoFactorSubmit = async () : Promise<void> => {
setIsLoading(true);
- setLoginStatus('Verifying authentication code');
+ setLoginStatus(t('auth.verifyingAuthCode'));
setError(null);
await new Promise(resolve => requestAnimationFrame(resolve));
@@ -328,7 +330,7 @@ export default function LoginScreen() : React.ReactNode {
const code = twoFactorCode.trim();
if (!/^\d{6}$/.test(code)) {
- throw new ApiAuthError('Please enter a valid 6-digit authentication code.');
+ throw new ApiAuthError(t('auth.errors.invalidAuthCode'));
}
const validationResponse = await srpUtil.validateLogin2Fa(
@@ -343,7 +345,7 @@ export default function LoginScreen() : React.ReactNode {
throw new Error('Login failed -- no token returned');
}
- setLoginStatus('Syncing vault');
+ setLoginStatus(t('auth.syncingVault'));
await new Promise(resolve => requestAnimationFrame(resolve));
const vaultResponseJson = await webApi.authFetch<VaultResponse>('Vault', { method: 'GET', headers: {
'Authorization': `Bearer ${validationResponse.token.token}`
@@ -395,23 +397,6 @@ export default function LoginScreen() : React.ReactNode {
fontSize: 16,
fontWeight: '600',
},
- checkbox: {
- alignItems: 'center',
- borderColor: colors.accentBorder,
- borderRadius: 4,
- borderWidth: 2,
- height: 20,
- justifyContent: 'center',
- width: 20,
- },
- checkboxChecked: {
- backgroundColor: colors.primary,
- },
- checkboxInner: {
- borderRadius: 2,
- height: 12,
- width: 12,
- },
clickableLink: {
color: colors.primary,
textDecorationLine: 'underline',
@@ -543,11 +528,11 @@ export default function LoginScreen() : React.ReactNode {
</SafeAreaView>
<ThemedView style={styles.content}>
{isLoading ? (
- <LoadingIndicator status={loginStatus ?? 'Loading...'} />
+ <LoadingIndicator status={loginStatus ?? t('common.loading')} />
) : (
<>
<View style={styles.headerContainer}>
- <Text style={styles.headerTitle}>Log in</Text>
+ <Text style={styles.headerTitle}>{t('auth.login')}</Text>
<Text style={styles.headerSubtitle}>
Connecting to{' '}
<Text
@@ -567,7 +552,7 @@ export default function LoginScreen() : React.ReactNode {
{twoFactorRequired ? (
<View style={styles.formContainer}>
- <Text style={styles.label}>Authentication Code</Text>
+ <Text style={styles.label}>{t('auth.authCode')}</Text>
<View style={styles.inputContainer}>
<MaterialIcons
name="security"
@@ -581,7 +566,7 @@ export default function LoginScreen() : React.ReactNode {
onChangeText={setTwoFactorCode}
autoCorrect={false}
autoCapitalize="none"
- placeholder="Enter 6-digit code"
+ placeholder={t('auth.enterAuthCode')}
keyboardType="numeric"
maxLength={6}
placeholderTextColor={colors.textMuted}
@@ -596,7 +581,7 @@ export default function LoginScreen() : React.ReactNode {
{isLoading ? (
<ActivityIndicator color={colors.text} />
) : (
- <Text style={styles.buttonText}>Verify</Text>
+ <Text style={styles.buttonText}>{t('auth.verify')}</Text>
)}
</TouchableOpacity>
<TouchableOpacity
@@ -611,16 +596,16 @@ export default function LoginScreen() : React.ReactNode {
setError(null);
}}
>
- <Text style={styles.buttonText}>Cancel</Text>
+ <Text style={styles.buttonText}>{t('common.cancel')}</Text>
</TouchableOpacity>
</View>
<Text style={styles.textMuted}>
- Note: if you don&apos;t have access to your authenticator device, you can reset your 2FA with a recovery code by logging in via the website.
+ {t('auth.authCodeNote')}
</Text>
</View>
) : (
<View style={styles.formContainer}>
- <Text style={styles.label}>Username or email</Text>
+ <Text style={styles.label}>{t('auth.username')}</Text>
<View style={styles.inputContainer}>
<MaterialIcons
name="person"
@@ -632,13 +617,13 @@ export default function LoginScreen() : React.ReactNode {
style={styles.input}
value={credentials.username}
onChangeText={(text) => setCredentials({ ...credentials, username: text })}
- placeholder="name / [email protected]"
+ placeholder={t('auth.usernamePlaceholder')}
autoCapitalize="none"
autoCorrect={false}
placeholderTextColor={colors.textMuted}
/>
</View>
- <Text style={styles.label}>Password</Text>
+ <Text style={styles.label}>{t('auth.password')}</Text>
<View style={styles.inputContainer}>
<MaterialIcons
name="lock"
@@ -650,7 +635,7 @@ export default function LoginScreen() : React.ReactNode {
style={styles.input}
value={credentials.password}
onChangeText={(text) => setCredentials({ ...credentials, password: text })}
- placeholder="Enter your password"
+ placeholder={t('auth.passwordPlaceholder')}
secureTextEntry
placeholderTextColor={colors.textMuted}
autoCorrect={false}
@@ -665,7 +650,7 @@ export default function LoginScreen() : React.ReactNode {
{isLoading ? (
<ActivityIndicator color={colors.text} />
) : (
- <Text style={styles.buttonText}>Login</Text>
+ <Text style={styles.buttonText}>{t('auth.login')}</Text>
)}
</TouchableOpacity>
<View style={styles.createNewVaultContainer}>
diff --git a/apps/mobile-app/app/unlock.tsx b/apps/mobile-app/app/unlock.tsx
index e253c6e9f..59fbb50f2 100644
--- a/apps/mobile-app/app/unlock.tsx
+++ b/apps/mobile-app/app/unlock.tsx
@@ -7,6 +7,7 @@ import { StyleSheet, View, TextInput, TouchableOpacity, Alert, KeyboardAvoidingV
import EncryptionUtility from '@/utils/EncryptionUtility';
import { useColors } from '@/hooks/useColorScheme';
+import { useTranslation } from '@/hooks/useTranslation';
import Logo from '@/assets/images/logo.svg';
import LoadingIndicator from '@/components/LoadingIndicator';
@@ -28,6 +29,7 @@ export default function UnlockScreen() : React.ReactNode {
const [isLoading, setIsLoading] = useState(false);
const [isBiometricsAvailable, setIsBiometricsAvailable] = useState(false);
const colors = useColors();
+ const { t } = useTranslation();
const webApi = useWebApi();
const { getBiometricDisplayName } = useAuth();
const [biometricDisplayName, setBiometricDisplayName] = useState('');
@@ -68,7 +70,7 @@ export default function UnlockScreen() : React.ReactNode {
*/
const handleUnlock = async () : Promise<void> => {
if (!password) {
- Alert.alert('Error', 'Please enter your password');
+ Alert.alert(t('common.error'), t('auth.errors.enterPassword'));
return;
}
@@ -110,7 +112,7 @@ export default function UnlockScreen() : React.ReactNode {
// Navigate to credentials
router.replace('/(tabs)/credentials');
} else {
- Alert.alert('Error', 'Incorrect password. Please try again.');
+ Alert.alert(t('common.error'), t('auth.errors.incorrectPassword'));
}
} catch {
Alert.alert('Error', 'Incorrect password. Please try again.');
@@ -267,7 +269,7 @@ export default function UnlockScreen() : React.ReactNode {
<ThemedView style={styles.container}>
{isLoading ? (
<View style={styles.loadingContainer}>
- <LoadingIndicator status="Unlocking vault" />
+ <LoadingIndicator status={t('auth.unlockingVault')} />
</View>
) : (
<KeyboardAvoidingView
@@ -287,7 +289,7 @@ export default function UnlockScreen() : React.ReactNode {
<View style={styles.headerSection}>
<View style={styles.logoContainer}>
<Logo width={80} height={80} />
- <Text style={styles.appName}>Unlock Vault</Text>
+ <Text style={styles.appName}>{t('auth.unlockVault')}</Text>
</View>
</View>
<View style={styles.content}>
@@ -295,7 +297,7 @@ export default function UnlockScreen() : React.ReactNode {
<Avatar />
<ThemedText style={styles.username}>{username}</ThemedText>
</View>
- <ThemedText style={styles.subtitle}>Enter your password to unlock your vault</ThemedText>
+ <ThemedText style={styles.subtitle}>{t('auth.enterPassword')}</ThemedText>
<View style={styles.inputContainer}>
<MaterialIcons
@@ -306,7 +308,7 @@ export default function UnlockScreen() : React.ReactNode {
/>
<TextInput
style={styles.input}
- placeholder="Password"
+ placeholder={t('auth.enterPasswordPlaceholder')}
placeholderTextColor={colors.textMuted}
secureTextEntry
value={password}
@@ -322,7 +324,7 @@ export default function UnlockScreen() : React.ReactNode {
disabled={isLoading}
>
<ThemedText style={styles.buttonText}>
- {isLoading ? 'Unlocking...' : 'Unlock'}
+ {isLoading ? t('auth.unlocking') : t('auth.unlock')}
</ThemedText>
</TouchableOpacity>
@@ -331,7 +333,7 @@ export default function UnlockScreen() : React.ReactNode {
style={styles.faceIdButton}
onPress={handleBiometricsRetry}
>
- <ThemedText style={styles.faceIdButtonText}>Try {biometricDisplayName} Again</ThemedText>
+ <ThemedText style={styles.faceIdButtonText}>{t('auth.tryBiometricAgain', { biometric: biometricDisplayName })}</ThemedText>
</TouchableOpacity>
)}
</View>
@@ -340,7 +342,7 @@ export default function UnlockScreen() : React.ReactNode {
style={styles.logoutButton}
onPress={handleLogout}
>
- <ThemedText style={styles.logoutButtonText}>Logout</ThemedText>
+ <ThemedText style={styles.logoutButtonText}>{t('auth.logout')}</ThemedText>
</TouchableOpacity>
</View>
</ScrollView>
diff --git a/apps/mobile-app/crowdin.yml b/apps/mobile-app/crowdin.yml
new file mode 100644
index 000000000..a9cb77353
--- /dev/null
+++ b/apps/mobile-app/crowdin.yml
@@ -0,0 +1,24 @@
+project_id: "aliasvault-mobile"
+api_token_env: "CROWDIN_API_TOKEN"
+base_path: "."
+base_url: "https://api.crowdin.com"
+
+preserve_hierarchy: true
+
+files:
+ # React Native JSON translation files
+ - source: "i18n/locales/en.json"
+ translation: "i18n/locales/%two_letters_code%.json"
+ type: "json"
+
+ # iOS native localization files
+ - source: "ios/AliasVault/en.lproj/Localizable.strings"
+ translation: "ios/AliasVault/%two_letters_code%.lproj/Localizable.strings"
+ type: "strings"
+
+ # Android native localization files (if needed in the future)
+ - source: "android/app/src/main/res/values/strings.xml"
+ translation: "android/app/src/main/res/values-%two_letters_code%/strings.xml"
+ type: "android"
+ ignore:
+ - "android/app/src/main/res/values-*/**"
\ No newline at end of file
diff --git a/apps/mobile-app/hooks/useTranslation.ts b/apps/mobile-app/hooks/useTranslation.ts
new file mode 100644
index 000000000..9920af7ef
--- /dev/null
+++ b/apps/mobile-app/hooks/useTranslation.ts
@@ -0,0 +1,17 @@
+import { useTranslation as useReactI18nextTranslation } from 'react-i18next';
+
+/**
+ * Custom hook for translation functionality
+ * @returns Translation utilities
+ */
+export const useTranslation = (): {
+ t: (key: string, options?: object) => string;
+ currentLanguage: string;
+} => {
+ const { t, i18n } = useReactI18nextTranslation();
+
+ return {
+ t,
+ currentLanguage: i18n.language,
+ };
+};
\ No newline at end of file
diff --git a/apps/mobile-app/i18n/index.ts b/apps/mobile-app/i18n/index.ts
new file mode 100644
index 000000000..8375907e7
--- /dev/null
+++ b/apps/mobile-app/i18n/index.ts
@@ -0,0 +1,54 @@
+import { getLocales } from 'expo-localization';
+import i18n from 'i18next';
+import { initReactI18next } from 'react-i18next';
+
+import en from './locales/en.json';
+import nl from './locales/nl.json';
+
+const resources = {
+ en: { translation: en },
+ nl: { translation: nl },
+};
+
+/**
+ * Initialize i18n configuration
+ */
+const initI18n = async (): Promise<void> => {
+ // Always use system language, no custom storage
+ const locales = getLocales();
+ const deviceLanguage = locales[0]?.languageCode ?? 'en';
+ const selectedLanguage = resources[deviceLanguage as keyof typeof resources] ? deviceLanguage : 'en';
+
+ i18n
+ .use(initReactI18next)
+ .init({
+ compatibilityJSON: 'v3',
+ resources,
+ lng: selectedLanguage,
+ fallbackLng: 'en',
+ interpolation: {
+ escapeValue: false,
+ },
+ react: {
+ useSuspense: false,
+ },
+ });
+};
+
+/**
+ * Open iOS app settings for language change
+ * This function is used to indicate that language should be changed in iOS Settings
+ * The actual implementation depends on the platform
+ */
+export const openAppSettings = (): void => {
+ // Implementation handled in settings screen
+};
+
+/**
+ * Get the current language
+ * @returns The current language code
+ */
+export const getCurrentLanguage = (): string => i18n.language;
+
+export { initI18n };
+export default i18n;
\ No newline at end of file
diff --git a/apps/mobile-app/i18n/locales/en.json b/apps/mobile-app/i18n/locales/en.json
new file mode 100644
index 000000000..194c4b976
--- /dev/null
+++ b/apps/mobile-app/i18n/locales/en.json
@@ -0,0 +1,137 @@
+{
+ "common": {
+ "cancel": "Cancel",
+ "delete": "Delete",
+ "save": "Save",
+ "edit": "Edit",
+ "yes": "Yes",
+ "no": "No",
+ "ok": "OK",
+ "loading": "Loading...",
+ "error": "Error",
+ "success": "Success",
+ "required": "Required",
+ "optional": "Optional",
+ "never": "Never",
+ "untitled": "Untitled",
+ "copy": "Copy",
+ "copied": "Copied",
+ "version": "Version"
+ },
+ "auth": {
+ "login": "Log in",
+ "logout": "Logout",
+ "username": "Username or email",
+ "password": "Password",
+ "authCode": "Authentication Code",
+ "unlock": "Unlock",
+ "unlocking": "Unlocking...",
+ "unlockingVault": "Unlocking vault",
+ "loggingIn": "Logging in",
+ "validatingCredentials": "Validating credentials",
+ "syncingVault": "Syncing vault",
+ "verifyingAuthCode": "Verifying authentication code",
+ "verify": "Verify",
+ "unlockVault": "Unlock Vault",
+ "enterPassword": "Enter your password to unlock your vault",
+ "enterPasswordPlaceholder": "Password",
+ "enterAuthCode": "Enter 6-digit code",
+ "usernamePlaceholder": "name / [email protected]",
+ "passwordPlaceholder": "Enter your password",
+ "enableBiometric": "Enable {{biometric}}?",
+ "biometricPrompt": "Would you like to use {{biometric}} to unlock your vault?",
+ "tryBiometricAgain": "Try {{biometric}} Again",
+ "authCodeNote": "Note: if you don't have access to your authenticator device, you can reset your 2FA with a recovery code by logging in via the website.",
+ "noAccountYet": "No account yet?",
+ "errors": {
+ "credentialsRequired": "Username and password are required",
+ "invalidAuthCode": "Please enter a valid 6-digit authentication code",
+ "incorrectPassword": "Incorrect password. Please try again.",
+ "enterPassword": "Please enter your password"
+ },
+ "confirmLogout": "Are you sure you want to logout? You need to login again with your master password to access your vault."
+ },
+ "credentials": {
+ "addCredential": "Add Credential",
+ "editCredential": "Edit Credential",
+ "deleteCredential": "Delete Credential",
+ "deleteConfirm": "Are you sure you want to delete this credential? This action cannot be undone.",
+ "credentialOptions": "Credential Options",
+ "service": "Service",
+ "serviceName": "Service Name",
+ "serviceUrl": "Service URL",
+ "loginCredentials": "Login credentials",
+ "username": "Username",
+ "email": "Email",
+ "alias": "Alias",
+ "metadata": "Metadata",
+ "firstName": "First Name",
+ "lastName": "Last Name",
+ "nickName": "Nick Name",
+ "gender": "Gender",
+ "birthDate": "Birth Date",
+ "birthDatePlaceholder": "YYYY-MM-DD",
+ "notes": "Notes",
+ "randomAlias": "Random Alias",
+ "manual": "Manual",
+ "generateRandomAlias": "Generate Random Alias",
+ "actions": {
+ "copyUsername": "Copy Username",
+ "copyEmail": "Copy Email",
+ "copyPassword": "Copy Password"
+ },
+ "toasts": {
+ "usernameCopied": "Username copied to clipboard",
+ "emailCopied": "Email copied to clipboard",
+ "passwordCopied": "Password copied to clipboard",
+ "credentialUpdated": "Credential updated successfully",
+ "credentialCreated": "Credential created successfully"
+ },
+ "errors": {
+ "loadFailed": "Failed to load credential",
+ "generateUsernameFailed": "Failed to generate username",
+ "generatePasswordFailed": "Failed to generate password"
+ }
+ },
+ "settings": {
+ "title": "Settings",
+ "iosAutofill": "iOS Autofill",
+ "androidAutofill": "Android Autofill",
+ "vaultUnlock": "Vault Unlock Method",
+ "autoLock": "Auto-lock Timeout",
+ "identityGenerator": "Identity Generator",
+ "security": "Security",
+ "appVersion": "App version {{version}} ({{url}})",
+ "autoLockOptions": {
+ "5seconds": "5 seconds",
+ "30seconds": "30 seconds",
+ "1minute": "1 minute",
+ "15minutes": "15 minutes",
+ "30minutes": "30 minutes",
+ "1hour": "1 hour",
+ "4hours": "4 hours",
+ "8hours": "8 hours"
+ },
+ "language": "Language",
+ "systemLanguage": "System Language",
+ "languageSystemMessage": "To change the app language, we'll open iOS Settings where you can configure the preferred language for AliasVault.",
+ "openSettings": "Open Settings"
+ },
+ "navigation": {
+ "credentials": "Credentials",
+ "emails": "Emails",
+ "settings": "Settings",
+ "notFound": "This page doesn't exist.",
+ "oops": "Oops!",
+ "goBack": "Go back to the home page"
+ },
+ "validation": {
+ "serviceNameRequired": "Service name is required",
+ "invalidUrl": "Invalid URL format",
+ "invalidDate": "Date must be in YYYY-MM-DD format",
+ "invalidEmail": "Invalid email format"
+ },
+ "offline": {
+ "banner": "You are offline. Some features may not be available."
+ }
+}
\ No newline at end of file
diff --git a/apps/mobile-app/i18n/locales/nl.json b/apps/mobile-app/i18n/locales/nl.json
new file mode 100644
index 000000000..27d3d1e28
--- /dev/null
+++ b/apps/mobile-app/i18n/locales/nl.json
@@ -0,0 +1,137 @@
+{
+ "common": {
+ "cancel": "Annuleren",
+ "delete": "Verwijderen",
+ "save": "Opslaan",
+ "edit": "Bewerken",
+ "yes": "Ja",
+ "no": "Nee",
+ "ok": "OK",
+ "loading": "Laden...",
+ "error": "Fout",
+ "success": "Succes",
+ "required": "Vereist",
+ "optional": "Optioneel",
+ "never": "Nooit",
+ "untitled": "Naamloos",
+ "copy": "Kopiëren",
+ "copied": "Gekopieerd",
+ "version": "Versie"
+ },
+ "auth": {
+ "login": "Inloggen",
+ "logout": "Uitloggen",
+ "username": "Gebruikersnaam of e-mail",
+ "password": "Wachtwoord",
+ "authCode": "Authenticatiecode",
+ "unlock": "Ontgrendelen",
+ "unlocking": "Ontgrendelen...",
+ "unlockingVault": "Kluis ontgrendelen",
+ "loggingIn": "Inloggen",
+ "validatingCredentials": "Gegevens valideren",
+ "syncingVault": "Kluis synchroniseren",
+ "verifyingAuthCode": "Authenticatiecode verifiëren",
+ "verify": "Verifiëren",
+ "unlockVault": "Kluis Ontgrendelen",
+ "enterPassword": "Voer uw wachtwoord in om uw kluis te ontgrendelen",
+ "enterPasswordPlaceholder": "Wachtwoord",
+ "enterAuthCode": "Voer 6-cijferige code in",
+ "usernamePlaceholder": "naam / [email protected]",
+ "passwordPlaceholder": "Voer uw wachtwoord in",
+ "enableBiometric": "{{biometric}} inschakelen?",
+ "biometricPrompt": "Wilt u {{biometric}} gebruiken om uw kluis te ontgrendelen?",
+ "tryBiometricAgain": "Probeer {{biometric}} Opnieuw",
+ "authCodeNote": "Opmerking: als u geen toegang heeft tot uw authenticator-apparaat, kunt u uw 2FA resetten met een herstelcode door in te loggen via de website.",
+ "noAccountYet": "Nog geen account?",
+ "errors": {
+ "credentialsRequired": "Gebruikersnaam en wachtwoord zijn vereist",
+ "invalidAuthCode": "Voer een geldige 6-cijferige authenticatiecode in",
+ "incorrectPassword": "Onjuist wachtwoord. Probeer het opnieuw.",
+ "enterPassword": "Voer uw wachtwoord in"
+ },
+ "confirmLogout": "Weet u zeker dat u wilt uitloggen? U moet opnieuw inloggen met uw hoofdwachtwoord om toegang te krijgen tot uw kluis."
+ },
+ "credentials": {
+ "addCredential": "Referentie Toevoegen",
+ "editCredential": "Referentie Bewerken",
+ "deleteCredential": "Referentie Verwijderen",
+ "deleteConfirm": "Weet u zeker dat u deze referentie wilt verwijderen? Deze actie kan niet ongedaan worden gemaakt.",
+ "credentialOptions": "Referentie Opties",
+ "service": "Service",
+ "serviceName": "Service Naam",
+ "serviceUrl": "Service URL",
+ "loginCredentials": "Inloggegevens",
+ "username": "Gebruikersnaam",
+ "email": "E-mail",
+ "alias": "Alias",
+ "metadata": "Metadata",
+ "firstName": "Voornaam",
+ "lastName": "Achternaam",
+ "nickName": "Bijnaam",
+ "gender": "Geslacht",
+ "birthDate": "Geboortedatum",
+ "birthDatePlaceholder": "JJJJ-MM-DD",
+ "notes": "Notities",
+ "randomAlias": "Willekeurige Alias",
+ "manual": "Handmatig",
+ "generateRandomAlias": "Genereer Willekeurige Alias",
+ "actions": {
+ "copyUsername": "Kopieer Gebruikersnaam",
+ "copyEmail": "Kopieer E-mail",
+ "copyPassword": "Kopieer Wachtwoord"
+ },
+ "toasts": {
+ "usernameCopied": "Gebruikersnaam gekopieerd naar klembord",
+ "emailCopied": "E-mail gekopieerd naar klembord",
+ "passwordCopied": "Wachtwoord gekopieerd naar klembord",
+ "credentialUpdated": "Referentie succesvol bijgewerkt",
+ "credentialCreated": "Referentie succesvol aangemaakt"
+ },
+ "errors": {
+ "loadFailed": "Laden van referentie mislukt",
+ "generateUsernameFailed": "Genereren van gebruikersnaam mislukt",
+ "generatePasswordFailed": "Genereren van wachtwoord mislukt"
+ }
+ },
+ "settings": {
+ "title": "Instellingen",
+ "iosAutofill": "iOS Automatisch Invullen",
+ "androidAutofill": "Android Automatisch Invullen",
+ "vaultUnlock": "Kluis Ontgrendel Methode",
+ "autoLock": "Automatisch Vergrendelen Timeout",
+ "identityGenerator": "Identiteit Generator",
+ "security": "Beveiliging",
+ "appVersion": "App versie {{version}} ({{url}})",
+ "autoLockOptions": {
+ "5seconds": "5 seconden",
+ "30seconds": "30 seconden",
+ "1minute": "1 minuut",
+ "15minutes": "15 minuten",
+ "30minutes": "30 minuten",
+ "1hour": "1 uur",
+ "4hours": "4 uur",
+ "8hours": "8 uur"
+ },
+ "language": "Taal",
+ "systemLanguage": "Systeemtaal",
+ "languageSystemMessage": "Om de app-taal te wijzigen, openen we iOS Instellingen waar u de gewenste taal voor AliasVault kunt configureren.",
+ "openSettings": "Open Instellingen"
+ },
+ "navigation": {
+ "credentials": "Referenties",
+ "emails": "E-mails",
+ "settings": "Instellingen",
+ "notFound": "Deze pagina bestaat niet.",
+ "oops": "Oeps!",
+ "goBack": "Ga terug naar de hoofdpagina"
+ },
+ "validation": {
+ "serviceNameRequired": "Service naam is vereist",
+ "invalidUrl": "Ongeldig URL formaat",
+ "invalidDate": "Datum moet in JJJJ-MM-DD formaat zijn",
+ "invalidEmail": "Ongeldig e-mail formaat"
+ },
+ "offline": {
+ "banner": "U bent offline. Sommige functies zijn mogelijk niet beschikbaar."
+ }
+}
\ No newline at end of file
diff --git a/apps/mobile-app/ios/AliasVault.xcodeproj/project.pbxproj b/apps/mobile-app/ios/AliasVault.xcodeproj/project.pbxproj
index d6efbaf6b..202fad502 100644
--- a/apps/mobile-app/ios/AliasVault.xcodeproj/project.pbxproj
+++ b/apps/mobile-app/ios/AliasVault.xcodeproj/project.pbxproj
@@ -188,7 +188,7 @@
/* End PBXFileReference section */
/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
- CEE9098F2DA548C7008D568F /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = {
+ CEE9098F2DA548C7008D568F /* Exceptions for "Autofill" folder in "Autofill" target */ = {
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
membershipExceptions = (
Info.plist,
@@ -198,11 +198,62 @@
/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */
/* Begin PBXFileSystemSynchronizedRootGroup section */
- CEE480882DBE86DC00F4A367 /* VaultStoreKit */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = VaultStoreKit; sourceTree = "<group>"; };
- CEE480972DBE86DD00F4A367 /* VaultStoreKitTests */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = VaultStoreKitTests; sourceTree = "<group>"; };
- CEE4816B2DBE8AC800F4A367 /* VaultUI */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = VaultUI; sourceTree = "<group>"; };
- CEE482AB2DBE8EFE00F4A367 /* VaultModels */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = VaultModels; sourceTree = "<group>"; };
- CEE909812DA548C7008D568F /* Autofill */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (CEE9098F2DA548C7008D568F /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = Autofill; sourceTree = "<group>"; };
+ CEE480882DBE86DC00F4A367 /* VaultStoreKit */ = {
+ isa = PBXFileSystemSynchronizedRootGroup;
+ exceptions = (
+ );
+ explicitFileTypes = {
+ };
+ explicitFolders = (
+ );
+ path = VaultStoreKit;
+ sourceTree = "<group>";
+ };
+ CEE480972DBE86DD00F4A367 /* VaultStoreKitTests */ = {
+ isa = PBXFileSystemSynchronizedRootGroup;
+ exceptions = (
+ );
+ explicitFileTypes = {
+ };
+ explicitFolders = (
+ );
+ path = VaultStoreKitTests;
+ sourceTree = "<group>";
+ };
+ CEE4816B2DBE8AC800F4A367 /* VaultUI */ = {
+ isa = PBXFileSystemSynchronizedRootGroup;
+ exceptions = (
+ );
+ explicitFileTypes = {
+ };
+ explicitFolders = (
+ );
+ path = VaultUI;
+ sourceTree = "<group>";
+ };
+ CEE482AB2DBE8EFE00F4A367 /* VaultModels */ = {
+ isa = PBXFileSystemSynchronizedRootGroup;
+ exceptions = (
+ );
+ explicitFileTypes = {
+ };
+ explicitFolders = (
+ );
+ path = VaultModels;
+ sourceTree = "<group>";
+ };
+ CEE909812DA548C7008D568F /* Autofill */ = {
+ isa = PBXFileSystemSynchronizedRootGroup;
+ exceptions = (
+ CEE9098F2DA548C7008D568F /* Exceptions for "Autofill" folder in "Autofill" target */,
+ );
+ explicitFileTypes = {
+ };
+ explicitFolders = (
+ );
+ path = Autofill;
+ sourceTree = "<group>";
+ };
/* End PBXFileSystemSynchronizedRootGroup section */
/* Begin PBXFrameworksBuildPhase section */
@@ -700,6 +751,7 @@
"${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/EXConstants.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/ExpoConstants_privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/ExpoFileSystem/ExpoFileSystem_privacy.bundle",
+ "${PODS_CONFIGURATION_BUILD_DIR}/ExpoLocalization/ExpoLocalization_privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/ExpoSystemUI/ExpoSystemUI_privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/RCT-Folly/RCT-Folly_privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/RNCAsyncStorage/RNCAsyncStorage_resources.bundle",
@@ -715,6 +767,7 @@
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXConstants.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoConstants_privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoFileSystem_privacy.bundle",
+ "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoLocalization_privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoSystemUI_privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RCT-Folly_privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNCAsyncStorage_resources.bundle",
@@ -1161,7 +1214,10 @@
LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift\"$(inherited)\"";
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
- OTHER_LDFLAGS = "$(inherited) ";
+ OTHER_LDFLAGS = (
+ "$(inherited)",
+ " ",
+ );
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
@@ -1215,7 +1271,10 @@
);
LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift\"$(inherited)\"";
MTL_ENABLE_DEBUG_INFO = NO;
- OTHER_LDFLAGS = "$(inherited) ";
+ OTHER_LDFLAGS = (
+ "$(inherited)",
+ " ",
+ );
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
USE_HERMES = true;
diff --git a/apps/mobile-app/ios/AliasVault/en.lproj/Localizable.strings b/apps/mobile-app/ios/AliasVault/en.lproj/Localizable.strings
new file mode 100644
index 000000000..cb91a32b8
--- /dev/null
+++ b/apps/mobile-app/ios/AliasVault/en.lproj/Localizable.strings
@@ -0,0 +1,29 @@
+/* English localization strings for iOS native components */
+"loading_error" = "Loading Error";
+"loading_error_message" = "Loading credentials went wrong. Please open the AliasVault app to check for updates.";
+"ok" = "OK";
+"login_required" = "Login Required";
+"login_required_message" = "To use Autofill, please login to your AliasVault account in the AliasVault app.";
+"biometric_required" = "%@ Required";
+"biometric_required_message" = "To use AliasVault Autofill, please enable %@ in your device settings and/or go to the AliasVault app settings to configure it.";
+"biometric_app_required_message" = "To use Autofill, please enable %@ as your vault unlock method in the AliasVault app settings.";
+"loading_credentials" = "Loading credentials...";
+"no_credentials_found" = "No credentials found";
+"no_credentials_match" = "No existing credentials match your search";
+"create_new_credential" = "Create New Credential";
+"select_credential" = "Select Credential";
+"select_text_to_insert" = "Select Text to Insert";
+"cancel" = "Cancel";
+"choose_username" = "Choose Username";
+"select_text_to_insert_message" = "Select the text to insert into the focused input field";
+"choose_username_message" = "This website may require either your username or your email address to log in";
+"username_prefix" = "Username: ";
+"email_prefix" = "Email: ";
+"password" = "Password";
+"error" = "Error";
+"credentials_load_error" = "Failed to load credentials. Please open the AliasVault app to check for updates.";
+"no_credential_selected" = "No credential selected.";
+"failed_to_load_credentials" = "Failed to load credentials";
+"face_id_touch_id" = "Face ID / Touch ID";
+"face_id" = "Face ID";
+"touch_id" = "Touch ID";
\ No newline at end of file
diff --git a/apps/mobile-app/ios/AliasVault/nl.lproj/Localizable.strings b/apps/mobile-app/ios/AliasVault/nl.lproj/Localizable.strings
new file mode 100644
index 000000000..528e43570
--- /dev/null
+++ b/apps/mobile-app/ios/AliasVault/nl.lproj/Localizable.strings
@@ -0,0 +1,29 @@
+// Dutch localization strings for iOS native components
+"loading_error" = "Laadprobleem";
+"loading_error_message" = "Het laden van referenties ging mis. Open de AliasVault app om te controleren op updates.";
+"ok" = "OK";
+"login_required" = "Inloggen Vereist";
+"login_required_message" = "Om Automatisch Invullen te gebruiken, log eerst in op uw AliasVault account in de AliasVault app.";
+"biometric_required" = "%@ Vereist";
+"biometric_required_message" = "Om AliasVault Automatisch Invullen te gebruiken, schakel %@ in bij uw apparaat instellingen en/of ga naar de AliasVault app instellingen om het te configureren.";
+"biometric_app_required_message" = "Om Automatisch Invullen te gebruiken, schakel %@ in als uw kluis ontgrendel methode in de AliasVault app instellingen.";
+"loading_credentials" = "Referenties laden...";
+"no_credentials_found" = "Geen referenties gevonden";
+"no_credentials_match" = "Geen bestaande referenties komen overeen met uw zoekopdracht";
+"create_new_credential" = "Nieuwe Referentie Aanmaken";
+"select_credential" = "Selecteer Referentie";
+"select_text_to_insert" = "Selecteer Tekst om In te Voegen";
+"cancel" = "Annuleren";
+"choose_username" = "Kies Gebruikersnaam";
+"select_text_to_insert_message" = "Selecteer de tekst om in te voegen in het gefocuste invoerveld";
+"choose_username_message" = "Deze website vereist mogelijk uw gebruikersnaam of e-mailadres om in te loggen";
+"username_prefix" = "Gebruikersnaam: ";
+"email_prefix" = "E-mail: ";
+"password" = "Wachtwoord";
+"error" = "Fout";
+"credentials_load_error" = "Laden van referenties mislukt. Open de AliasVault app om te controleren op updates.";
+"no_credential_selected" = "Geen referentie geselecteerd.";
+"failed_to_load_credentials" = "Laden van referenties mislukt";
+"face_id_touch_id" = "Face ID / Touch ID";
+"face_id" = "Face ID";
+"touch_id" = "Touch ID";
\ No newline at end of file
diff --git a/apps/mobile-app/ios/Autofill/CredentialProviderViewController.swift b/apps/mobile-app/ios/Autofill/CredentialProviderViewController.swift
index bfedfdd9d..8623153bf 100644
--- a/apps/mobile-app/ios/Autofill/CredentialProviderViewController.swift
+++ b/apps/mobile-app/ios/Autofill/CredentialProviderViewController.swift
@@ -52,15 +52,15 @@ public class CredentialProviderViewController: ASCredentialProviderViewControlle
} catch {
print("Failed to setup view: \(error)")
let alert = UIAlertController(
- title: "Loading Error",
- message: "Loading credentials went wrong. Please open the AliasVault app to check for updates.",
+ title: NSLocalizedString("loading_error", comment: ""),
+ message: NSLocalizedString("loading_error_message", comment: ""),
preferredStyle: .alert
)
- alert.addAction(UIAlertAction(title: "OK", style: .default) { [weak self] _ in
+ alert.addAction(UIAlertAction(title: NSLocalizedString("ok", comment: ""), style: .default) { [weak self] _ in
self?.extensionContext.cancelRequest(withError: NSError(
domain: ASExtensionErrorDomain,
code: ASExtensionError.failed.rawValue,
- userInfo: [NSLocalizedDescriptionKey: "Failed to load credentials"]
+ userInfo: [NSLocalizedDescriptionKey: NSLocalizedString("failed_to_load_credentials", comment: "")]
))
})
present(alert, animated: true)
@@ -179,11 +179,11 @@ public class CredentialProviderViewController: ASCredentialProviderViewControlle
private func sanityChecks(vaultStore: VaultStore) -> Bool {
if !vaultStore.hasEncryptedDatabase {
let alert = UIAlertController(
- title: "Login Required",
- message: "To use Autofill, please login to your AliasVault account in the AliasVault app.",
+ title: NSLocalizedString("login_required", comment: ""),
+ message: NSLocalizedString("login_required_message", comment: ""),
preferredStyle: .alert
)
- alert.addAction(UIAlertAction(title: "OK", style: .default) { [weak self] _ in
+ alert.addAction(UIAlertAction(title: NSLocalizedString("ok", comment: ""), style: .default) { [weak self] _ in
self?.extensionContext.cancelRequest(withError: NSError(
domain: ASExtensionErrorDomain,
code: ASExtensionError.userCanceled.rawValue
@@ -195,7 +195,7 @@ public class CredentialProviderViewController: ASCredentialProviderViewControlle
// Check if Face ID/Touch ID is enabled
let context = LAContext()
- var authMethod = "Face ID / Touch ID"
+ var authMethod = NSLocalizedString("face_id_touch_id", comment: "")
var biometricsAvailable = false
var biometricsError: NSError?
@@ -204,9 +204,9 @@ public class CredentialProviderViewController: ASCredentialProviderViewControlle
biometricsAvailable = true
switch context.biometryType {
case .faceID:
- authMethod = "Face ID"
+ authMethod = NSLocalizedString("face_id", comment: "")
case .touchID:
- authMethod = "Touch ID"
+ authMethod = NSLocalizedString("touch_id", comment: "")
default:
break
}
@@ -215,11 +215,11 @@ public class CredentialProviderViewController: ASCredentialProviderViewControlle
// First check if biometrics are available on the device
if !biometricsAvailable {
let alert = UIAlertController(
- title: "\(authMethod) Required",
- message: "To use AliasVault Autofill, please enable \(authMethod) in your device settings and/or go to the AliasVault app settings to configure it.",
+ title: String(format: NSLocalizedString("biometric_required", comment: ""), authMethod),
+ message: String(format: NSLocalizedString("biometric_required_message", comment: ""), authMethod),
preferredStyle: .alert
)
- alert.addAction(UIAlertAction(title: "OK", style: .default) { [weak self] _ in
+ alert.addAction(UIAlertAction(title: NSLocalizedString("ok", comment: ""), style: .default) { [weak self] _ in
self?.extensionContext.cancelRequest(withError: NSError(
domain: ASExtensionErrorDomain,
code: ASExtensionError.userCanceled.rawValue
@@ -232,11 +232,11 @@ public class CredentialProviderViewController: ASCredentialProviderViewControlle
// Then check if Face ID/Touch ID is enabled in the app settings
if !vaultStore.getAuthMethods().contains(.faceID) {
let alert = UIAlertController(
- title: "\(authMethod) Required",
- message: "To use Autofill, please enable \(authMethod) as your vault unlock method in the AliasVault app settings.",
+ title: String(format: NSLocalizedString("biometric_required", comment: ""), authMethod),
+ message: String(format: NSLocalizedString("biometric_app_required_message", comment: ""), authMethod),
preferredStyle: .alert
)
- alert.addAction(UIAlertAction(title: "OK", style: .default) { [weak self] _ in
+ alert.addAction(UIAlertAction(title: NSLocalizedString("ok", comment: ""), style: .default) { [weak self] _ in
self?.extensionContext.cancelRequest(withError: NSError(
domain: ASExtensionErrorDomain,
code: ASExtensionError.userCanceled.rawValue
diff --git a/apps/mobile-app/ios/Podfile.lock b/apps/mobile-app/ios/Podfile.lock
index 07e9dd0b2..d7574c10c 100644
--- a/apps/mobile-app/ios/Podfile.lock
+++ b/apps/mobile-app/ios/Podfile.lock
@@ -238,6 +238,8 @@ PODS:
- ExpoModulesCore
- ExpoLocalAuthentication (15.0.2):
- ExpoModulesCore
+ - ExpoLocalization (16.1.6):
+ - ExpoModulesCore
- ExpoModulesCore (2.2.3):
- DoubleConversion
- glog
@@ -2233,6 +2235,7 @@ DEPENDENCIES:
- ExpoLinearGradient (from `../node_modules/expo-linear-gradient/ios`)
- ExpoLinking (from `../node_modules/expo-linking/ios`)
- ExpoLocalAuthentication (from `../node_modules/expo-local-authentication/ios`)
+ - ExpoLocalization (from `../node_modules/expo-localization/ios`)
- ExpoModulesCore (from `../node_modules/expo-modules-core`)
- ExpoSharing (from `../node_modules/expo-sharing/ios`)
- ExpoSplashScreen (from `../node_modules/expo-splash-screen/ios`)
@@ -2374,6 +2377,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/expo-linking/ios"
ExpoLocalAuthentication:
:path: "../node_modules/expo-local-authentication/ios"
+ ExpoLocalization:
+ :path: "../node_modules/expo-localization/ios"
ExpoModulesCore:
:path: "../node_modules/expo-modules-core"
ExpoSharing:
@@ -2563,6 +2568,7 @@ SPEC CHECKSUMS:
ExpoLinearGradient: 35ebd83b16f80b3add053a2fd68cc328ed927f60
ExpoLinking: 8d12bee174ba0cdf31239706578e29e74a417402
ExpoLocalAuthentication: eb2be9c7bcdc68e9434d4be4bb5aa5cf7943e816
+ ExpoLocalization: 999a1ff61a7f5917d65c2bd9234883009019ca9f
ExpoModulesCore: c25d77625038b1968ea1afefc719862c0d8dd993
ExpoSharing: 849a5ce9985c22598c16ec027e32969be8062e8e
ExpoSplashScreen: 8261985ce9778f904abc7e31bed3538dce67ed4d
diff --git a/apps/mobile-app/ios/VaultUI/Views/CredentialProviderView.swift b/apps/mobile-app/ios/VaultUI/Views/CredentialProviderView.swift
index ddc6a8095..b9631d8da 100644
--- a/apps/mobile-app/ios/VaultUI/Views/CredentialProviderView.swift
+++ b/apps/mobile-app/ios/VaultUI/Views/CredentialProviderView.swift
@@ -30,7 +30,7 @@ public struct CredentialProviderView: View {
if viewModel.isLoading {
Spacer()
- ProgressView("Loading credentials...")
+ ProgressView(NSLocalizedString("loading_credentials", comment: ""))
.progressViewStyle(.circular)
.scaleEffect(1.5)
Spacer()
@@ -42,11 +42,11 @@ public struct CredentialProviderView: View {
.font(.system(size: 50))
.foregroundColor(colorScheme == .dark ? ColorConstants.Dark.text : ColorConstants.Light.text)
- Text("No credentials found")
+ Text(NSLocalizedString("no_credentials_found", comment: ""))
.font(.headline)
.foregroundColor(colorScheme == .dark ? ColorConstants.Dark.text : ColorConstants.Light.text)
- Text("No existing credentials match your search")
+ Text(NSLocalizedString("no_credentials_match", comment: ""))
.font(.subheadline)
.foregroundColor(colorScheme == .dark ? ColorConstants.Dark.text : ColorConstants.Light.text)
.multilineTextAlignment(.center)
@@ -65,7 +65,7 @@ public struct CredentialProviderView: View {
}, label: {
HStack {
Image(systemName: "plus.circle.fill")
- Text("Create New Credential")
+ Text(NSLocalizedString("create_new_credential", comment: ""))
}
.padding()
.frame(maxWidth: .infinity)
@@ -98,11 +98,11 @@ public struct CredentialProviderView: View {
}
}
}
- .navigationTitle(viewModel.isChoosingTextToInsert ? "Select Text to Insert" : "Select Credential")
+ .navigationTitle(viewModel.isChoosingTextToInsert ? NSLocalizedString("select_text_to_insert", comment: "") : NSLocalizedString("select_credential", comment: ""))
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .navigationBarLeading) {
- Button("Cancel") {
+ Button(NSLocalizedString("cancel", comment: "")) {
viewModel.cancel()
}
.foregroundColor(ColorConstants.Light.primary)
@@ -128,25 +128,25 @@ public struct CredentialProviderView: View {
.actionSheet(isPresented: $viewModel.showSelectionOptions) {
// Define all text strings
guard let credential = viewModel.selectedCredential else {
- return ActionSheet(title: Text("Choose Username"), message: Text("No credential selected."), buttons: [.cancel()])
+ return ActionSheet(title: Text(NSLocalizedString("choose_username", comment: "")), message: Text(NSLocalizedString("no_credential_selected", comment: "")), buttons: [.cancel()])
}
var buttons: [ActionSheet.Button] = []
if viewModel.isChoosingTextToInsert {
if let username = credential.username, !username.isEmpty {
- buttons.append(.default(Text("Username: \(username)")) {
+ buttons.append(.default(Text(NSLocalizedString("username_prefix", comment: "") + username)) {
viewModel.selectUsername()
})
}
if let email = credential.alias?.email, !email.isEmpty {
- buttons.append(.default(Text("Email: \(email)")) {
+ buttons.append(.default(Text(NSLocalizedString("email_prefix", comment: "") + email)) {
viewModel.selectEmail()
})
}
- buttons.append(.default(Text("Password")) {
+ buttons.append(.default(Text(NSLocalizedString("password", comment: ""))) {
viewModel.selectPassword()
})
} else {
@@ -166,13 +166,13 @@ public struct CredentialProviderView: View {
buttons.append(.cancel())
return ActionSheet(
- title: viewModel.isChoosingTextToInsert ? Text("Select Text To Insert") : Text("Choose Username"),
- message: viewModel.isChoosingTextToInsert ? Text("Select the text to insert into the focused input field") : Text("This website may require either your username or your email address to log in"),
+ title: viewModel.isChoosingTextToInsert ? Text(NSLocalizedString("select_text_to_insert", comment: "")) : Text(NSLocalizedString("choose_username", comment: "")),
+ message: viewModel.isChoosingTextToInsert ? Text(NSLocalizedString("select_text_to_insert_message", comment: "")) : Text(NSLocalizedString("choose_username_message", comment: "")),
buttons: buttons
)
}
- .alert("Error", isPresented: $viewModel.showError) {
- Button("OK") {
+ .alert(NSLocalizedString("error", comment: ""), isPresented: $viewModel.showError) {
+ Button(NSLocalizedString("ok", comment: "")) {
viewModel.dismissError()
}
} message: {
@@ -241,7 +241,7 @@ public class CredentialProviderViewModel: ObservableObject {
isLoading = false
} catch {
isLoading = false
- errorMessage = "Failed to load credentials. Please open the AliasVault app to check for updates."
+ errorMessage = NSLocalizedString("credentials_load_error", comment: "")
showError = true
}
}
diff --git a/apps/mobile-app/package-lock.json b/apps/mobile-app/package-lock.json
index 70b286bcc..4a074a246 100644
--- a/apps/mobile-app/package-lock.json
+++ b/apps/mobile-app/package-lock.json
@@ -24,6 +24,7 @@
"expo-linear-gradient": "~14.0.2",
"expo-linking": "~7.0.5",
"expo-local-authentication": "~15.0.2",
+ "expo-localization": "^16.1.6",
"expo-router": "~4.0.20",
"expo-sharing": "~13.0.1",
"expo-splash-screen": "~0.29.24",
@@ -33,10 +34,12 @@
"expo-system-ui": "~4.0.9",
"expo-web-browser": "~14.0.2",
"fbemitter": "^3.0.0",
+ "i18next": "^25.3.2",
"otpauth": "^9.4.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-hook-form": "^7.56.1",
+ "react-i18next": "^15.6.0",
"react-native": "0.76.9",
"react-native-aes-gcm-crypto": "^0.2.2",
"react-native-argon2": "^2.0.1",
@@ -2170,9 +2173,9 @@
}
},
"node_modules/@babel/runtime": {
- "version": "7.27.1",
- "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.1.tgz",
- "integrity": "sha512-1x3D2xEk2fRo3PAhwQwu5UubzgiVWSXTBfWpVd2Mx2AzRqJuDJCsgaDVZ7HB5iGzDW1Hl1sWN2mFyKjmR9uAog==",
+ "version": "7.27.6",
+ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.6.tgz",
+ "integrity": "sha512-vbavdySgbTTrmFE+EsiqUTzlOr5bzlnJtUv9PynGCAKvfQqjIXbvFdumPM/GxMDfyuGMJaJAU6TO4zc1Jf1i8Q==",
"license": "MIT",
"engines": {
"node": ">=6.9.0"
@@ -11234,6 +11237,19 @@
"expo": "*"
}
},
+ "node_modules/expo-localization": {
+ "version": "16.1.6",
+ "resolved": "https://registry.npmjs.org/expo-localization/-/expo-localization-16.1.6.tgz",
+ "integrity": "sha512-v4HwNzs8QvyKHwl40MvETNEKr77v1o9/eVC8WCBY++DIlBAvonHyJe2R9CfqpZbC4Tlpl7XV+07nLXc8O5PQsA==",
+ "license": "MIT",
+ "dependencies": {
+ "rtl-detect": "^1.0.2"
+ },
+ "peerDependencies": {
+ "expo": "*",
+ "react": "*"
+ }
+ },
"node_modules/expo-manifests": {
"version": "0.15.8",
"resolved": "https://registry.npmjs.org/expo-manifests/-/expo-manifests-0.15.8.tgz",
@@ -12638,6 +12654,15 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/html-parse-stringify": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz",
+ "integrity": "sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==",
+ "license": "MIT",
+ "dependencies": {
+ "void-elements": "3.1.0"
+ }
+ },
"node_modules/http-errors": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
@@ -12707,6 +12732,37 @@
"integrity": "sha512-WDC/ui2VVRrz3jOVi+XtjqkDjiVjTtFaAGiW37k6b+ohyQ5wYDOGkvCZa8+H0nx3gyvv0+BST9xuOgIyGQ00gw==",
"license": "BSD-3-Clause"
},
+ "node_modules/i18next": {
+ "version": "25.3.2",
+ "resolved": "https://registry.npmjs.org/i18next/-/i18next-25.3.2.tgz",
+ "integrity": "sha512-JSnbZDxRVbphc5jiptxr3o2zocy5dEqpVm9qCGdJwRNO+9saUJS0/u4LnM/13C23fUEWxAylPqKU/NpMV/IjqA==",
+ "funding": [
+ {
+ "type": "individual",
+ "url": "https://locize.com"
+ },
+ {
+ "type": "individual",
+ "url": "https://locize.com/i18next.html"
+ },
+ {
+ "type": "individual",
+ "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "@babel/runtime": "^7.27.6"
+ },
+ "peerDependencies": {
+ "typescript": "^5"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
"node_modules/iconv-lite": {
"version": "0.6.3",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
@@ -17767,6 +17823,32 @@
"react": "^16.8.0 || ^17 || ^18 || ^19"
}
},
+ "node_modules/react-i18next": {
+ "version": "15.6.0",
+ "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-15.6.0.tgz",
+ "integrity": "sha512-W135dB0rDfiFmbMipC17nOhGdttO5mzH8BivY+2ybsQBbXvxWIwl3cmeH3T9d+YPBSJu/ouyJKFJTtkK7rJofw==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/runtime": "^7.27.6",
+ "html-parse-stringify": "^3.0.1"
+ },
+ "peerDependencies": {
+ "i18next": ">= 23.2.3",
+ "react": ">= 16.8.0",
+ "typescript": "^5"
+ },
+ "peerDependenciesMeta": {
+ "react-dom": {
+ "optional": true
+ },
+ "react-native": {
+ "optional": true
+ },
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
"node_modules/react-is": {
"version": "19.1.0",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-19.1.0.tgz",
@@ -18604,6 +18686,12 @@
"node": ">= 18"
}
},
+ "node_modules/rtl-detect": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/rtl-detect/-/rtl-detect-1.1.2.tgz",
+ "integrity": "sha512-PGMBq03+TTG/p/cRB7HCLKJ1MgDIi07+QU1faSjiYRfmY5UsAttV9Hs08jDAHVwcOwmVLcSJkpwyfXszVjWfIQ==",
+ "license": "BSD-3-Clause"
+ },
"node_modules/run-parallel": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
@@ -20987,6 +21075,15 @@
"integrity": "sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w==",
"license": "MIT"
},
+ "node_modules/void-elements": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz",
+ "integrity": "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/w3c-xmlserializer": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz",
diff --git a/apps/mobile-app/package.json b/apps/mobile-app/package.json
index a979f6a63..a49022246 100644
--- a/apps/mobile-app/package.json
+++ b/apps/mobile-app/package.json
@@ -45,6 +45,7 @@
"expo-linear-gradient": "~14.0.2",
"expo-linking": "~7.0.5",
"expo-local-authentication": "~15.0.2",
+ "expo-localization": "^16.1.6",
"expo-router": "~4.0.20",
"expo-sharing": "~13.0.1",
"expo-splash-screen": "~0.29.24",
@@ -54,10 +55,12 @@
"expo-system-ui": "~4.0.9",
"expo-web-browser": "~14.0.2",
"fbemitter": "^3.0.0",
+ "i18next": "^25.3.2",
"otpauth": "^9.4.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-hook-form": "^7.56.1",
+ "react-i18next": "^15.6.0",
"react-native": "0.76.9",
"react-native-aes-gcm-crypto": "^0.2.2",
"react-native-argon2": "^2.0.1",