Skip to content

Commit

Permalink
chore: updated accessibility label and labels
Browse files Browse the repository at this point in the history
  • Loading branch information
OtavioStasiak committed Jan 8, 2025
1 parent e146b1e commit 0fa69e3
Show file tree
Hide file tree
Showing 25 changed files with 104 additions and 33 deletions.
2 changes: 1 addition & 1 deletion app/containers/TextInput/FormTextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export const FormTextInput = ({
return (
<View
accessible
accessibilityLabel={`${label} - ${required ? i18n.t('Required') : ''}`}
accessibilityLabel={accessibilityLabel ?? `${label} - ${required ? i18n.t('Required') : ''}`}
style={[styles.inputContainer, containerStyle]}>
{label ? (
<Text style={[styles.label, { color: colors.fontTitlesLabels }, error?.error && { color: colors.fontDanger }]}>
Expand Down
20 changes: 11 additions & 9 deletions app/containers/TwoFactor/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useRef, useState } from 'react';
import { AccessibilityInfo, InteractionManager, Text, View } from 'react-native';
import React, { useEffect, useState } from 'react';
import { InteractionManager, Text, View } from 'react-native';
import isEmpty from 'lodash/isEmpty';
import { sha256 } from 'js-sha256';
import Modal from 'react-native-modal';
Expand Down Expand Up @@ -66,7 +66,6 @@ const TwoFactor = React.memo(() => {
const [visible, setVisible] = useState(false);
const [data, setData] = useState<EventListenerMethod>({});
const [code, setCode] = useState<string>('');
const overlayRef = useRef(null);

const method = data.method ? methods[data.method] : null;
const isEmail = data.method === 'email';
Expand Down Expand Up @@ -95,11 +94,7 @@ const TwoFactor = React.memo(() => {
}, [data]);

const showTwoFactor = (args: EventListenerMethod) => {
const overlayReactTag = overlayRef.current;
setData(args);
if (overlayReactTag) {
AccessibilityInfo.setAccessibilityFocus(overlayReactTag);
}
};

useEffect(() => {
Expand Down Expand Up @@ -130,10 +125,14 @@ const TwoFactor = React.memo(() => {

const color = colors.fontTitlesLabels;
return (
<Modal avoidKeyboard useNativeDriver isVisible={visible} hideModalContentWhileAnimating>
<Modal
accessibilityLabel={I18n.t('Close_Modal')}
avoidKeyboard
useNativeDriver
isVisible={visible}
hideModalContentWhileAnimating>
<View style={styles.container} testID='two-factor'>
<View
ref={overlayRef}
style={[
styles.content,
isMasterDetail && [sharedStyles.modalFormSheet, styles.tablet],
Expand All @@ -144,6 +143,9 @@ const TwoFactor = React.memo(() => {
<Text style={[styles.title, { color }]}>{I18n.t(method?.title || 'Two_Factor_Authentication')}</Text>
{method?.text ? <Text style={[styles.subtitle, { color }]}>{I18n.t(method.text)}</Text> : null}
<FormTextInput
accessibilityLabel={I18n.t(
data?.method === 'password' ? 'Label_Input_Two_Factor_Password' : 'Label_Input_Two_Factor_Code'
)}
value={code}
inputRef={(e: any) => InteractionManager.runAfterInteractions(() => e?.getNativeRef()?.focus())}
returnKeyType='send'
Expand Down
5 changes: 4 additions & 1 deletion app/i18n/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"Click_to_join": "انقر للانضمام!",
"Close": "إغلاق",
"Close_emoji_selector": "إغلاق محدد الرموز التعبيرية",
"Close_Modal": "إغلاق النافذة المنبثقة",
"Code_or_password_invalid": "الرمز أو كلمة المرور خاطئة",
"Collaborative": "تعاونية",
"Confirm": "تأكيد",
Expand Down Expand Up @@ -159,7 +160,7 @@
"Files": "ملفات",
"Finish_recording": "إنهاء التسجيل",
"Following_thread": "متابعة الموضوع",
"For_your_security_you_must_enter_your_current_password_to_continue": "من أجل حمايتك، يجب عليك إدخال كلمة المرور الحالية للمتابعة",
"For_your_security_you_must_enter_your_current_password_to_continue": "لأمانك، يجب عليك إدخال كلمة مرور حسابك للمتابعة.",
"Forgot_password": "هل نسيت كلمة المرور؟",
"Forgot_password_If_this_email_is_registered": "إن كان البريد الإلكتروني مسجلاً، فسنرسل تعليمات إعادة تعيين كلمة المرور الخاصة بك. إذا لم تتلق بريداً إلكترونياً قريباً، فيرجى العودة والمحاولة مرة أخرى",
"Forward": "إعادة توجيه",
Expand Down Expand Up @@ -197,6 +198,8 @@
"Join_the_given_channel": "انضمام إلى القناة المحددة",
"Just_invited_people_can_access_this_channel": "يمكن للأشخاص المدعوين فقط الوصول إلى هذه القناة",
"Just_invited_people_can_access_this_team": "فقط الأشخاص المدعوين يمكنهم الوصول إلى هذا الفريق",
"Label_Input_Two_Factor_Code": "كود",
"Label_Input_Two_Factor_Password": "كلمة المرور",
"Language": "اللغة",
"last_message": "الرسالة الأخيرة",
"Leave": "مغادرة الغرفة",
Expand Down
5 changes: 4 additions & 1 deletion app/i18n/locales/bn-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"Close": "বন্ধ করুন",
"Close_Chat": "চ্যাট বন্ধ করুন",
"Close_emoji_selector": "ইমোজি সিলেক্টর বন্ধ করুন",
"Close_Modal": "মোডাল বন্ধ করুন।",
"Code_or_password_invalid": "কোড বা পাসওয়ার্ড অবৈধ",
"Collaborative": "সহযোগী",
"Condensed": "সংকোচিত",
Expand Down Expand Up @@ -269,7 +270,7 @@
"Finish_recording": "রেকর্ডিং শেষ করুন",
"Following": "অনুসরণ",
"Following_thread": "থ্রেড অনুসরণ করছেন",
"For_your_security_you_must_enter_your_current_password_to_continue": "আপনার নিরাপত্তার জন্য, আপনার বর্তমান পাসওয়ার্ড দিতে হবে যাতে আপনি চালিয়ে যান",
"For_your_security_you_must_enter_your_current_password_to_continue": "আপনার নিরাপত্তার জন্য, চালিয়ে যেতে হলে আপনাকে আপনার অ্যাকাউন্টের পাসওয়ার্ড প্রবেশ করতে হবে।",
"Forgot_password": "আপনার পাসওয়ার্ড ভুলে গিয়েছেন?",
"Forgot_password_If_this_email_is_registered": "যদি এই ইমেইলটি নিবন্ধিত হয়ে থাকে, আমরা আপনাকে কীভাবে আপনার পাসওয়ার্ড রিসেট করতে হয় তা সম্পর্কে নির্দেশনা প্রেরণ করব। যদি আপনি শীঘ্রই একটি ইমেইল পাননি, তবে অনুগ্রহ করে ফিরে আসুন এবং আবার চেষ্টা করুন।",
"Forward": "ফরোয়ার্ড",
Expand Down Expand Up @@ -316,6 +317,8 @@
"Joined": "যোগদান করেছে",
"Just_invited_people_can_access_this_channel": "এই চ্যানেলে শুধুমাত্র আমন্ত্রিত ব্যক্তিদের অ্যাক্সেস করতে পারবে",
"Just_invited_people_can_access_this_team": "এই দলে শুধুমাত্র আমন্ত্রিত ব্যক্তিদের অ্যাক্সেস করতে পারবে",
"Label_Input_Two_Factor_Code": "কোড",
"Label_Input_Two_Factor_Password": "পাসওয়ার্ড",
"Language": "ভাষা",
"last_message": "শেষ বার্তা",
"Last_owner_team_room": "আপনি এই চ্যানেলের শেষ মালিক। একবার দল থেকে বের হওয়ার পরে, চ্যানেলটি দলের মধ্যে থাকবে কিন্তু আপনি তাকে বাইরে থেকে পরিচালনা করবেন।",
Expand Down
5 changes: 4 additions & 1 deletion app/i18n/locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
"Close": "Zavřít",
"Close_Chat": "Zavřít chat",
"Close_emoji_selector": "Zavřít výběr emodži",
"Close_Modal": "Zavřít okno",
"Code_block": "Blok kódu",
"Code_or_password_invalid": "Neplatný kód nebo heslo",
"Collaborative": "Spolupráce",
Expand Down Expand Up @@ -288,7 +289,7 @@
"Finish_recording": "Dokončit nahrávání",
"Following": "Následující",
"Following_thread": "Následující vlákno",
"For_your_security_you_must_enter_your_current_password_to_continue": "Pro vaši bezpečnost musíte pro pokračování zadat své aktuální heslo",
"For_your_security_you_must_enter_your_current_password_to_continue": "Pro vaši bezpečnost musíte zadat heslo k účtu, abyste mohli pokračovat.",
"Forgot_password": "Zapomněli jste heslo?",
"Forgot_password_If_this_email_is_registered": "Pokud je tento e-mail zaregistrován, zašleme Vám pokyny, jak obnovit heslo. Pokud e-mail v nejbližší době neobdržíte, vraťte se a zkuste to znovu.",
"Forward": "Vpřed",
Expand Down Expand Up @@ -346,6 +347,8 @@
"Jump_to_message": "Přejít na zprávu",
"Just_invited_people_can_access_this_channel": "K tomuto kanálu mají přístup pouze pozvaní lidé",
"Just_invited_people_can_access_this_team": "K tomuto týmu mají přístup pouze pozvaní lidé",
"Label_Input_Two_Factor_Code": "Kód",
"Label_Input_Two_Factor_Password": "Heslo",
"Language": "Jazyk",
"last_message": "poslední zpráva",
"Last_owner_team_room": "Jste posledním vlastníkem tohoto kanálu. Jakmile tým opustíte, kanál zůstane uvnitř týmu, ale budete ho spravovat zvenčí.",
Expand Down
5 changes: 4 additions & 1 deletion app/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
"Close": "Schließen",
"Close_Chat": "Chat schließen",
"Close_emoji_selector": "Emoji-Auswahl schließen",
"Close_Modal": "Modal schließen",
"Code_or_password_invalid": "Code oder Passwort sind falsch",
"Collaborative": "Kollaborativ",
"Condensed": "Komprimiert",
Expand Down Expand Up @@ -263,7 +264,7 @@
"Finish_recording": "Aufnahme neenden",
"Following": "verfolgte",
"Following_thread": "Thread folgen",
"For_your_security_you_must_enter_your_current_password_to_continue": "Zu Ihrer Sicherheit müssen Sie Ihr aktuelles Passwort eingeben, um fortzufahren",
"For_your_security_you_must_enter_your_current_password_to_continue": "Zu Ihrer Sicherheit müssen Sie Ihr Kontopasswort eingeben, um fortzufahren.",
"Forgot_password": "Passwort vergessen",
"Forgot_password_If_this_email_is_registered": "Wenn es sich um eine registrierte E-Mail-Adresse handelt, werden wir an diese eine Anleitung zum Zurücksetzen des Passworts senden. Sollten Sie in Kürzen keine E-Mail erhalten, kommen Sie wieder und versuchen Sie es noch einmal.",
"Forward": "Weiterleiten",
Expand Down Expand Up @@ -309,6 +310,8 @@
"Joined": "Beigetreten",
"Just_invited_people_can_access_this_channel": "Nur eingeladene Personen können auf diesen Kanal zugreifen",
"Just_invited_people_can_access_this_team": "Nur eingeladene Personen können auf das Team zugreifen",
"Label_Input_Two_Factor_Code": "Code",
"Label_Input_Two_Factor_Password": "Passwort",
"Language": "Sprache",
"last_message": "letzte Nachricht",
"Last_owner_team_room": "Sie sind der letzte Eigner dieses Channels. Wenn Sie das Team verlassen haben, bleibt der Channel im Team, aber Sie werden ihn von außen verwalten.",
Expand Down
5 changes: 4 additions & 1 deletion app/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
"Close": "Close",
"Close_Chat": "Close chat",
"Close_emoji_selector": "Close emoji selector",
"Close_Modal": "Close Modal",
"Code_block": "Code block",
"Code_or_password_invalid": "Code or password invalid",
"Collaborative": "Collaborative",
Expand Down Expand Up @@ -309,7 +310,7 @@
"Finish_recording": "Finish recording",
"Following": "Following",
"Following_thread": "Following thread",
"For_your_security_you_must_enter_your_current_password_to_continue": "For your security, you must enter your current password to continue",
"For_your_security_you_must_enter_your_current_password_to_continue": "For your security, you must enter your account password to continue.",
"Forgot_password": "Forgot your password?",
"Forgot_password_If_this_email_is_registered": "If this email is registered, we'll send instructions on how to reset your password. If you do not receive an email shortly, please come back and try again.",
"Forward": "Forward",
Expand Down Expand Up @@ -367,6 +368,8 @@
"Jump_to_message": "Jump to message",
"Just_invited_people_can_access_this_channel": "Just invited people can access this channel",
"Just_invited_people_can_access_this_team": "Just invited people can access this team",
"Label_Input_Two_Factor_Code": "Code",
"Label_Input_Two_Factor_Password": "Password",
"Language": "Language",
"last_message": "last message",
"Last_owner_team_room": "You are the last owner of this channel. Once you leave the team, the channel will be kept inside the team but you will be managing it from outside.",
Expand Down
5 changes: 4 additions & 1 deletion app/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"Click_to_join": "¡Unirme!",
"Close": "Cerrar",
"Close_emoji_selector": "Cerrar selector de emojis",
"Close_Modal": "Cerrar modal",
"Collaborative": "Colaborativo",
"Confirm": "Confirmar",
"Connect": "Conectar",
Expand Down Expand Up @@ -109,7 +110,7 @@
"Files": "Archivos",
"Finish_recording": "Finalizar grabación",
"Following_thread": "Siguiendo hilo",
"For_your_security_you_must_enter_your_current_password_to_continue": "Por seguridad, debes introducir tu contraseña para continuar",
"For_your_security_you_must_enter_your_current_password_to_continue": "Por su seguridad, debe ingresar la contraseña de su cuenta para continuar.",
"Forgot_password": "¿Ha olvidado su contraseña?",
"Forgot_password_If_this_email_is_registered": "Si este email está registrado, te enviaremos las instrucciones para resetear tu contraseña. Si no recibes un email en breve, vuelve aquí e inténtalo de nuevo.",
"Full_name": "Nombre completo",
Expand All @@ -131,6 +132,8 @@
"Join": "Conectar",
"Join_the_given_channel": "Unirse al canal dado",
"Just_invited_people_can_access_this_channel": "Sólo gente invitada puede acceder a este canal.",
"Label_Input_Two_Factor_Code": "Código",
"Label_Input_Two_Factor_Password": "Contraseña",
"Language": "Idioma",
"last_message": "último mensaje",
"Learn_more": "Saber más",
Expand Down
5 changes: 4 additions & 1 deletion app/i18n/locales/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
"Close": "Sulje",
"Close_Chat": "Sulje keskustelu",
"Close_emoji_selector": "Sulje emojien valitsin",
"Close_Modal": "Sulje modalivalikko",
"Code_or_password_invalid": "Koodi tai salasana virheellinen",
"Collaborative": "Yhteistyö",
"Condensed": "Tiivistetty",
Expand Down Expand Up @@ -248,7 +249,7 @@
"Finish_recording": "Lopeta tallennus",
"Following": "Seurataan",
"Following_thread": "Seurataan ketjua",
"For_your_security_you_must_enter_your_current_password_to_continue": "Jatka antamalla nykyinen salasanasi turvallisuussyistä",
"For_your_security_you_must_enter_your_current_password_to_continue": "Turvallisuutesi vuoksi sinun on syötettävä tilisi salasana jatkaaksesi.",
"Forgot_password": "Unohditko salasanasi?",
"Forgot_password_If_this_email_is_registered": "Jos tämä sähköpostiosoite on rekisteröity, lähetämme salasanan nollausohjeet. Jos et saa sähköpostia pian, palaa ja yritä uudelleen.",
"Forward": "Välitä",
Expand Down Expand Up @@ -291,6 +292,8 @@
"Joined": "Liitytty",
"Just_invited_people_can_access_this_channel": "Vain kutsutut ihmiset voivat käyttää tätä kanavaa",
"Just_invited_people_can_access_this_team": "Vain kutsutut ihmiset voivat käyttää tätä tiimiä",
"Label_Input_Two_Factor_Code": "Koodi",
"Label_Input_Two_Factor_Password": "Salasana",
"Language": "Kieli",
"last_message": "viimeinen viesti",
"Last_owner_team_room": "Olet tämän kanavan viimeinen omistaja. Kun lähdet tiimistä, kanava säilyy tiimin sisällä, mutta hallinnoit sitä ulkopuolelta.",
Expand Down
5 changes: 4 additions & 1 deletion app/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"Click_to_join": "Cliquez pour rejoindre !",
"Close": "Fermer",
"Close_emoji_selector": "Fermer le sélecteur d'émoji",
"Close_Modal": "Fermer la fenêtre modale",
"Code_or_password_invalid": "Code ou mot de passe invalide",
"Collaborative": "Collaboratif",
"Condensed": "Condensé",
Expand Down Expand Up @@ -212,7 +213,7 @@
"Finish_recording": "Terminer l'enregistrement",
"Following": "Suivant",
"Following_thread": "Suivre le fil",
"For_your_security_you_must_enter_your_current_password_to_continue": "Pour votre sécurité, vous devez entrer votre mot de passe actuel pour continuer.",
"For_your_security_you_must_enter_your_current_password_to_continue": "Pour votre sécurité, vous devez entrer le mot de passe de votre compte pour continuer.",
"Forgot_password": "Mot de passe oublié ?",
"Forgot_password_If_this_email_is_registered": "Si cet e-mail est enregistré, nous vous enverrons des instructions pour réinitialiser votre mot de passe. Si vous ne recevez pas d'e-mail sous peu, veuillez revenir et réessayer.",
"Forward": "Transmettre",
Expand Down Expand Up @@ -254,6 +255,8 @@
"Join_the_given_channel": "Rejoindre le canal indiqué",
"Just_invited_people_can_access_this_channel": "Seuls les personnes invitées peuvent accéder à ce canal",
"Just_invited_people_can_access_this_team": "Seules les personnes invitées peuvent accéder à cette équipe",
"Label_Input_Two_Factor_Code": "Code",
"Label_Input_Two_Factor_Password": "Mot de passe",
"Language": "Langue",
"last_message": "dernier message",
"Last_owner_team_room": "Vous êtes le dernier propriétaire de ce canal. Une fois que vous quittez l'équipe, le canal sera conservé au sein de l'équipe mais vous le gérerez de l'extérieur.",
Expand Down
5 changes: 4 additions & 1 deletion app/i18n/locales/hi-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"Close": "बंद करें",
"Close_Chat": "चैट बंद करें",
"Close_emoji_selector": "इमोजी चयनकर्ता बंद करें",
"Close_Modal": "मोडल बंद करें।",
"Code_or_password_invalid": "कोड या पासवर्ड अमान्य है",
"Collaborative": "सहयोगी",
"Condensed": "संक्षेपित",
Expand Down Expand Up @@ -269,7 +270,7 @@
"Finish_recording": "रेकॉर्डिंग समाप्त करें",
"Following": "फॉलो कर रहा है",
"Following_thread": "निरंतर थ्रेड",
"For_your_security_you_must_enter_your_current_password_to_continue": "आपकी सुरक्षा के लिए, आपको जारी रखने के लिए अपना वर्तमान पासवर्ड दर्ज करना होगा",
"For_your_security_you_must_enter_your_current_password_to_continue": "आपकी सुरक्षा के लिए, जारी रखने के लिए आपको अपने खाते का पासवर्ड दर्ज करना होगा",
"Forgot_password": "पासवर्ड भूल गए हैं?",
"Forgot_password_If_this_email_is_registered": "यदि यह ईमेल पंजीकृत है, तो हम आपको पासवर्ड रीसेट करने के लिए निर्देश भेजेंगे। यदि आपको शीघ्रता से एक ईमेल प्राप्त नहीं होता है, तो कृपया वापस आकर पुनः प्रयास करें।",
"Forward": "आगे बढ़ें",
Expand Down Expand Up @@ -316,6 +317,8 @@
"Joined": "शामिल हो गए",
"Just_invited_people_can_access_this_channel": "केवल निमंत्रित लोग इस चैनल तक पहुंच सकते हैं",
"Just_invited_people_can_access_this_team": "केवल निमंत्रित लोग इस टीम तक पहुंच सकते हैं",
"Label_Input_Two_Factor_Code": "कोड",
"Label_Input_Two_Factor_Password": "पासवर्ड",
"Language": "भाषा",
"last_message": "आखिरी संदेश",
"Last_owner_team_room": "आप इस चैनल के आखिरी मालिक हैं। जब आप टीम छोड़ेंगे, चैनल को टीम के अंदर रखा जाएगा, लेकिन आप इसे बाहर से प्रबंधित करेंगे।",
Expand Down
Loading

0 comments on commit 0fa69e3

Please sign in to comment.