Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(a11y): ChangeAvatarView #5950

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
17 changes: 14 additions & 3 deletions app/containers/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { getAvatarURL } from '../../lib/methods/helpers/getAvatarUrl';
import { SubscriptionType } from '../../definitions';
import Emoji from '../markdown/Emoji';
import { IAvatar } from './interfaces';
import I18n from '../../i18n';

const Avatar = React.memo(
({
Expand All @@ -31,12 +32,14 @@ const Avatar = React.memo(
type = SubscriptionType.DIRECT,
avatarExternalProviderUrl,
roomAvatarExternalProviderUrl,
cdnPrefix
cdnPrefix,
accessibilityLabel
}: IAvatar) => {
if ((!text && !avatar && !emoji && !rid) || !server) {
return null;
}

const avatarAccessibilityLabel = accessibilityLabel ?? I18n.t('Avatar_Photo', { username: text });
const avatarStyle = {
width: size,
height: size,
Expand Down Expand Up @@ -80,11 +83,19 @@ const Avatar = React.memo(
}

if (onPress) {
image = <Touchable onPress={onPress}>{image}</Touchable>;
image = (
<Touchable accessibilityLabel={avatarAccessibilityLabel} onPress={onPress}>
{image}
</Touchable>
);
}

return (
<View style={[avatarStyle, style]} testID='avatar'>
<View
accessible
accessibilityLabel={!onPress ? avatarAccessibilityLabel : undefined}
style={[avatarStyle, style]}
testID='avatar'>
{image}
{children}
</View>
Expand Down
4 changes: 3 additions & 1 deletion app/containers/Avatar/AvatarContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ const AvatarContainer = ({
onPress,
getCustomEmoji,
isStatic,
rid
rid,
accessibilityLabel
}: IAvatar): React.ReactElement => {
const server = useSelector((state: IApplicationState) => state.server.server);
const serverVersion = useSelector((state: IApplicationState) => state.server.version);
Expand Down Expand Up @@ -66,6 +67,7 @@ const AvatarContainer = ({
avatarETag={avatarETag}
serverVersion={serverVersion}
cdnPrefix={cdnPrefix}
accessibilityLabel={accessibilityLabel}
/>
);
};
Expand Down
1 change: 1 addition & 0 deletions app/containers/Avatar/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ export interface IAvatar {
avatarExternalProviderUrl?: string;
roomAvatarExternalProviderUrl?: string;
cdnPrefix?: string;
accessibilityLabel?: string;
}
3 changes: 3 additions & 0 deletions app/i18n/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"Auto_Translate": "ترجمة تلقائية",
"Automatic": "تلقائي",
"Avatar_changed_successfully": "تم تغيير الصورة الرمزية بنجاح!",
"Avatar_Photo": "صورة رمزية {{username}}",
"Avatar_Url": "عنوان ويب الصورة الرمزية",
"Away": "غير متواجد",
"Black": "أسود",
Expand Down Expand Up @@ -155,6 +156,7 @@
"Everyone_can_access_this_team": "يمكن للجميع الوصول إلى هذا الفريق",
"Expiration_Days": "انتهاء (أيام)",
"Favorites": "مفضلات",
"Fetch_image_from_URL": "جلب الصورة من الرابط",
"File_description": "وصف الملف",
"Files": "ملفات",
"Finish_recording": "إنهاء التسجيل",
Expand Down Expand Up @@ -390,6 +392,7 @@
"Select_a_User": "حدد مستخدم",
"Select_an_option": "حدد خيار",
"Select_Server": "حدد خادم",
"Select_Uploaded_Image": "حدد الصورة التي تم تحميلها",
"Select_Users": "حدد مستخدمين",
"Send": "إرسال",
"Send_audio_message": "إرسال رسالة صوتية",
Expand Down
3 changes: 3 additions & 0 deletions app/i18n/locales/bn-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"Automatic": "স্বয়ংক্রিয়",
"Avatar": "অবতার",
"Avatar_changed_successfully": "অবতার সফলভাবে পরিবর্তন হয়েছে!",
"Avatar_Photo": "{{username}} অবতার",
"Avatar_Url": "অবতার URL",
"Avatars": "এভাটার",
"Away": "দূরে",
Expand Down Expand Up @@ -263,6 +264,7 @@
"Expanded": "বিস্তৃত",
"Expiration_Days": "মেয়াদ শেষ (দিন)",
"Favorites": "প্রিয়সমূহ",
"Fetch_image_from_URL": "URL থেকে ছবি আনুন",
"File_description": "ফাইল বর্ণনা",
"Files": "ফাইলসমূহ",
"FileUpload_Error": "ফাইল আপলোড ত্রুটি",
Expand Down Expand Up @@ -600,6 +602,7 @@
"Select_Team": "দল নির্বাচন করুন",
"Select_Team_Channels": "আপনি যে দলের চ্যানেলগুলি ত্যাগ করতে চান তা নির্বাচন করুন।",
"Select_Team_Channels_To_Delete": "আপনি যে দলের চ্যানেলগুলি মোছতে চান তা নির্বাচন করুন, যেগুলি আপনি নির্বাচন করবেন না তা উইর্কস্পেসে যাবে। \n\nমনে রাখবেন যে পাবলিক চ্যানেলগুলি এখনও সর্বাধিক এবং সবাইকে দৃশ্যমান থাকবে।",
"Select_Uploaded_Image": "আপলোড করা ছবি নির্বাচন করুন",
"Select_Users": "ব্যবহারকারী নির্বাচন করুন",
"Send": "পাঠান",
"Send_audio_message": "অডিও মেসেজ পাঠান",
Expand Down
3 changes: 3 additions & 0 deletions app/i18n/locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"Automatic": "Automatický",
"Avatar": "Avatar",
"Avatar_changed_successfully": "Avatar se úspěšně změnil!",
"Avatar_Photo": "{{username}} Avatar",
"Avatar_Url": "Adresa URL avatara",
"Avatars": "Avataři",
"Away": "Pryč",
Expand Down Expand Up @@ -282,6 +283,7 @@
"Expanded": "Rozšířený",
"Expiration_Days": "Vypršení platnosti (dny)",
"Favorites": "Oblíbené",
"Fetch_image_from_URL": "Načíst obrázek z URL",
"File_description": "Popis souboru",
"Files": "Soubory",
"FileUpload_Error": "Chyba nahrávání souboru",
Expand Down Expand Up @@ -650,6 +652,7 @@
"Select_Team": "Vybrat tým",
"Select_Team_Channels": "Vyberte kanály týmu, které chcete opustit.",
"Select_Team_Channels_To_Delete": "Vyberte kanály týmu, které chcete smazat, ty, které nevyberete, budou přesunuty do pracovního prostoru. \n\nVšimněte si, že veřejné kanály budou veřejné a viditelné pro všechny.",
"Select_Uploaded_Image": "Vyberte nahraný obrázek",
"Select_Users": "Vybrat uživatele",
"Send": "Poslat",
"Send_audio_message": "Odeslat zvukovou zprávu",
Expand Down
3 changes: 3 additions & 0 deletions app/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"Automatic": "Automatisch",
"Avatar": "Profilbild",
"Avatar_changed_successfully": "Avatar erfolgreich geändert!",
"Avatar_Photo": "{{username}} Avatar",
"Avatar_Url": "Avatar-URL",
"Avatars": "Avatare",
"Away": "Abwesend",
Expand Down Expand Up @@ -257,6 +258,7 @@
"Expanded": "Erweitert",
"Expiration_Days": "läuft ab (Tage)",
"Favorites": "Favoriten",
"Fetch_image_from_URL": "Bild von URL abrufen",
"File_description": "Dateibeschreibung",
"Files": "Dateien",
"FileUpload_Error": "Fehler bei Datei-Upload",
Expand Down Expand Up @@ -586,6 +588,7 @@
"Select_Team": "Team auswählen",
"Select_Team_Channels": "Wählen Sie die Channels des Teams aus, die Sie verlassen möchten.",
"Select_Team_Channels_To_Delete": "Wählen Sie die Channels des Teams aus, die Sie löschen möchten. Die Channels, die Sie nicht auswählen, werden in den Arbeitsbereich verschoben \n\nBeachten Sie, dass öffentliche Kanäle öffentlich und für alle sichtbar sind.",
"Select_Uploaded_Image": "Wählen Sie hochgeladenes Bild",
"Select_Users": "Benutzer auswählen",
"Send": "Senden",
"Send_audio_message": "Audio-Nachricht senden",
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 @@ -60,6 +60,7 @@
"Automatic": "Automatic",
"Avatar": "Avatar",
"Avatar_changed_successfully": "Avatar changed successfully!",
"Avatar_Photo": "{{username}} Avatar",
"Avatar_Url": "Avatar URL",
"Avatars": "Avatars",
"Away": "Away",
Expand Down Expand Up @@ -299,6 +300,7 @@
"Expanded": "Expanded",
"Expiration_Days": "Expiration (days)",
"Favorites": "Favorites",
"Fetch_image_from_URL": "Fetch image from URL",
"File_description": "File description",
"Files": "Files",
"FileUpload_Error": "File upload error",
Expand Down Expand Up @@ -330,7 +332,7 @@
"I_Saved_My_E2E_Password": "I saved my E2E password",
"Ignore": "Ignore",
"Image": "Image",
"Images_uploaded": "Images uploaded",
"Images_uploaded": "Uploaded Images",
"In_app": "In-app",
"In_App_And_Desktop": "In-app and desktop",
"In_App_and_Desktop_Alert_info": "Displays a banner at the top of the screen when app is open, and displays a notification on desktop",
Expand Down Expand Up @@ -670,6 +672,7 @@
"Select_Team": "Select team",
"Select_Team_Channels": "Select the team's channels you would like to leave.",
"Select_Team_Channels_To_Delete": "Select the team’s channels you would like to delete, the ones you do not select will be moved to the workspace. \n\nNotice that public channels will be public and visible to everyone.",
"Select_Uploaded_Image": "Select Uploaded Image",
"Select_Users": "Select users",
"Selected": "Selected",
"Send": "Send",
Expand Down
3 changes: 3 additions & 0 deletions app/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"Auto_Translate": "Traducción automática",
"Automatic": "Automático",
"Avatar_changed_successfully": "¡Avatar modificado correctamente!",
"Avatar_Photo": "Avatar de {{username}}",
"Avatar_Url": "URL del Avatar",
"Away": "Ausente",
"Black": "Negro",
Expand Down Expand Up @@ -105,6 +106,7 @@
"error-you-are-last-owner": "Eres el único propietario existente. Debes establecer un nuevo propietario antes de abandonar la sala.",
"Everyone_can_access_this_channel": "Todos los usuarios pueden acceder a este canal",
"Favorites": "Favoritos",
"Fetch_image_from_URL": "Obtener imagen desde URL",
"File_description": "Descripción del archivo",
"Files": "Archivos",
"Finish_recording": "Finalizar grabación",
Expand Down Expand Up @@ -231,6 +233,7 @@
"Search_Messages": "Buscar mensajes",
"Search_messages": "Buscar mensajes",
"Select_Server": "Selecciona servidor",
"Select_Uploaded_Image": "Seleccionar imagen cargada",
"Select_Users": "Selecciona usuarios",
"Send": "Enviar",
"Send_audio_message": "Enviar nota de audio",
Expand Down
3 changes: 3 additions & 0 deletions app/i18n/locales/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"Auto-join": "Automaattinen liittyminen",
"Automatic": "Automaattinen",
"Avatar_changed_successfully": "Avatar on vaihdettu!",
"Avatar_Photo": "{{username}} Avatar",
"Avatar_Url": "Avatarin URL-osoite",
"Avatars": "Avatarit",
"Away": "Poissa",
Expand Down Expand Up @@ -242,6 +243,7 @@
"Expanded": "Laajennettu",
"Expiration_Days": "Vanheneminen (päivää)",
"Favorites": "Suosikit",
"Fetch_image_from_URL": "Hae kuva URL-osoitteesta",
"File_description": "Tiedoston kuvaus",
"Files": "Tiedostot",
"FileUpload_Error": "Tiedoston latausvirhe",
Expand Down Expand Up @@ -561,6 +563,7 @@
"Select_Team": "Valitse tiimi",
"Select_Team_Channels": "Valitse tiimin kanavat, joilta haluat poistua.",
"Select_Team_Channels_To_Delete": "Valitse poistettavat tiimin kanavat. Valitsematta jättämäsi kanavat siirretään työtilaan. \n\nHuomioi, että julkiset kanavat ovat julkisia ja näkyvät kaikille.",
"Select_Uploaded_Image": "Valitse ladattu kuva",
"Select_Users": "Valitse käyttäjät",
"Send": "Lähetä",
"Send_audio_message": "Lähetä ääniviesti",
Expand Down
3 changes: 3 additions & 0 deletions app/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"Auto-join": "Rejoindre automatiquement",
"Automatic": "Automatique",
"Avatar_changed_successfully": "Avatar changé avec succès !",
"Avatar_Photo": "Avatar de {{username}}",
"Avatar_Url": "URL de l'avatar",
"Avatars": "Avatars",
"Away": "Absent",
Expand Down Expand Up @@ -207,6 +208,7 @@
"Expanded": "Etendu",
"Expiration_Days": "Expiration (Jours)",
"Favorites": "Favoris",
"Fetch_image_from_URL": "Récupérer l'image depuis l'URL",
"File_description": "Description du fichier",
"Files": "Fichiers",
"Finish_recording": "Terminer l'enregistrement",
Expand Down Expand Up @@ -501,6 +503,7 @@
"Select_Team": "Sélectionnez l'équipe",
"Select_Team_Channels": "Sélectionnez les canaux de l'équipe que vous souhaitez quitter.",
"Select_Team_Channels_To_Delete": "Sélectionnez les canaux de l'équipe que vous souhaitez supprimer, ceux que vous ne sélectionnez pas, seront déplacés vers l'espace de travail. \n\n\nNotez que les canaux publics seront publics et visibles par tous.",
"Select_Uploaded_Image": "Sélectionnez l'image téléchargée",
"Select_Users": "Sélectionner les utilisateurs",
"Send": "Envoyer",
"Send_audio_message": "Envoyer un message audio",
Expand Down
3 changes: 3 additions & 0 deletions app/i18n/locales/hi-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"Automatic": "स्वच्छता से",
"Avatar": "अवतार",
"Avatar_changed_successfully": "अवतार सफलता पर बदला गया है!",
"Avatar_Photo": "{{username}} अवतार",
"Avatar_Url": "अवतार URL",
"Avatars": "अवतार",
"Away": "दूर",
Expand Down Expand Up @@ -263,6 +264,7 @@
"Expanded": "विस्तारित",
"Expiration_Days": "समाप्ति (दिन)",
"Favorites": "पसंदीदा",
"Fetch_image_from_URL": "URL से छवि प्राप्त करें",
"File_description": "फ़ाइल विवरण",
"Files": "फ़ाइलें",
"FileUpload_Error": "फ़ाइल अपलोड त्रुटि",
Expand Down Expand Up @@ -600,6 +602,7 @@
"Select_Team": "टीम चुनें",
"Select_Team_Channels": "उन चैनलों को चुनें जिन्हें आप छोड़ना चाहेंगे",
"Select_Team_Channels_To_Delete": "टीम के चैनलों को चुनें जिन्हें आप हटाना चाहते हैं, जिन्हें आप नहीं चुनते हैं वे कार्यस्थान में मूव किए जाएंगे। सार्वजनिक चैनलों को ध्यान दें कि वे फिर भी सार्वजनिक और सभी के द्वारा दृश्यमान रहेंगे।",
"Select_Uploaded_Image": "चुनी हुई छवि का चयन करें",
"Select_Users": "उपयोगकर्ता चयन करें",
"Send": "भेजें",
"Send_audio_message": "ऑडियो संदेश भेजें",
Expand Down
3 changes: 3 additions & 0 deletions app/i18n/locales/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"Automatic": "Automatikus",
"Avatar": "Avatar",
"Avatar_changed_successfully": "Az avatar sikeresen megváltozott!",
"Avatar_Photo": "{{username}} Avatar",
"Avatar_Url": "Avatar URL",
"Avatars": "Avatarok",
"Away": "Távol",
Expand Down Expand Up @@ -263,6 +264,7 @@
"Expanded": "Kibővített",
"Expiration_Days": "Lejárat (napokban)",
"Favorites": "Kedvencek",
"Fetch_image_from_URL": "Kép betöltése az URL-ről",
"File_description": "Fájl leírás",
"Files": "Fájlok",
"FileUpload_Error": "Fájlfeltöltési hiba",
Expand Down Expand Up @@ -601,6 +603,7 @@
"Select_Team": "Csapat kiválasztása",
"Select_Team_Channels": "Válassza ki a csapat azon csatornáit, amelyeket el szeretne hagyni.",
"Select_Team_Channels_To_Delete": "Válassza ki a törölni kívánt csapat csatornáit, a ki nem választott csatornák a munkaterületre kerülnek. \n\nVegye figyelembe, hogy a nyilvános csatornák nyilvánosak és mindenki számára láthatóak lesznek.",
"Select_Uploaded_Image": "Válassza ki a feltöltött képet",
"Select_Users": "Felhasználók kiválasztása",
"Send": "Küldés",
"Send_audio_message": "Hangüzenet küldése",
Expand Down
3 changes: 3 additions & 0 deletions app/i18n/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Auto_Translate": "Traduzione automatica",
"Automatic": "Automatico",
"Avatar_changed_successfully": "Avatar aggiornato correttamente!",
"Avatar_Photo": "Avatar di {{username}}",
"Avatar_Url": "URL avatar",
"Away": "Assente",
"Black": "Nero",
Expand Down Expand Up @@ -180,6 +181,7 @@
"Everyone_can_access_this_team": "Tutti hanno accesso a questo team",
"Expiration_Days": "Scadenza (giorni)",
"Favorites": "Preferiti",
"Fetch_image_from_URL": "Recupera immagine da URL",
"File_description": "Descrizione file",
"Files": "File",
"Finish_recording": "Termina registrazione",
Expand Down Expand Up @@ -425,6 +427,7 @@
"Select_a_User": "Seleziona un Utente",
"Select_an_option": "Seleziona un' opzione",
"Select_Server": "Seleziona server",
"Select_Uploaded_Image": "Seleziona immagine caricata",
"Select_Users": "Seleziona utenti",
"Send": "Invia",
"Send_audio_message": "Invia messaggio audio",
Expand Down
3 changes: 3 additions & 0 deletions app/i18n/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"Auto_Translate": "自動翻訳",
"Automatic": "自動",
"Avatar_changed_successfully": "アバターを変更しました!",
"Avatar_Photo": "{{username}} アバター",
"Avatar_Url": "アバターURL",
"Away": "退出中",
"Black": "ブラック",
Expand Down Expand Up @@ -155,6 +156,7 @@
"Everyone_can_access_this_team": "全員このチームにアクセスできます",
"Expiration_Days": "期限切れ (日)",
"Favorites": "お気に入り",
"Fetch_image_from_URL": "URLから画像を取得する",
"File_description": "ファイルの説明",
"Files": "ファイル",
"Finish_recording": "録音停止",
Expand Down Expand Up @@ -329,6 +331,7 @@
"Search_Messages": "メッセージを検索",
"Search_messages": "メッセージを検索",
"Select_Server": "サーバーを選択",
"Select_Uploaded_Image": "アップロードされた画像を選択します",
"Select_Users": "ユーザーを選択",
"Send": "送信",
"Send_audio_message": "録音メッセージを送信",
Expand Down
3 changes: 3 additions & 0 deletions app/i18n/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"Auto-join": "Automatisch deelnemen",
"Automatic": "Automatisch",
"Avatar_changed_successfully": "Avatar succesvol gewijzigd!",
"Avatar_Photo": "{{username}} Avatar",
"Avatar_Url": "Avatar-URL",
"Avatars": "Avatars",
"Away": "Afwezig",
Expand Down Expand Up @@ -207,6 +208,7 @@
"Expanded": "Uitgebreid",
"Expiration_Days": "Vervaldatum (Dagen)",
"Favorites": "Favorieten",
"Fetch_image_from_URL": "Afbeelding ophalen van URL",
"File_description": "Bestandsbeschrijving",
"Files": "Bestanden",
"Finish_recording": "Opname beëindigen",
Expand Down Expand Up @@ -501,6 +503,7 @@
"Select_Team": "Selecteer team",
"Select_Team_Channels": "Selecteer de kanalen van het team die je wilt verlaten.",
"Select_Team_Channels_To_Delete": "Selecteer de teamkanalen die je wilt verwijderen, de kanalen die u niet selecteert, worden naar de werkruimte verplaatst.\n\nMerk op dat openbare kanalen openbaar en voor iedereen zichtbaar zullen zijn.",
"Select_Uploaded_Image": "Selecteer geüpload afbeelding",
"Select_Users": "Selecteer gebruikers",
"Send": "Verzenden",
"Send_audio_message": "Audiobericht verzenden",
Expand Down
Loading
Loading