diff --git a/src/components/PDFView/PDFPasswordForm.tsx b/src/components/PDFView/PDFPasswordForm.tsx index 4b6491addbef..d37bd4d0f87b 100644 --- a/src/components/PDFView/PDFPasswordForm.tsx +++ b/src/components/PDFView/PDFPasswordForm.tsx @@ -11,6 +11,7 @@ import useThemeStyles from '@hooks/useThemeStyles'; import * as Browser from '@libs/Browser'; import shouldDelayFocus from '@libs/shouldDelayFocus'; import CONST from '@src/CONST'; +import type {TranslationPaths} from '@src/languages/types'; import PDFInfoMessage from './PDFInfoMessage'; type PDFPasswordFormProps = { @@ -39,7 +40,7 @@ function PDFPasswordForm({isFocused, isPasswordInvalid = false, shouldShowLoadin const {translate} = useLocalize(); const [password, setPassword] = useState(''); - const [validationErrorText, setValidationErrorText] = useState(''); + const [validationErrorText, setValidationErrorText] = useState(''); const [shouldShowForm, setShouldShowForm] = useState(false); const textInputRef = useRef(null); @@ -50,7 +51,7 @@ function PDFPasswordForm({isFocused, isPasswordInvalid = false, shouldShowLoadin return translate('attachmentView.passwordIncorrect'); } if (validationErrorText) { - return validationErrorText; + return translate(validationErrorText); } return ''; }, [isPasswordInvalid, validationErrorText, translate]); @@ -90,7 +91,7 @@ function PDFPasswordForm({isFocused, isPasswordInvalid = false, shouldShowLoadin return true; } if (!password) { - setValidationErrorText(translate('attachmentView.passwordRequired')); + setValidationErrorText('attachmentView.passwordRequired'); } return false; };