623 Remove common translation file
This commit is contained in:
@@ -16,9 +16,12 @@ import { useTranslation } from 'react-i18next'
|
|||||||
const PasswordPrompt = ({ enableShowApp }) => {
|
const PasswordPrompt = ({ enableShowApp }) => {
|
||||||
const [password, setPassword] = useState(null)
|
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 unlockApp = async () => {
|
||||||
const hash = new SHA512().hex(password)
|
const hash = new SHA512().hex(password)
|
||||||
@@ -26,11 +29,11 @@ const PasswordPrompt = ({ enableShowApp }) => {
|
|||||||
|
|
||||||
if (!connected) {
|
if (!connected) {
|
||||||
Alert.alert(
|
Alert.alert(
|
||||||
t('common:incorrectPassword'),
|
t('incorrectPasswordDialog.incorrectPassword'),
|
||||||
t('common:incorrectPasswordMessage'),
|
t('incorrectPasswordDialog.incorrectPasswordMessage'),
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
text: t('common:tryAgain'),
|
text: t('incorrectPasswordDialog.tryAgain'),
|
||||||
onPress: () => setPassword(null),
|
onPress: () => setPassword(null),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
@@ -47,31 +50,23 @@ const PasswordPrompt = ({ enableShowApp }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const onDeleteData = () => {
|
const onDeleteData = () => {
|
||||||
Alert.alert(
|
Alert.alert(t('confirmationDialog.title'), t('confirmationDialog.text'), [
|
||||||
t('password.confirmationDialog.title'),
|
|
||||||
t('password.confirmationDialog.text'),
|
|
||||||
[
|
|
||||||
cancelButton,
|
cancelButton,
|
||||||
{
|
{
|
||||||
text: t('password.confirmationDialog.confirm'),
|
text: t('confirmationDialog.confirm'),
|
||||||
onPress: onDeleteDataConfirmation,
|
onPress: onDeleteDataConfirmation,
|
||||||
},
|
},
|
||||||
]
|
])
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const onConfirmDeletion = async () => {
|
const onConfirmDeletion = async () => {
|
||||||
Alert.alert(
|
Alert.alert(t('forgotPassword'), t('forgotPasswordDialog.text'), [
|
||||||
t('password.forgotPassword'),
|
|
||||||
t('password.forgotPasswordDialog.text'),
|
|
||||||
[
|
|
||||||
cancelButton,
|
cancelButton,
|
||||||
{
|
{
|
||||||
text: t('password.forgotPasswordDialog.confirm'),
|
text: t('forgotPasswordDialog.confirm'),
|
||||||
onPress: onDeleteData,
|
onPress: onDeleteData,
|
||||||
},
|
},
|
||||||
]
|
])
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -82,14 +77,12 @@ const PasswordPrompt = ({ enableShowApp }) => {
|
|||||||
<AppTextInput
|
<AppTextInput
|
||||||
onChangeText={setPassword}
|
onChangeText={setPassword}
|
||||||
secureTextEntry
|
secureTextEntry
|
||||||
placeholder={t('password.enterPassword')}
|
placeholder={t('enterPassword')}
|
||||||
/>
|
/>
|
||||||
<View style={styles.containerButtons}>
|
<View style={styles.containerButtons}>
|
||||||
<Button onPress={onConfirmDeletion}>
|
<Button onPress={onConfirmDeletion}>{t('forgotPassword')}</Button>
|
||||||
{t('password.forgotPassword')}
|
|
||||||
</Button>
|
|
||||||
<Button disabled={!password} isCTA={!!password} onPress={unlockApp}>
|
<Button disabled={!password} isCTA={!!password} onPress={unlockApp}>
|
||||||
{t('password.unlockApp')}
|
{t('unlockApp')}
|
||||||
</Button>
|
</Button>
|
||||||
</View>
|
</View>
|
||||||
</KeyboardAvoidingView>
|
</KeyboardAvoidingView>
|
||||||
|
|||||||
@@ -141,9 +141,15 @@
|
|||||||
"enterPassword": "Enter password here",
|
"enterPassword": "Enter password here",
|
||||||
"forgotPassword": "Forgot your password?",
|
"forgotPassword": "Forgot your password?",
|
||||||
"forgotPasswordDialog": {
|
"forgotPasswordDialog": {
|
||||||
|
"cancel": "Cancel",
|
||||||
"confirm": "Yes, delete all my data",
|
"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."
|
"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"
|
"unlockApp": "Unlock app"
|
||||||
},
|
},
|
||||||
"stats": {
|
"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
|
// translation files
|
||||||
import en from './en.json'
|
import en from './en.json'
|
||||||
import enCommon from './en/common.json'
|
|
||||||
|
|
||||||
const resources = {
|
const resources = {
|
||||||
en: { common: enCommon, translation: en },
|
en: { translation: en },
|
||||||
}
|
}
|
||||||
|
|
||||||
i18n
|
i18n
|
||||||
|
|||||||
Reference in New Issue
Block a user