From 74df1ba25ca4e38ac23acd599f7a2e6e3924e51f Mon Sep 17 00:00:00 2001 From: Abhinav Date: Sun, 2 Apr 2023 09:26:48 +0530 Subject: [PATCH] fix password strength strings --- public/locales/en/translation.json | 6 ++++-- src/components/PasswordStrength.tsx | 4 +++- src/constants/crypto/index.ts | 6 +++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index d2e3c3f34..e488479c4 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -547,7 +547,9 @@ "FACE_SEARCH_CONFIRMATION": "I understand, and wish to allow ente to process face geometry", "LABS": "Labs", "YOURS": "yours", - "PASSPHRASE_STRENGTH": "Password strength: {{passwordStrength}}", + "PASSPHRASE_STRENGTH_WEAK": "Password strength: Weak", + "PASSPHRASE_STRENGTH_MODERATE": "Password strength: Moderate", + "PASSPHRASE_STRENGTH_STRONG": "Password strength: Strong", "PREFERENCES": "Preferences", "LANGUAGE": "Language", "EXPORT_DIRECTORY_DOES_NOT_EXIST": "Invalid export directory", @@ -589,4 +591,4 @@ "TOTAL_ITEMS": "Total items", "PENDING_ITEMS": "Pending items", "EXPORT_STARTING": "Export starting..." -} \ No newline at end of file +} diff --git a/src/components/PasswordStrength.tsx b/src/components/PasswordStrength.tsx index a96374d3e..fa1d1c0d1 100644 --- a/src/components/PasswordStrength.tsx +++ b/src/components/PasswordStrength.tsx @@ -28,7 +28,9 @@ export const PasswordStrengthHint = ({ })} textAlign={'left'} flex={1}> - {password ? t('PASSPHRASE_STRENGTH', { passwordStrength }) : ''} + {password + ? t('PASSPHRASE_STRENGTH', { context: passwordStrength }) + : ''} ); diff --git a/src/constants/crypto/index.ts b/src/constants/crypto/index.ts index fd9a31733..e39e67503 100644 --- a/src/constants/crypto/index.ts +++ b/src/constants/crypto/index.ts @@ -1,7 +1,7 @@ export const ENCRYPTION_CHUNK_SIZE = 4 * 1024 * 1024; export enum PasswordStrength { - WEAK, - MODERATE, - STRONG, + WEAK = 'WEAK', + MODERATE = 'MODERATE', + STRONG = 'STRONG', }