From c4204432d764743ffe745c7b1002b59bb59ae86c Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Fri, 24 Apr 2020 10:38:29 -0300 Subject: [PATCH] I18n --- app/i18n/locales/en.js | 11 +++++- app/i18n/locales/pt-BR.js | 21 ++++++++++- app/views/ScreenLockConfigView.js | 59 +++++++++++++++---------------- app/views/ScreenLockedView.js | 1 - 4 files changed, 59 insertions(+), 33 deletions(-) diff --git a/app/i18n/locales/en.js b/app/i18n/locales/en.js index 525eed7f8..16a90f76d 100644 --- a/app/i18n/locales/en.js +++ b/app/i18n/locales/en.js @@ -562,8 +562,17 @@ export default { Mark_unread: 'Mark Unread', Wait_activation_warning: 'Before you can login, your account must be manually activated by an administrator.', Screen_lock: 'Screen lock', - Local_authentication_facial_recognition: 'facial_recognition', + Local_authentication_unlock_option: 'Unlock with Passcode', + Local_authentication_change_passcode: 'Change Passcode', + Local_authentication_info: 'Note: if you forget the Passcode, you\'ll need to delete and reinstall the app.', + Local_authentication_facial_recognition: 'facial recognition', Local_authentication_fingerprint: 'fingerprint', + Local_authentication_unlock_with_label: 'Unlock with {{label}}', + Local_authentication_auto_lock_60: 'After 1 minute', + Local_authentication_auto_lock_300: 'After 5 minutes', + Local_authentication_auto_lock_900: 'After 15 minutes', + Local_authentication_auto_lock_1800: 'After 30 minutes', + Local_authentication_auto_lock_3600: 'After 1 hour', Passcode_del: 'del', Passcode_enter_title: 'Enter your passcode', Passcode_choose_title: 'Choose your new passcode', diff --git a/app/i18n/locales/pt-BR.js b/app/i18n/locales/pt-BR.js index 5cd3fb3e1..21eea6e0e 100644 --- a/app/i18n/locales/pt-BR.js +++ b/app/i18n/locales/pt-BR.js @@ -500,5 +500,24 @@ export default { Clear: 'Limpar', This_will_clear_all_your_offline_data: 'Isto limpará todos os seus dados offline.', Mark_unread: 'Marcar como não Lida', - Wait_activation_warning: 'Antes que você possa fazer o login, sua conta deve ser manualmente ativada por um administrador.' + Wait_activation_warning: 'Antes que você possa fazer o login, sua conta deve ser manualmente ativada por um administrador.', + Screen_lock: 'Bloqueio de Tela', + Local_authentication_unlock_option: 'Desbloquear com senha', + Local_authentication_change_passcode: 'Alterar senha', + Local_authentication_info: 'Nota: se você esquecer sua senha, terá de apagar e reinstalar o app.', + Local_authentication_facial_recognition: 'reconhecimento facial', + Local_authentication_fingerprint: 'impressão digital', + Local_authentication_unlock_with_label: 'Desbloquear com {{label}}', + Local_authentication_auto_lock_60: 'Após 1 minuto', + Local_authentication_auto_lock_300: 'Após 5 minutos', + Local_authentication_auto_lock_900: 'Após 15 minutos', + Local_authentication_auto_lock_1800: 'Após 30 minutos', + Local_authentication_auto_lock_3600: 'Após 1 hora', + Passcode_del: 'del', + Passcode_enter_title: 'Digite sua senha', + Passcode_choose_title: 'Insira sua nova senha', + Passcode_choose_confirm_title: 'Confirme sua nova senha', + Passcode_choose_error: 'As senhas não coincidem. Tente novamente.', + Passcode_app_locked_title: 'Aplicativo bloqueado', + Passcode_app_locked_subtitle: 'Tente novamente em {{timeLeft}} segundos' }; diff --git a/app/views/ScreenLockConfigView.js b/app/views/ScreenLockConfigView.js index 04f63554d..9bed4dedd 100644 --- a/app/views/ScreenLockConfigView.js +++ b/app/views/ScreenLockConfigView.js @@ -22,29 +22,6 @@ import { supportedBiometryLabel } from '../utils/localAuthentication'; import { DisclosureImage } from '../containers/DisclosureIndicator'; import { PASSCODE_KEY } from '../constants/localAuthentication'; -const DEFAULT_AUTO_LOCK = [ - { - title: 'After 1 minute', - value: 5 - }, - { - title: 'After 5 minutes', - value: 300 - }, - { - title: 'After 15 minutes', - value: 900 - }, - { - title: 'After 30 minutes', - value: 1800 - }, - { - title: 'After 1 hour', - value: 3600 - } -]; - const styles = StyleSheet.create({ listPadding: { paddingVertical: 36 @@ -63,12 +40,34 @@ class ScreenLockConfigView extends React.Component { navigation: PropTypes.object } + defaultAutoLockOptions = [ + { + title: I18n.t('Local_authentication_auto_lock_60'), + value: 60 + }, + { + title: I18n.t('Local_authentication_auto_lock_300'), + value: 300 + }, + { + title: I18n.t('Local_authentication_auto_lock_900'), + value: 900 + }, + { + title: I18n.t('Local_authentication_auto_lock_1800'), + value: 1800 + }, + { + title: I18n.t('Local_authentication_auto_lock_3600'), + value: 3600 + } + ]; + constructor(props) { super(props); this.state = { autoLock: false, autoLockTime: null, - supported: [], biometry: true, biometryLabel: null }; @@ -191,7 +190,7 @@ class ScreenLockConfigView extends React.Component { } renderAutoLockItems = () => { - const { autoLock, supported } = this.state; + const { autoLock } = this.state; const { theme } = this.props; if (!autoLock) { return null; @@ -200,7 +199,7 @@ class ScreenLockConfigView extends React.Component { <> - {autoLock ? DEFAULT_AUTO_LOCK.concat(supported).map(item => this.renderItem({ item })) : null} + {autoLock ? this.defaultAutoLockOptions.map(item => this.renderItem({ item })) : null} ); } @@ -220,7 +219,7 @@ class ScreenLockConfigView extends React.Component { <> this.renderBiometrySwitch()} theme={theme} /> @@ -244,7 +243,7 @@ class ScreenLockConfigView extends React.Component { > this.renderAutoLockSwitch()} theme={theme} /> @@ -253,7 +252,7 @@ class ScreenLockConfigView extends React.Component { <> {this.renderBiometry()} diff --git a/app/views/ScreenLockedView.js b/app/views/ScreenLockedView.js index 85407cba2..416d39239 100644 --- a/app/views/ScreenLockedView.js +++ b/app/views/ScreenLockedView.js @@ -8,7 +8,6 @@ import useDeepCompareEffect from 'use-deep-compare-effect'; import _ from 'lodash'; import Orientation from 'react-native-orientation-locker'; -// import I18n from '../i18n'; import { withTheme } from '../theme'; import { themes } from '../constants/colors'; import EventEmitter from '../utils/events';