623 Remove common translation file

This commit is contained in:
Lisa Hillebrand
2022-11-25 20:12:57 +01:00
parent b4f711e4db
commit cb33d93f8e
4 changed files with 32 additions and 40 deletions
+17 -24
View File
@@ -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'),
[
Alert.alert(t('confirmationDialog.title'), t('confirmationDialog.text'), [
cancelButton,
{
text: t('password.confirmationDialog.confirm'),
text: t('confirmationDialog.confirm'),
onPress: onDeleteDataConfirmation,
},
]
)
])
}
const onConfirmDeletion = async () => {
Alert.alert(
t('password.forgotPassword'),
t('password.forgotPasswordDialog.text'),
[
Alert.alert(t('forgotPassword'), t('forgotPasswordDialog.text'), [
cancelButton,
{
text: t('password.forgotPasswordDialog.confirm'),
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>
+6
View File
@@ -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": {
-6
View File
@@ -1,6 +0,0 @@
{
"cancel": "Cancel",
"incorrectPassword": "Password incorrect",
"incorrectPasswordMessage": "That password is incorrect.",
"tryAgain": "Try again"
}
+1 -2
View File
@@ -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