Skip to content

Commit

Permalink
chore: updated accessibility label of avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
OtavioStasiak committed Dec 10, 2024
1 parent 007fe5e commit e9f381b
Show file tree
Hide file tree
Showing 24 changed files with 31 additions and 2 deletions.
10 changes: 8 additions & 2 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 Down Expand Up @@ -38,6 +39,7 @@ const Avatar = React.memo(
return null;
}

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

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

return (
<View accessibilityLabel={!onPress ? accessibilityLabel : undefined} style={[avatarStyle, style]} testID='avatar'>
<View
accessible
accessibilityLabel={!onPress ? avatarAccessibilityLabel : undefined}
style={[avatarStyle, style]}
testID='avatar'>
{image}
{children}
</View>
Expand Down
1 change: 1 addition & 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
1 change: 1 addition & 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
1 change: 1 addition & 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
1 change: 1 addition & 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
1 change: 1 addition & 0 deletions 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
1 change: 1 addition & 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
1 change: 1 addition & 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
1 change: 1 addition & 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
1 change: 1 addition & 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
1 change: 1 addition & 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
1 change: 1 addition & 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
1 change: 1 addition & 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
1 change: 1 addition & 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
1 change: 1 addition & 0 deletions app/i18n/locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"Automatic": "Automático",
"Avatar": "Avatar",
"Avatar_changed_successfully": "Avatar alterado com sucesso!",
"Avatar_Photo": "Avatar de {{username}}",
"Avatar_Url": "Avatar URL",
"Avatars": "Avatars",
"Away": "Ausente",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/pt-PT.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"Auto_Translate": "Auto-Tradução",
"Automatic": "Automático",
"Avatar_changed_successfully": "Avatar alterado com sucesso!",
"Avatar_Photo": "Avatar de {{username}}",
"Avatar_Url": "URL do Avatar",
"Away": "Ausente",
"Black": "Preto",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"Auto-join": "Автодобавление",
"Automatic": "Автоматически",
"Avatar_changed_successfully": "Аватар успешно изменен!",
"Avatar_Photo": "{{username}} Аватар",
"Avatar_Url": "URL аватара",
"Avatars": "Аватары",
"Away": "Отошел",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/sl-SI.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"Auto-join": "Samodejna pridružitev",
"Automatic": "Avtomatično",
"Avatar_changed_successfully": "Avatar uspešno spremenjen",
"Avatar_Photo": "{{username}} Avatar",
"Avatar_Url": "Avatar URL",
"Avatars": "Avatari",
"Away": "Odsoten",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"Auto-join": "Anslut automatiskt",
"Automatic": "Automatiskt",
"Avatar_changed_successfully": "Avataren har ändrats",
"Avatar_Photo": "{{username}} Avatar",
"Avatar_Url": "URL till avatar",
"Avatars": "Avatarer",
"Away": "Borta",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/ta-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
1 change: 1 addition & 0 deletions app/i18n/locales/te-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
1 change: 1 addition & 0 deletions app/i18n/locales/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"Auto_Translate": "Otomatik Çevir",
"Automatic": "Otomatik",
"Avatar_changed_successfully": "Profil fotoğrafı başarıyla değiştirildi!",
"Avatar_Photo": "{{username}} Avatar",
"Avatar_Url": "Profil fotoğrafı URL'si",
"Away": "Uzakta",
"Black": "Koyu",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/zh-CN.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": "头像地址",
"Away": "离开",
"Black": "黑色",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/zh-TW.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": "大頭貼地址",
"Away": "離開",
"Black": "黑色",
Expand Down

0 comments on commit e9f381b

Please sign in to comment.