Skip to content

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

Refactor structure and cleanup unused translations (#1338)

Leendert de Borst534d82990dd0
diff --git a/apps/browser-extension/.gitignore b/apps/browser-extension/.gitignore
index 718d286bf..940e4b7c0 100644
--- a/apps/browser-extension/.gitignore
+++ b/apps/browser-extension/.gitignore
@@ -17,8 +17,6 @@ stats-*.json
web-ext.config.ts
# Editor directories and files
-.vscode/*
-!.vscode/extensions.json
.idea
.DS_Store
*.suo
diff --git a/apps/browser-extension/.vscode/settings.json b/apps/browser-extension/.vscode/settings.json
new file mode 100644
index 000000000..d5f17b4b0
--- /dev/null
+++ b/apps/browser-extension/.vscode/settings.json
@@ -0,0 +1,7 @@
+{
+ "i18n-ally.localesPaths": [
+ "src/i18n",
+ "src/i18n/locales"
+ ],
+ "i18n-ally.keystyle": "nested",
+}
diff --git a/apps/browser-extension/src/entrypoints/background/VaultMessageHandler.ts b/apps/browser-extension/src/entrypoints/background/VaultMessageHandler.ts
index f7cd07c80..199f4a218 100644
--- a/apps/browser-extension/src/entrypoints/background/VaultMessageHandler.ts
+++ b/apps/browser-extension/src/entrypoints/background/VaultMessageHandler.ts
@@ -126,7 +126,7 @@ export async function handleStoreEncryptionKey(
return { success: true };
} catch (error) {
console.error('Failed to store encryption key:', error);
- return { success: false, error: await t('common.errors.failedToStoreEncryptionKey') };
+ return { success: false, error: await t('common.errors.unknownErrorTryAgain') };
}
}
@@ -141,7 +141,7 @@ export async function handleStoreEncryptionKeyDerivationParams(
return { success: true };
} catch (error) {
console.error('Failed to store encryption key derivation params:', error);
- return { success: false, error: await t('common.errors.failedToStoreEncryptionParams') };
+ return { success: false, error: await t('common.errors.unknownErrorTryAgain') };
}
}
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Dialogs/HelpModal.tsx b/apps/browser-extension/src/entrypoints/popup/components/Dialogs/HelpModal.tsx
index 51363328c..f24be5456 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Dialogs/HelpModal.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Dialogs/HelpModal.tsx
@@ -2,8 +2,8 @@ import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
type HelpModalProps = {
- titleKey: string;
- contentKey: string;
+ title: string;
+ content: string;
className?: string;
}
@@ -11,7 +11,7 @@ type HelpModalProps = {
* Reusable help modal component with a question mark icon button.
* Shows a modal popup with help information when clicked.
*/
-const HelpModal: React.FC<HelpModalProps> = ({ titleKey, contentKey, className = '' }) => {
+const HelpModal: React.FC<HelpModalProps> = ({ title, content, className = '' }) => {
const { t } = useTranslation();
const [showModal, setShowModal] = useState(false);
@@ -43,7 +43,7 @@ const HelpModal: React.FC<HelpModalProps> = ({ titleKey, contentKey, className =
<div className="bg-white dark:bg-gray-800 rounded-lg p-6 max-w-sm w-full">
<div className="flex items-center justify-between mb-4">
<h3 className="text-lg font-semibold text-gray-900 dark:text-white">
- {t(titleKey)}
+ {title}
</h3>
<button
onClick={() => setShowModal(false)}
@@ -66,7 +66,7 @@ const HelpModal: React.FC<HelpModalProps> = ({ titleKey, contentKey, className =
</button>
</div>
<p className="text-sm text-gray-600 dark:text-gray-300">
- {t(contentKey)}
+ {content}
</p>
<button
onClick={() => setShowModal(false)}
diff --git a/apps/browser-extension/src/entrypoints/popup/components/Unlock/UsernameAvatar.tsx b/apps/browser-extension/src/entrypoints/popup/components/Unlock/UsernameAvatar.tsx
index 0c304219c..51751a201 100644
--- a/apps/browser-extension/src/entrypoints/popup/components/Unlock/UsernameAvatar.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/components/Unlock/UsernameAvatar.tsx
@@ -5,28 +5,25 @@ import { useAuth } from '@/entrypoints/popup/context/AuthContext';
/**
* Username avatar component that shows the avatar and username.
+ * Displays centered above the unlock form.
*/
const UsernameAvatar: React.FC = () => {
const { t } = useTranslation();
const { username } = useAuth();
return (
- <div className="flex items-center space-x-3 mb-6">
- <div className="flex-shrink-0">
- <div className="w-10 h-10 rounded-full bg-primary-100 dark:bg-primary-900 flex items-center justify-center">
- <span className="text-primary-600 dark:text-primary-400 text-lg font-medium">
- {username?.[0]?.toUpperCase() || '?'}
- </span>
- </div>
- </div>
- <div>
- <p className="font-medium text-gray-900 dark:text-white">
- {username}
- </p>
- <p className="text-sm text-gray-500 dark:text-gray-400">
- {t('auth.loggedIn')}
- </p>
+ <div className="flex flex-col items-center mb-6">
+ <div className="w-12 h-12 rounded-full bg-primary-100 dark:bg-primary-900 flex items-center justify-center mb-3">
+ <span className="text-primary-600 dark:text-primary-400 text-2xl font-medium">
+ {username?.[0]?.toUpperCase() || '?'}
+ </span>
</div>
+ <p className="font-medium text-gray-900 dark:text-white text-base">
+ {username}
+ </p>
+ <p className="text-sm text-gray-500 dark:text-gray-400">
+ {t('auth.loggedIn')}
+ </p>
</div>
);
};
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/auth/AuthSettings.tsx b/apps/browser-extension/src/entrypoints/popup/pages/auth/AuthSettings.tsx
index b0d3c2cc5..496427bcb 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/auth/AuthSettings.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/auth/AuthSettings.tsx
@@ -26,7 +26,7 @@ const DEFAULT_OPTIONS: ApiOption[] = [
*/
const createUrlSchema = (t: (key: string) => string): Yup.ObjectSchema<{apiUrl: string; clientUrl: string}> => Yup.object().shape({
apiUrl: Yup.string()
- .required(t('validation.apiUrlRequired'))
+ .required(t('settings.validation.apiUrlRequired'))
.test('is-valid-api-url', t('settings.validation.apiUrlInvalid'), (value: string | undefined) => {
if (!value) {
return true; // Allow empty for non-custom option
@@ -39,7 +39,7 @@ const createUrlSchema = (t: (key: string) => string): Yup.ObjectSchema<{apiUrl:
}
}),
clientUrl: Yup.string()
- .required(t('validation.clientUrlRequired'))
+ .required(t('settings.validation.clientUrlRequired'))
.test('is-valid-client-url', t('settings.validation.clientUrlInvalid'), (value: string | undefined) => {
if (!value) {
return true; // Allow empty for non-custom option
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/auth/Unlock.tsx b/apps/browser-extension/src/entrypoints/popup/pages/auth/Unlock.tsx
index 08e2b75d8..e8300f0ed 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/auth/Unlock.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/auth/Unlock.tsx
@@ -384,104 +384,93 @@ const Unlock: React.FC = () => {
// Render PIN unlock UI
if (unlockMode === 'pin') {
return (
- <div ref={containerRef} className="flex flex-col items-center justify-center p-4 bg-gray-50 dark:bg-gray-900">
+ <div ref={containerRef} className="flex flex-col items-center justify-center p-4">
<div className="w-full max-w-md">
{/* User Avatar and Username Section */}
<UsernameAvatar />
- {/* Logo */}
- <div className="text-center mb-4">
- <h1 className="text-xl font-bold text-gray-900 dark:text-white mb-1">
- {t('auth.unlockTitle')}
- </h1>
- <p className="text-sm text-gray-600 dark:text-gray-400">
- {t('auth.enterPinToUnlock')}
- </p>
- </div>
-
- {/* PIN Dots Display */}
- <div className="flex justify-center gap-2 mb-4">
- {pinDots}
- </div>
+ {/* Main Content Card */}
+ <div className="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6">
+ {/* Title */}
+ <div className="text-center mb-4">
+ <h1 className="text-xl font-bold text-gray-900 dark:text-white mb-1">
+ {t('auth.unlockTitle')}
+ </h1>
+ <p className="text-sm text-gray-600 dark:text-gray-400">
+ {t('auth.enterPinToUnlock')}
+ </p>
+ </div>
- {/* Error Message */}
- {error && (
- <div className="mb-3 p-2 bg-red-100 dark:bg-red-900/30 border border-red-300 dark:border-red-700 rounded-md text-red-800 dark:text-red-300 text-xs text-center">
- {error}
+ {/* PIN Dots Display */}
+ <div className="flex justify-center gap-2 mb-4">
+ {pinDots}
</div>
- )}
- {/* Hidden Input for Keyboard Entry */}
- <input
- ref={inputRef}
- type="password"
- inputMode="numeric"
- pattern="[0-9]*"
- maxLength={8}
- value={pin}
- onChange={(e) => handlePinChange(e.target.value.replace(/\D/g, ''))}
- className="w-0 h-0 opacity-0 absolute"
- autoFocus
- aria-label="PIN input"
- />
-
- {/* On-Screen Numpad */}
- <div className="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-4 mb-3">
- <div className="grid grid-cols-3 gap-2">
- {/* Numbers 1-9 */}
- {[1, 2, 3, 4, 5, 6, 7, 8, 9].map((num) => (
+ {/* Error Message */}
+ {error && (
+ <div className="mb-3 p-2 bg-red-100 dark:bg-red-900/30 border border-red-300 dark:border-red-700 rounded-md text-red-800 dark:text-red-300 text-xs text-center">
+ {error}
+ </div>
+ )}
+
+ {/* Hidden Input for Keyboard Entry */}
+ <input
+ ref={inputRef}
+ type="password"
+ inputMode="numeric"
+ pattern="[0-9]*"
+ maxLength={8}
+ value={pin}
+ onChange={(e) => handlePinChange(e.target.value.replace(/\D/g, ''))}
+ className="w-0 h-0 opacity-0 absolute"
+ autoFocus
+ aria-label="PIN input"
+ />
+
+ {/* On-Screen Numpad */}
+ <div className="mb-4">
+ <div className="grid grid-cols-3 gap-2">
+ {/* Numbers 1-9 */}
+ {[1, 2, 3, 4, 5, 6, 7, 8, 9].map((num) => (
+ <button
+ key={num}
+ type="button"
+ onClick={() => handleNumpadClick(num.toString())}
+ className="h-12 flex items-center justify-center text-xl font-semibold bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-900 dark:text-white rounded-lg transition-colors active:scale-95"
+ >
+ {num}
+ </button>
+ ))}
+
+ {/* Empty space, 0, Backspace */}
+ <div />
<button
- key={num}
type="button"
- onClick={() => handleNumpadClick(num.toString())}
- className="h-16 flex items-center justify-center text-xl font-semibold bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-900 dark:text-white rounded-lg transition-colors active:scale-95"
+ onClick={() => handleNumpadClick('0')}
+ className="h-12 flex items-center justify-center text-xl font-semibold bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-900 dark:text-white rounded-lg transition-colors active:scale-95"
>
- {num}
+ 0
</button>
- ))}
-
- {/* Empty space, 0, Backspace */}
- <div />
- <button
- type="button"
- onClick={() => handleNumpadClick('0')}
- className="h-16 flex items-center justify-center text-xl font-semibold bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-900 dark:text-white rounded-lg transition-colors active:scale-95"
- >
- 0
- </button>
- <button
- type="button"
- onClick={handleBackspace}
- className="h-16 flex items-center justify-center bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-900 dark:text-white rounded-lg transition-colors active:scale-95"
- aria-label="Backspace"
- >
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2M3 12l6.414 6.414a2 2 0 001.414.586H19a2 2 0 002-2V7a2 2 0 00-2-2h-8.172a2 2 0 00-1.414.586L3 12z" />
- </svg>
- </button>
+ <button
+ type="button"
+ onClick={handleBackspace}
+ className="h-12 flex items-center justify-center bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-900 dark:text-white rounded-lg transition-colors active:scale-95"
+ aria-label="Backspace"
+ >
+ <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2M3 12l6.414 6.414a2 2 0 001.414.586H19a2 2 0 002-2V7a2 2 0 00-2-2h-8.172a2 2 0 00-1.414.586L3 12z" />
+ </svg>
+ </button>
+ </div>
</div>
</div>
- {/* Divider */}
- <div className="flex items-center gap-3 my-3">
- <div className="flex-1 border-t border-gray-300 dark:border-gray-600" />
- <span className="text-xs text-gray-500 dark:text-gray-400">{t('common.or')}</span>
- <div className="flex-1 border-t border-gray-300 dark:border-gray-600" />
- </div>
-
{/* Use Password Button */}
- <button
- type="button"
- onClick={switchToPassword}
- className="w-full bg-gray-500 hover:bg-gray-600 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline transition-colors text-sm"
- >
- {t('auth.useMasterPassword')}
- </button>
-
- {/* Tip */}
- <p className="mt-2 text-center text-xs text-gray-500 dark:text-gray-400">
- {t('auth.pinUnlockTip')}
- </p>
+ <div className="mt-4">
+ <div className="text-center text-sm text-gray-500 dark:text-gray-400 mt-6">
+ <button type="button" onClick={switchToPassword} className="text-primary-600 hover:text-primary-700 dark:text-primary-500 dark:hover:text-primary-400 hover:underline font-medium">{t('auth.useMasterPassword')}</button>
+ </div>
+ </div>
</div>
</div>
);
@@ -489,74 +478,76 @@ const Unlock: React.FC = () => {
// Render password unlock UI
return (
- <div>
- <form onSubmit={handlePasswordSubmit} className="bg-white dark:bg-gray-700 w-full shadow-md rounded px-8 pt-6 pb-8 mb-4">
+ <div className="flex flex-col items-center justify-center p-4">
+ <div className="w-full max-w-md">
{/* User Avatar and Username Section */}
<UsernameAvatar />
- {/* Instruction Title */}
- <h2 className="text-xl font-semibold text-gray-900 dark:text-white mb-4">
- {t('auth.unlockTitle')}
- </h2>
-
- {error && (
- <div className="mb-4 text-red-500 dark:text-red-400">
- {error}
+ {/* Main Content Card */}
+ <form onSubmit={handlePasswordSubmit} className="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6">
+ {/* Title */}
+ <div className="text-center mb-6">
+ <h1 className="text-xl font-bold text-gray-900 dark:text-white">
+ {t('auth.unlockTitle')}
+ </h1>
</div>
- )}
- <div className="mb-2">
- <label className="block text-gray-700 dark:text-gray-200 font-bold mb-2" htmlFor="password">
- {t('auth.masterPassword')}
- </label>
- <div className="relative">
- <input
- className="shadow appearance-none border rounded w-full py-2 px-3 pr-10 text-gray-700 dark:text-gray-200 dark:bg-gray-800 dark:border-gray-600 mb-3 leading-tight focus:outline-none focus:shadow-outline"
- id="password"
- type={showPassword ? "text" : "password"}
- value={password}
- onChange={(e) => setPassword(e.target.value)}
- placeholder={t('auth.passwordPlaceholder')}
- required
- autoFocus
- />
- <button
- type="button"
- className="absolute right-2 top-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"
- onClick={() => setShowPassword(!showPassword)}
- tabIndex={-1}
- >
- <HeaderIcon type={showPassword ? HeaderIconType.EYE_OFF : HeaderIconType.EYE} className="w-5 h-5 text-gray-400 dark:text-gray-500" />
- </button>
- </div>
- </div>
+ {/* Error Message */}
+ {error && (
+ <div className="mb-4 p-2 bg-red-100 dark:bg-red-900/30 border border-red-300 dark:border-red-700 rounded-md text-red-800 dark:text-red-300 text-xs text-center">
+ {error}
+ </div>
+ )}
- <Button type="submit">
- {t('auth.unlockVault')}
- </Button>
-
- {/* Switch to PIN button if PIN is available */}
- {pinAvailable && (
- <>
- <div className="flex items-center gap-3 my-4">
- <div className="flex-1 border-t border-gray-300 dark:border-gray-600" />
- <span className="text-xs text-gray-500 dark:text-gray-400">{t('common.or')}</span>
- <div className="flex-1 border-t border-gray-300 dark:border-gray-600" />
+ <div className="mb-4">
+ <label className="block text-gray-700 dark:text-gray-200 font-medium mb-2" htmlFor="password">
+ {t('auth.masterPassword')}
+ </label>
+ <div className="relative">
+ <input
+ className="shadow appearance-none border rounded-lg w-full py-2 px-3 pr-10 text-gray-700 dark:text-gray-200 dark:bg-gray-700 dark:border-gray-600 leading-tight focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent"
+ id="password"
+ type={showPassword ? "text" : "password"}
+ value={password}
+ onChange={(e) => setPassword(e.target.value)}
+ placeholder={t('auth.passwordPlaceholder')}
+ required
+ autoFocus
+ />
+ <button
+ type="button"
+ className="absolute right-2 top-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"
+ onClick={() => setShowPassword(!showPassword)}
+ tabIndex={-1}
+ >
+ <HeaderIcon type={showPassword ? HeaderIconType.EYE_OFF : HeaderIconType.EYE} className="w-5 h-5 text-gray-400 dark:text-gray-500" />
+ </button>
</div>
- <button
- type="button"
- onClick={switchToPin}
- className="w-full bg-gray-500 hover:bg-gray-600 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline transition-colors"
- >
- {t('auth.unlockWithPin')}
- </button>
- </>
- )}
-
- <div className="font-medium text-gray-500 dark:text-gray-200 mt-6">
- {t('auth.switchAccounts')} <button type="button" onClick={handleLogout} className="text-primary-700 hover:underline dark:text-primary-500">{t('auth.logout')}</button>
- </div>
- </form>
+ </div>
+
+ <Button type="submit">
+ {t('auth.unlockVault')}
+ </Button>
+
+ {/* Switch to PIN button if PIN is available */}
+ {pinAvailable && (
+ <>
+ <div className="flex items-center gap-3 my-4">
+ <div className="flex-1 border-t border-gray-300 dark:border-gray-600" />
+ <span className="text-xs text-gray-500 dark:text-gray-400">{t('common.or')}</span>
+ <div className="flex-1 border-t border-gray-300 dark:border-gray-600" />
+ </div>
+ <Button type="button" onClick={switchToPin} variant="secondary">
+ {t('auth.unlockWithPin')}
+ </Button>
+ </>
+ )}
+
+ <div className="text-center text-sm text-gray-500 dark:text-gray-400 mt-6">
+ {t('auth.switchAccounts')} <button type="button" onClick={handleLogout} className="text-primary-600 hover:text-primary-700 dark:text-primary-500 dark:hover:text-primary-400 hover:underline font-medium">{t('auth.logout')}</button>
+ </div>
+ </form>
+ </div>
</div>
);
};
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/emails/EmailDetails.tsx b/apps/browser-extension/src/entrypoints/popup/pages/emails/EmailDetails.tsx
index b2790f549..abd0a1719 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/emails/EmailDetails.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/emails/EmailDetails.tsx
@@ -158,7 +158,7 @@ const EmailDetails: React.FC = (): React.ReactElement => {
)}
<HeaderButton
onClick={() => setShowDeleteModal(true)}
- title={t('emails.deleteEmail')}
+ title={t('emails.deleteEmailTitle')}
iconType={HeaderIconType.DELETE}
variant="danger"
/>
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/settings/AutoLockSettings.tsx b/apps/browser-extension/src/entrypoints/popup/pages/settings/AutoLockSettings.tsx
index f6268a6ea..25ed337aa 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/settings/AutoLockSettings.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/settings/AutoLockSettings.tsx
@@ -50,8 +50,8 @@ const AutoLockSettings: React.FC = () => {
<div className="flex items-center mb-2">
<p className="font-medium text-gray-900 dark:text-white">{t('settings.autoLockTimeout')}</p>
<HelpModal
- titleKey="settings.autoLockTimeout"
- contentKey="settings.autoLockTimeoutHelp"
+ title={t('settings.autoLockTimeout')}
+ content={t('settings.autoLockTimeoutHelp')}
className="ml-2"
/>
</div>
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/settings/AutofillSettings.tsx b/apps/browser-extension/src/entrypoints/popup/pages/settings/AutofillSettings.tsx
index cd0054b0c..312e59d58 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/settings/AutofillSettings.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/settings/AutofillSettings.tsx
@@ -180,7 +180,7 @@ const AutofillSettings: React.FC = () => {
: 'bg-red-500 hover:bg-red-600 text-white'
}`}
>
- {settings.isGloballyEnabled ? t('settings.enabled') : t('settings.disabled')}
+ {settings.isGloballyEnabled ? t('common.enabled') : t('common.disabled')}
</button>
</div>
</div>
@@ -214,7 +214,7 @@ const AutofillSettings: React.FC = () => {
: 'bg-red-500 hover:bg-red-600 text-white'
}`}
>
- {settings.isEnabled ? t('settings.enabled') : t('settings.disabled')}
+ {settings.isEnabled ? t('common.enabled') : t('common.disabled')}
</button>
)}
</div>
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/settings/ContextMenuSettings.tsx b/apps/browser-extension/src/entrypoints/popup/pages/settings/ContextMenuSettings.tsx
index fe69f7d33..3284a5a53 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/settings/ContextMenuSettings.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/settings/ContextMenuSettings.tsx
@@ -65,7 +65,7 @@ const ContextMenuSettings: React.FC = () => {
: 'bg-red-500 hover:bg-red-600 text-white'
}`}
>
- {isContextMenuEnabled ? t('settings.enabled') : t('settings.disabled')}
+ {isContextMenuEnabled ? t('common.enabled') : t('common.disabled')}
</button>
</div>
</div>
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/settings/PasskeySettings.tsx b/apps/browser-extension/src/entrypoints/popup/pages/settings/PasskeySettings.tsx
index a07fec064..f477d7a0d 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/settings/PasskeySettings.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/settings/PasskeySettings.tsx
@@ -147,7 +147,7 @@ const PasskeySettings: React.FC = () => {
: 'bg-red-500 hover:bg-red-600 text-white'
}`}
>
- {settings.isGloballyEnabled ? t('settings.enabled') : t('settings.disabled')}
+ {settings.isGloballyEnabled ? t('common.enabled') : t('common.disabled')}
</button>
</div>
</div>
@@ -176,7 +176,7 @@ const PasskeySettings: React.FC = () => {
: 'bg-red-500 hover:bg-red-600 text-white'
}`}
>
- {settings.isEnabled ? t('settings.enabled') : t('settings.disabled')}
+ {settings.isEnabled ? t('common.enabled') : t('common.disabled')}
</button>
)}
</div>
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/settings/Settings.tsx b/apps/browser-extension/src/entrypoints/popup/pages/settings/Settings.tsx
index c0d8c2657..66295710d 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/settings/Settings.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/settings/Settings.tsx
@@ -1,6 +1,7 @@
import React, { useEffect, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom';
+import { sendMessage } from 'webext-bridge/popup';
import HeaderButton from '@/entrypoints/popup/components/HeaderButton';
import { HeaderIconType } from '@/entrypoints/popup/components/Icons/HeaderIcons';
@@ -14,7 +15,6 @@ import { PopoutUtility } from '@/entrypoints/popup/utils/PopoutUtility';
import { AppInfo } from '@/utils/AppInfo';
import { browser, storage } from "#imports";
-import { sendMessage } from 'webext-bridge/popup';
/**
* Settings page component.
@@ -550,10 +550,10 @@ const Settings: React.FC = () => {
<div className="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
<div className="bg-white dark:bg-gray-800 rounded-lg p-6 max-w-sm w-full mx-4">
<h3 className="text-lg font-semibold text-gray-900 dark:text-white mb-3">
- {t('settings.logoutConfirmTitle')}
+ {t('auth.logout')}
</h3>
<p className="text-sm text-gray-600 dark:text-gray-400 mb-6">
- {t('settings.logoutConfirmMessage')}
+ {t('auth.logoutConfirm')}
</p>
<div className="flex gap-3">
<button
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/settings/VaultUnlockSettings.tsx b/apps/browser-extension/src/entrypoints/popup/pages/settings/VaultUnlockSettings.tsx
index bdbd2984e..c5b844dd6 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/settings/VaultUnlockSettings.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/settings/VaultUnlockSettings.tsx
@@ -2,8 +2,6 @@ import React, { useEffect, useState, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import Button from '@/entrypoints/popup/components/Button';
-import HelpModal from '@/entrypoints/popup/components/Dialogs/HelpModal';
-import { useAuth } from '@/entrypoints/popup/context/AuthContext';
import { useDb } from '@/entrypoints/popup/context/DbContext';
import { useLoading } from '@/entrypoints/popup/context/LoadingContext';
@@ -12,7 +10,6 @@ import {
setupPin,
disablePin,
isValidPin,
- getFailedAttempts,
isPinLocked
} from '@/utils/PinUnlockService';
@@ -21,7 +18,6 @@ import {
*/
const VaultUnlockSettings: React.FC = () => {
const { t } = useTranslation();
- const authContext = useAuth();
const dbContext = useDb();
const { setIsInitialLoading, showLoading, hideLoading } = useLoading();
@@ -32,7 +28,6 @@ const VaultUnlockSettings: React.FC = () => {
const [pinSetupStep, setPinSetupStep] = useState<number>(1); // 1 = enter, 2 = confirm
const [newPin, setNewPin] = useState<string>('');
const [confirmPin, setConfirmPin] = useState<string>('');
- const [failedAttempts, setFailedAttempts] = useState<number>(0);
const [isLocked, setIsLocked] = useState<boolean>(false);
/**
@@ -40,19 +35,17 @@ const VaultUnlockSettings: React.FC = () => {
*/
const loadSettings = useCallback(async (): Promise<void> => {
try {
- const [enabled, attempts, locked] = await Promise.all([
+ const [enabled, locked] = await Promise.all([
isPinEnabled(),
- getFailedAttempts(),
isPinLocked()
]);
setPinEnabled(enabled);
- setFailedAttempts(attempts);
setIsLocked(locked);
setIsInitialLoading(false);
} catch (err: any) {
console.error('Failed to load PIN settings:', err);
- setError(t('settings.unlockMethod.loadError'));
+ setError(t('common.errors.unknownErrorTryAgain'));
setIsInitialLoading(false);
}
}, [setIsInitialLoading, t]);
@@ -70,7 +63,7 @@ const VaultUnlockSettings: React.FC = () => {
// Check if we have the encryption key in memory
if (!dbContext.dbAvailable) {
- setError(t('settings.unlockMethod.unlockVaultFirst'));
+ setError(t('common.errors.unknownErrorTryAgain'));
return;
}
@@ -136,7 +129,7 @@ const VaultUnlockSettings: React.FC = () => {
hideLoading();
} catch (err: any) {
console.error('Failed to enable PIN:', err);
- setError(err.message || t('settings.unlockMethod.enableError'));
+ setError(t('common.errors.unknownErrorTryAgain'));
hideLoading();
}
};
@@ -153,22 +146,19 @@ const VaultUnlockSettings: React.FC = () => {
await disablePin();
setPinEnabled(false);
setIsLocked(false);
- setFailedAttempts(0);
- setSuccess(t('settings.unlockMethod.disableSuccess'));
hideLoading();
} catch (err: any) {
console.error('Failed to disable PIN:', err);
- setError(t('settings.unlockMethod.disableError'));
+ setError(t('common.errors.unknownErrorTryAgain'));
hideLoading();
}
};
-
return (
<>
<div>
<p className="text-sm text-gray-600 dark:text-gray-400">
- {t('settings.unlockMethod.helpText')}
+ {t('settings.unlockMethod.introText')}
</p>
</div>
<div className="mt-6">
@@ -217,7 +207,7 @@ const VaultUnlockSettings: React.FC = () => {
: 'bg-red-500 hover:bg-red-600 text-white'
}`}
>
- {pinEnabled && !isLocked ? t('settings.enabled') : t('settings.disabled')}
+ {pinEnabled && !isLocked ? t('common.enabled') : t('common.disabled')}
</button>
</div>
</div>
@@ -238,7 +228,7 @@ const VaultUnlockSettings: React.FC = () => {
</div>
</div>
<div className="px-4 py-2 rounded-md bg-gray-300 text-gray-600 dark:bg-gray-600 dark:text-gray-300 cursor-not-allowed">
- {t('settings.enabled')}
+ {t('common.enabled')}
</div>
</div>
</div>
@@ -278,9 +268,6 @@ const VaultUnlockSettings: React.FC = () => {
</p>
<form onSubmit={handlePinSetupNext}>
<div className="mb-4">
- <label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
- {t('settings.unlockMethod.enterNewPin')}
- </label>
<input
type="password"
inputMode="numeric"
@@ -299,7 +286,7 @@ const VaultUnlockSettings: React.FC = () => {
</div>
)}
<Button type="submit">
- {t('settings.unlockMethod.next')}
+ {t('common.next')}
</Button>
</form>
</>
@@ -309,16 +296,13 @@ const VaultUnlockSettings: React.FC = () => {
{pinSetupStep === 2 && (
<>
<h3 className="text-lg font-semibold text-gray-900 dark:text-white mb-4 pr-8">
- {t('settings.unlockMethod.confirmPinTitle')}
+ {t('settings.unlockMethod.confirmPin')}
</h3>
<p className="text-sm text-gray-600 dark:text-gray-400 mb-4">
{t('settings.unlockMethod.confirmPinDescription')}
</p>
<form onSubmit={handlePinSetupSubmit}>
<div className="mb-4">
- <label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
- {t('settings.unlockMethod.confirmPin')}
- </label>
<input
type="password"
inputMode="numeric"
@@ -337,7 +321,7 @@ const VaultUnlockSettings: React.FC = () => {
</div>
)}
<Button type="submit">
- {t('settings.unlockMethod.confirm')}
+ {t('common.confirm')}
</Button>
</form>
</>
diff --git a/apps/browser-extension/src/i18n/locales/en.json b/apps/browser-extension/src/i18n/locales/en.json
index 0b9d40e09..90a2a2c64 100644
--- a/apps/browser-extension/src/i18n/locales/en.json
+++ b/apps/browser-extension/src/i18n/locales/en.json
@@ -55,24 +55,24 @@
"settings": "Settings"
},
"common": {
- "appName": "AliasVault",
"loading": "Loading...",
"error": "Error",
- "success": "Success",
"cancel": "Cancel",
"confirm": "Confirm",
"back": "Back",
+ "next": "Next",
"use": "Use",
"delete": "Delete",
"or": "Or",
"close": "Close",
"copied": "Copied!",
"openInNewWindow": "Open in new window",
- "language": "Language",
"enabled": "Enabled",
"disabled": "Disabled",
"showPassword": "Show password",
"hidePassword": "Hide password",
+ "showDetails": "Show details",
+ "hideDetails": "Hide details",
"copyToClipboard": "Copy to clipboard",
"loadingEmails": "Loading emails...",
"loadingTotpCodes": "Loading TOTP codes...",
@@ -105,6 +105,7 @@
"browserExtensionOutdated": "This browser extension is outdated and cannot be used to access this vault. Please update this browser extension to continue.",
"serverVersionNotSupported": "The AliasVault server needs to be updated to a newer version in order to use this browser extension. Please contact support if you need help.",
"unknownError": "An unknown error occurred",
+ "unknownErrorTryAgain": "An unknown error occurred. Please try again.",
"vaultNotAvailable": "Vault not available",
"failedToRetrieveData": "Failed to retrieve data",
"vaultIsLocked": "Vault is locked",
@@ -142,7 +143,6 @@
"or": "or",
"new": "New",
"cancel": "Cancel",
- "search": "Search",
"vaultLocked": "AliasVault is locked.",
"creatingNewAlias": "Creating new alias...",
"noMatchesFound": "No matches found",
@@ -173,7 +173,6 @@
"generateNewPassword": "Generate new password",
"togglePasswordVisibility": "Toggle password visibility",
"passwordCopiedToClipboard": "Password copied to clipboard",
- "enterEmailAndOrUsernameError": "Enter email and/or username",
"openAliasVaultToUpgrade": "Open AliasVault to upgrade",
"vaultUpgradeRequired": "Vault upgrade required.",
"dismissPopup": "Dismiss popup"
@@ -185,27 +184,14 @@
"deleteCredential": "Delete Credential",
"credentialDetails": "Credential Details",
"serviceName": "Service Name",
- "serviceNamePlaceholder": "e.g., Gmail, Facebook, Bank",
- "website": "Website",
- "websitePlaceholder": "https://example.com",
"username": "Username",
- "usernamePlaceholder": "Enter username",
"password": "Password",
- "passwordPlaceholder": "Enter password",
- "generatePassword": "Generate Password",
- "copyPassword": "Copy Password",
- "showPassword": "Show Password",
- "hidePassword": "Hide Password",
"notes": "Notes",
- "notesPlaceholder": "Additional notes...",
"totp": "Two-Factor Authentication",
"totpCode": "TOTP Code",
"copyTotp": "Copy TOTP",
"totpSecret": "TOTP Secret",
"totpSecretPlaceholder": "Enter TOTP secret key",
- "noCredentials": "No credentials found",
- "noCredentialsDescription": "Add your first credential to get started",
- "searchPlaceholder": "Search credentials...",
"welcomeTitle": "Welcome to AliasVault!",
"welcomeDescription": "To use the AliasVault browser extension: navigate to a website and use the AliasVault autofill popup to create a new credential.",
"noPasskeysFound": "No passkeys have been created yet. Passkeys are created by visiting a website that offers passkeys as an authentication method.",
@@ -213,16 +199,7 @@
"noMatchingCredentials": "No matching credentials found",
"createdAt": "Created",
"updatedAt": "Last updated",
- "autofill": "Autofill",
- "fillForm": "Fill Form",
- "deleteConfirm": "Are you sure you want to delete this credential?",
"saveSuccess": "Credential saved successfully",
- "tags": "Tags",
- "addTag": "Add Tag",
- "removeTag": "Remove Tag",
- "folder": "Folder",
- "selectFolder": "Select Folder",
- "createFolder": "Create Folder",
"saveCredential": "Save credential",
"deleteCredentialTitle": "Delete Credential",
"deleteCredentialConfirm": "Are you sure you want to delete this credential? This action cannot be undone.",
@@ -314,14 +291,10 @@
"loggedIn": "Logged in",
"logout": "Logout",
"lock": "Lock",
- "logoutConfirmTitle": "Confirm Logout",
- "logoutConfirmMessage": "Are you sure you want to logout? You will need to log in again to access your vault.",
"globalSettings": "Global Settings",
"autofillPopup": "Autofill popup",
"activeOnAllSites": "Active on all sites (unless disabled below)",
"disabledOnAllSites": "Disabled on all sites",
- "enabled": "Enabled",
- "disabled": "Disabled",
"rightClickContextMenu": "Right-click context menu",
"autofillMatching": "Autofill Matching",
"autofillMatchingMode": "Autofill matching mode",
@@ -343,7 +316,6 @@
"keyboardShortcuts": "Keyboard Shortcuts",
"configureKeyboardShortcuts": "Configure keyboard shortcuts",
"configure": "Configure",
- "security": "Security",
"clipboardClearTimeout": "Clear clipboard after copying",
"clipboardClearTimeoutDescription": "Automatically clear the clipboard after copying sensitive data",
"clipboardClearDisabled": "Never clear",
@@ -384,7 +356,6 @@
"autofillEnabledDescription": "Autofill suggestions will appear on login forms",
"autofillDisabledDescription": "Autofill suggestions are disabled globally",
"languageSettings": "Language",
- "languageSettingsDescription": "Choose your preferred language",
"validation": {
"apiUrlRequired": "API URL is required",
"apiUrlInvalid": "Please enter a valid API URL",
@@ -393,44 +364,20 @@
},
"unlockMethod": {
"title": "Vault Unlock Method",
- "methods": "Unlock Methods",
- "helpText": "Choose how you want to unlock your vault. You can use your master password (always available) or set up a quick 4-8 digit PIN for faster access. After 3 failed PIN attempts, you'll need to use your master password.",
+ "introText": "Choose how you want to unlock your vault. You can use your master password (always available) or set up a quick 4-8 digit PIN for faster access. After 3 failed PIN attempts, you'll need to use your master password.",
"password": "Master Password",
- "alwaysEnabled": "Always Enabled",
- "enabled": "Enabled",
- "disabled": "Disabled",
"pin": "PIN Code",
"pinDescription": "Unlock vault with PIN code",
- "pinEnabled": "Quick unlock with PIN enabled",
- "pinDisabled": "Use master password to unlock",
- "pinLockedDescription": "PIN locked after too many failed attempts",
- "enablePin": "Enable PIN Unlock",
- "disablePin": "Disable PIN Unlock",
- "testPin": "Test PIN",
"setupPin": "Setup PIN Code",
- "setupPinDescription": "Enter a 4-8 digit PIN that you'll use to quickly unlock your vault. Your vault encryption key will be encrypted with this PIN and stored locally.",
- "enterNewPin": "Enter new PIN (4-8 digits)",
+ "enterNewPin": "Enter new PIN",
"enterNewPinDescription": "Choose a 4-8 digit PIN code",
"confirmPin": "Confirm PIN",
- "confirmPinTitle": "Confirm Your PIN",
"confirmPinDescription": "Enter your PIN again to confirm",
- "confirm": "Confirm",
- "next": "Next",
- "back": "Back",
"pinPlaceholder": "••••",
- "enterPinToTest": "Enter your PIN to test:",
"invalidPinFormat": "PIN must be 4-8 digits",
"pinMismatch": "PINs do not match",
"enableSuccess": "PIN unlock enabled successfully!",
- "enableError": "Failed to enable PIN unlock. Please try again.",
- "disableSuccess": "PIN unlock disabled successfully.",
- "disableError": "Failed to disable PIN unlock. Please try again.",
- "testSuccess": "PIN is correct!",
- "testError": "Incorrect PIN.",
- "loadError": "Failed to load unlock method settings.",
- "unlockVaultFirst": "Please unlock your vault with your master password first.",
- "pinLocked": "PIN unlock has been disabled. Please use your master password to unlock your vault.",
- "failedAttempts": "failed attempts"
+ "pinLocked": "PIN unlock has been disabled. Please use your master password to unlock your vault."
}
},
"passkeys": {
@@ -485,21 +432,10 @@
"whatsNew": "What's New",
"whatsNewDescription": "An upgrade is required to support the following changes:",
"noDescriptionAvailable": "No description available for this version.",
- "okay": "Ok",
- "status": {
- "preparingUpgrade": "Preparing upgrade...",
- "vaultAlreadyUpToDate": "Vault is already up to date",
- "startingDatabaseTransaction": "Starting database transaction...",
- "applyingDatabaseMigrations": "Applying database migrations...",
- "applyingMigration": "Applying migration {{current}} of {{total}}...",
- "committingChanges": "Committing changes..."
- },
"alerts": {
- "error": "Error",
"unableToGetVersionInfo": "Unable to get version information. Please try again.",
"selfHostedServer": "Self-Hosted Server",
"selfHostedWarning": "If you're using a self-hosted server, make sure to also update your self-hosted instance as otherwise logging in to the web client will stop working.",
- "cancel": "Cancel",
"continueUpgrade": "Continue Upgrade",
"upgradeFailed": "Upgrade Failed",
"failedToApplyMigration": "Failed to apply migration ({{current}} of {{total}})"