623 Remove common translation file
This commit is contained in:
@@ -16,9 +16,12 @@ import { useTranslation } from 'react-i18next'
|
||||
const PasswordPrompt = ({ enableShowApp }) => {
|
||||
const [password, setPassword] = useState(null)
|
||||
|
||||
const { t } = useTranslation()
|
||||
const { t } = useTranslation(null, { keyPrefix: 'password' })
|
||||
|
||||
const cancelButton = { text: t('common:cancel'), style: 'cancel' }
|
||||
const cancelButton = {
|
||||
text: t('forgotPasswordDialog.cancel'),
|
||||
style: 'cancel',
|
||||
}
|
||||
|
||||
const unlockApp = async () => {
|
||||
const hash = new SHA512().hex(password)
|
||||
@@ -26,11 +29,11 @@ const PasswordPrompt = ({ enableShowApp }) => {
|
||||
|
||||
if (!connected) {
|
||||
Alert.alert(
|
||||
t('common:incorrectPassword'),
|
||||
t('common:incorrectPasswordMessage'),
|
||||
t('incorrectPasswordDialog.incorrectPassword'),
|
||||
t('incorrectPasswordDialog.incorrectPasswordMessage'),
|
||||
[
|
||||
{
|
||||
text: t('common:tryAgain'),
|
||||
text: t('incorrectPasswordDialog.tryAgain'),
|
||||
onPress: () => setPassword(null),
|
||||
},
|
||||
]
|
||||
@@ -47,31 +50,23 @@ const PasswordPrompt = ({ enableShowApp }) => {
|
||||
}
|
||||
|
||||
const onDeleteData = () => {
|
||||
Alert.alert(
|
||||
t('password.confirmationDialog.title'),
|
||||
t('password.confirmationDialog.text'),
|
||||
[
|
||||
cancelButton,
|
||||
{
|
||||
text: t('password.confirmationDialog.confirm'),
|
||||
onPress: onDeleteDataConfirmation,
|
||||
},
|
||||
]
|
||||
)
|
||||
Alert.alert(t('confirmationDialog.title'), t('confirmationDialog.text'), [
|
||||
cancelButton,
|
||||
{
|
||||
text: t('confirmationDialog.confirm'),
|
||||
onPress: onDeleteDataConfirmation,
|
||||
},
|
||||
])
|
||||
}
|
||||
|
||||
const onConfirmDeletion = async () => {
|
||||
Alert.alert(
|
||||
t('password.forgotPassword'),
|
||||
t('password.forgotPasswordDialog.text'),
|
||||
[
|
||||
cancelButton,
|
||||
{
|
||||
text: t('password.forgotPasswordDialog.confirm'),
|
||||
onPress: onDeleteData,
|
||||
},
|
||||
]
|
||||
)
|
||||
Alert.alert(t('forgotPassword'), t('forgotPasswordDialog.text'), [
|
||||
cancelButton,
|
||||
{
|
||||
text: t('forgotPasswordDialog.confirm'),
|
||||
onPress: onDeleteData,
|
||||
},
|
||||
])
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -82,14 +77,12 @@ const PasswordPrompt = ({ enableShowApp }) => {
|
||||
<AppTextInput
|
||||
onChangeText={setPassword}
|
||||
secureTextEntry
|
||||
placeholder={t('password.enterPassword')}
|
||||
placeholder={t('enterPassword')}
|
||||
/>
|
||||
<View style={styles.containerButtons}>
|
||||
<Button onPress={onConfirmDeletion}>
|
||||
{t('password.forgotPassword')}
|
||||
</Button>
|
||||
<Button onPress={onConfirmDeletion}>{t('forgotPassword')}</Button>
|
||||
<Button disabled={!password} isCTA={!!password} onPress={unlockApp}>
|
||||
{t('password.unlockApp')}
|
||||
{t('unlockApp')}
|
||||
</Button>
|
||||
</View>
|
||||
</KeyboardAvoidingView>
|
||||
|
||||
@@ -141,9 +141,15 @@
|
||||
"enterPassword": "Enter password here",
|
||||
"forgotPassword": "Forgot your password?",
|
||||
"forgotPasswordDialog": {
|
||||
"cancel": "Cancel",
|
||||
"confirm": "Yes, delete all my data",
|
||||
"text": "If you've forgotten your password, unfortunately, there is nothing we can do to recover your data, because it is encrypted with the password only you know. You can, however, delete all your encrypted data and start fresh. Once all data has been erased, you can set a new password in the settings, if you like."
|
||||
},
|
||||
"incorrectPasswordDialog": {
|
||||
"incorrectPassword": "Password incorrect",
|
||||
"incorrectPasswordMessage": "That password is incorrect.",
|
||||
"tryAgain": "Try again"
|
||||
},
|
||||
"unlockApp": "Unlock app"
|
||||
},
|
||||
"stats": {
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"cancel": "Cancel",
|
||||
"incorrectPassword": "Password incorrect",
|
||||
"incorrectPasswordMessage": "That password is incorrect.",
|
||||
"tryAgain": "Try again"
|
||||
}
|
||||
+1
-2
@@ -3,10 +3,9 @@ import { initReactI18next } from 'react-i18next'
|
||||
|
||||
// translation files
|
||||
import en from './en.json'
|
||||
import enCommon from './en/common.json'
|
||||
|
||||
const resources = {
|
||||
en: { common: enCommon, translation: en },
|
||||
en: { translation: en },
|
||||
}
|
||||
|
||||
i18n
|
||||
|
||||
Reference in New Issue
Block a user