Skip to content

Commit

Permalink
i18n, disable headers, #roomname
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolmello committed Mar 5, 2024
1 parent 0332150 commit dd70481
Show file tree
Hide file tree
Showing 28 changed files with 120 additions and 42 deletions.
13 changes: 10 additions & 3 deletions app/containers/RoomHeader/RoomHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ interface IRoomHeader {
onPress: Function;
testID?: string;
sourceType?: IOmnichannelSource;
disabled?: boolean;
}

const SubTitle = React.memo(({ usersTyping, subtitle, renderFunc, scale }: TRoomHeaderSubTitle) => {
Expand Down Expand Up @@ -139,7 +140,8 @@ const Header = React.memo(
teamMain,
testID,
usersTyping = [],
sourceType
sourceType,
disabled
}: IRoomHeader) => {
const { colors } = useTheme();
const portrait = height > width;
Expand Down Expand Up @@ -177,8 +179,13 @@ const Header = React.memo(
testID='room-header'
accessibilityLabel={title}
onPress={handleOnPress}
style={styles.container}
disabled={!!tmid}
style={[
styles.container,
{
opacity: disabled ? 0.5 : 1
}
]}
disabled={disabled}
hitSlop={HIT_SLOP}
>
<View style={styles.titleContainer}>
Expand Down
5 changes: 4 additions & 1 deletion app/containers/RoomHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ interface IRoomHeaderContainerProps {
testID?: string;
sourceType?: IOmnichannelSource;
visitor?: IVisitor;
disabled?: boolean;
}

const RoomHeaderContainer = React.memo(
Expand All @@ -36,7 +37,8 @@ const RoomHeaderContainer = React.memo(
tmid,
type,
sourceType,
visitor
visitor,
disabled
}: IRoomHeaderContainerProps) => {
let subtitle: string | undefined;
let statusVisitor: TUserStatus | undefined;
Expand Down Expand Up @@ -86,6 +88,7 @@ const RoomHeaderContainer = React.memo(
testID={testID}
onPress={onPress}
sourceType={sourceType}
disabled={disabled}
/>
);
}
Expand Down
4 changes: 3 additions & 1 deletion app/i18n/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -491,5 +491,7 @@
"you": "أنت",
"you_were_mentioned": "تمت الإشارة إليك",
"missing_room_e2ee_description": "يجب تحديث مفاتيح التشفير للغرفة، ويجب أن يكون عضو آخر في الغرفة متصلاً بالإنترنت حتى يحدث ذلك.",
"missing_room_e2ee_title": "تحقق مرة أخرى بعد بضع لحظات"
"missing_room_e2ee_title": "تحقق مرة أخرى بعد بضع لحظات",
"encrypted_room_description": "أدخل كلمة المرور الخاصة بالتشفير من طرف إلى طرف للوصول.",
"encrypted_room_title": "{{room_name}} مشفر"
}
4 changes: 3 additions & 1 deletion app/i18n/locales/bn-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -757,5 +757,7 @@
"you": "তুমি",
"you_were_mentioned": "আপনি উল্লেখ করা হয়েছিলেন",
"missing_room_e2ee_description": "ঘরের জন্য এনক্রিপশন কীগুলি আপডেট করা প্রয়োজন, এর জন্য আরেকজন ঘরের সদস্যকে অনলাইনে থাকতে হবে।",
"missing_room_e2ee_title": "কয়েক মুহূর্তের মধ্যে পরীক্ষা করুন"
"missing_room_e2ee_title": "কয়েক মুহূর্তের মধ্যে পরীক্ষা করুন",
"encrypted_room_description": "অ্যাক্সেস করতে আপনার এন্ড-টু-এন্ড এনক্রিপশন পাসওয়ার্ড লিখুন।",
"encrypted_room_title": "{{room_name}} এনক্রিপ্ট করা হয়েছে"
}
4 changes: 3 additions & 1 deletion app/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -747,5 +747,7 @@
"you": "Sie",
"you_were_mentioned": "Sie wurden erwähnt",
"missing_room_e2ee_description": "Die Verschlüsselungsschlüssel für den Raum müssen aktualisiert werden, ein anderer Raummitglied muss online sein, damit dies geschehen kann.",
"missing_room_e2ee_title": "Überprüfen Sie in ein paar Momenten zurück"
"missing_room_e2ee_title": "Überprüfen Sie in ein paar Momenten zurück",
"encrypted_room_description": "Geben Sie Ihr Passwort für die Ende-zu-Ende-Verschlüsselung ein, um Zugang zu erhalten.",
"encrypted_room_title": "{{room_name}} ist verschlüsselt"
}
2 changes: 1 addition & 1 deletion app/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@
"e2ee_disabled": "End-to-end encryption is disabled",
"e2ee_enabled": "End-to-end encryption is enabled",
"encrypted_room_description": "Enter your end-to-end encryption password to access.",
"encrypted_room_title": "This room is encrypted",
"encrypted_room_title": "{{room_name}} is encrypted",
"error-action-not-allowed": "{{action}} is not allowed",
"error-avatar-invalid-url": "Invalid avatar URL: {{url}}",
"error-duplicate-channel-name": "A channel with name {{room_name}} exists",
Expand Down
4 changes: 3 additions & 1 deletion app/i18n/locales/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -719,5 +719,7 @@
"you": "sinä",
"you_were_mentioned": "sinut mainittiin",
"missing_room_e2ee_description": "Huoneen salausavaimet on päivitettävä, toisen huoneen jäsenen on oltava verkossa, jotta tämä voi tapahtua.",
"missing_room_e2ee_title": "Tarkista uudelleen muutaman hetken kuluttua"
"missing_room_e2ee_title": "Tarkista uudelleen muutaman hetken kuluttua",
"encrypted_room_description": "Syötä päästä päähän -salauksen salasanasi päästäksesi käsiksi.",
"encrypted_room_title": "{{room_name}} on salattu"
}
4 changes: 3 additions & 1 deletion app/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -638,5 +638,7 @@
"you": "vous",
"you_were_mentioned": "vous avez été mentionné",
"missing_room_e2ee_description": "Les clés de chiffrement de la pièce doivent être mises à jour, un autre membre de la pièce doit être en ligne pour que cela se produise.",
"missing_room_e2ee_title": "Revenez dans quelques instants"
"missing_room_e2ee_title": "Revenez dans quelques instants",
"encrypted_room_description": "Entrez votre mot de passe de cryptage de bout en bout pour accéder.",
"encrypted_room_title": "{{room_name}} est crypté"
}
4 changes: 3 additions & 1 deletion app/i18n/locales/hi-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -757,5 +757,7 @@
"you": "आप",
"you_were_mentioned": "आपका उल्लेख किया गया था",
"missing_room_e2ee_description": "कमरे के लिए एन्क्रिप्शन कुंजियों को अपडेट किया जाना चाहिए, इसके लिए एक और कमरे के सदस्य को ऑनलाइन होना चाहिए।",
"missing_room_e2ee_title": "कुछ क्षणों में वापस जाँच करें"
"missing_room_e2ee_title": "कुछ क्षणों में वापस जाँच करें",
"encrypted_room_description": "पहुँचने के लिए अपना एंड-टू-एंड एन्क्रिप्शन पासवर्ड दर्ज करें।",
"encrypted_room_title": "{{room_name}} एन्क्रिप्टेड है"
}
4 changes: 3 additions & 1 deletion app/i18n/locales/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -760,5 +760,7 @@
"you": "ön",
"you_were_mentioned": "önt megemlítették",
"missing_room_e2ee_description": "A szoba titkosítási kulcsait frissíteni kell, ehhez egy másik szobatagnak online kell lennie.",
"missing_room_e2ee_title": "Nézzen vissza néhány perc múlva"
"missing_room_e2ee_title": "Nézzen vissza néhány perc múlva",
"encrypted_room_description": "Adja meg a végponttól végpontig terjedő titkosítási jelszavát a hozzáféréshez.",
"encrypted_room_title": "{{room_name}} titkosítva van"
}
4 changes: 3 additions & 1 deletion app/i18n/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -541,5 +541,7 @@
"you": "tu",
"you_were_mentioned": "sei stato menzionato",
"missing_room_e2ee_description": "Le chiavi di crittografia per la stanza devono essere aggiornate, un altro membro della stanza deve essere online affinché ciò avvenga.",
"missing_room_e2ee_title": "Ricontrolla tra qualche istante"
"missing_room_e2ee_title": "Ricontrolla tra qualche istante",
"encrypted_room_description": "Inserisci la tua password di crittografia end-to-end per accedere.",
"encrypted_room_title": "{{room_name}} è criptato"
}
4 changes: 3 additions & 1 deletion app/i18n/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -407,5 +407,7 @@
"you": "あなた",
"you_were_mentioned": "あなたがメンションしました",
"missing_room_e2ee_description": "部屋の暗号化キーを更新する必要があります。これが行われるためには、別の部屋のメンバーがオンラインである必要があります。",
"missing_room_e2ee_title": "数分後にもう一度確認してください"
"missing_room_e2ee_title": "数分後にもう一度確認してください",
"encrypted_room_description": "エンドツーエンドの暗号化パスワードを入力してアクセスしてください。",
"encrypted_room_title": "{{room_name}}は暗号化されています"
}
4 changes: 3 additions & 1 deletion app/i18n/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -638,5 +638,7 @@
"you": "jij",
"you_were_mentioned": "je bent vermeld",
"missing_room_e2ee_description": "De versleutelingssleutels voor de kamer moeten worden bijgewerkt, een ander kamerlid moet online zijn om dit te laten gebeuren.",
"missing_room_e2ee_title": "Kom over een paar momenten terug"
"missing_room_e2ee_title": "Kom over een paar momenten terug",
"encrypted_room_description": "Voer uw end-to-end encryptiewachtwoord in om toegang te krijgen.",
"encrypted_room_title": "{{room_name}} is versleuteld"
}
4 changes: 3 additions & 1 deletion app/i18n/locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -824,5 +824,7 @@
"you": "você",
"you_were_mentioned": "você foi mencionado",
"missing_room_e2ee_description": "As chaves de criptografia da sala precisam ser atualizadas, outro membro da sala precisa estar online para que isso aconteça.",
"missing_room_e2ee_title": "Verifique novamente em alguns momentos"
"missing_room_e2ee_title": "Verifique novamente em alguns momentos",
"encrypted_room_description": "Insira sua senha de criptografia de ponta a ponta para acessar.",
"encrypted_room_title": "{{room_name}} está criptografado"
}
4 changes: 3 additions & 1 deletion app/i18n/locales/pt-PT.json
Original file line number Diff line number Diff line change
Expand Up @@ -369,5 +369,7 @@
"you": "você",
"you_were_mentioned": "você foi mencionado",
"missing_room_e2ee_description": "As chaves de criptografia da sala precisam ser atualizadas, outro membro da sala precisa estar online para que isso aconteça.",
"missing_room_e2ee_title": "Volte a verificar daqui a alguns momentos"
"missing_room_e2ee_title": "Volte a verificar daqui a alguns momentos",
"encrypted_room_description": "Insira a sua palavra-passe de encriptação de ponta a ponta para aceder.",
"encrypted_room_title": "{{room_name}} está encriptado"
}
4 changes: 3 additions & 1 deletion app/i18n/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -687,5 +687,7 @@
"you": "вы",
"you_were_mentioned": "вы были упомянуты",
"missing_room_e2ee_description": "Ключи шифрования для комнаты должны быть обновлены, другой участник комнаты должен быть в сети, чтобы это произошло.",
"missing_room_e2ee_title": "Проверьте еще раз через несколько моментов"
"missing_room_e2ee_title": "Проверьте еще раз через несколько моментов",
"encrypted_room_description": "Введите свой пароль для шифрования от конца к концу для доступа.",
"encrypted_room_title": "{{room_name}} зашифрован"
}
4 changes: 3 additions & 1 deletion app/i18n/locales/sl-SI.json
Original file line number Diff line number Diff line change
Expand Up @@ -653,5 +653,7 @@
"you": "ti",
"you_were_mentioned": "Bili ste omenjeni",
"missing_room_e2ee_description": "Ključi za šifriranje sobe morajo biti posodobljeni, drugi član sobe mora biti na spletu, da se to zgodi.",
"missing_room_e2ee_title": "Ponovno preverite čez nekaj trenutkov"
"missing_room_e2ee_title": "Ponovno preverite čez nekaj trenutkov",
"encrypted_room_description": "Vnesite geslo za šifriranje od konca do konca za dostop.",
"encrypted_room_title": "{{room_name}} je šifriran"
}
4 changes: 3 additions & 1 deletion app/i18n/locales/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -717,5 +717,7 @@
"you": "du",
"you_were_mentioned": "du nämndes",
"missing_room_e2ee_description": "Krypteringsnycklarna för rummet behöver uppdateras, en annan rummedlem måste vara online för att detta ska hända.",
"missing_room_e2ee_title": "Kontrollera igen om några ögonblick"
"missing_room_e2ee_title": "Kontrollera igen om några ögonblick",
"encrypted_room_description": "Ange ditt lösenord för end-to-end-kryptering för att få tillgång.",
"encrypted_room_title": "{{room_name}} är krypterat"
}
4 changes: 3 additions & 1 deletion app/i18n/locales/ta-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -757,5 +757,7 @@
"you": "நீங்கள்",
"you_were_mentioned": "உங்களுக்கு குறிக்கப்பட்டார்",
"missing_room_e2ee_description": "அறைக்கான குறியாக்க விசைகள் புதுப்பிக்கப்பட வேண்டும், இது நடக்க மற்றொரு அறை உறுப்பினர் ஆன்லைனில் இருக்க வேண்டும்.",
"missing_room_e2ee_title": "சில நிமிடங்களில் மீண்டும் சரிபார்க்கவும்"
"missing_room_e2ee_title": "சில நிமிடங்களில் மீண்டும் சரிபார்க்கவும்",
"encrypted_room_description": "அணுகலுக்கு உங்கள் முடிவுக்கு முடிவு குறியாக்க கடவுச்சொல்லை உள்ளிடவும்.",
"encrypted_room_title": "{{room_name}} குறியாக்கப்பட்டுள்ளது"
}
4 changes: 3 additions & 1 deletion app/i18n/locales/te-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -757,5 +757,7 @@
"you": "మీరు",
"you_were_mentioned": "మీరు పేర్కొనబడింది",
"missing_room_e2ee_description": "గది కోసం ఎన్క్రిప్షన్ కీలు నవీకరించబడాలి, దీని జరగాలంటే మరొక గది సభ్యుడు ఆన్లైన్‌లో ఉండాలి.",
"missing_room_e2ee_title": "కొన్ని క్షణాల్లో తిరిగి తనిఖీ చేయండి"
"missing_room_e2ee_title": "కొన్ని క్షణాల్లో తిరిగి తనిఖీ చేయండి",
"encrypted_room_description": "ప్రాప్యతకు మీ అంతిమ నుండి అంతిమ ఎన్క్రిప్షన్ పాస్‌వర్డ్‌ను నమోదు చేయండి.",
"encrypted_room_title": "{{room_name}} ఎన్క్రిప్ట్ చేయబడింది"
}
4 changes: 3 additions & 1 deletion app/i18n/locales/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -524,5 +524,7 @@
"you": "siz",
"you_were_mentioned": "senden bahsedildi",
"missing_room_e2ee_description": "Odanın şifreleme anahtarları güncellenmelidir, bunun gerçekleşmesi için başka bir oda üyesinin çevrimiçi olması gerekmektedir.",
"missing_room_e2ee_title": "Birkaç an içinde tekrar kontrol edin"
"missing_room_e2ee_title": "Birkaç an içinde tekrar kontrol edin",
"encrypted_room_description": "Erişmek için uçtan uca şifreleme şifrenizi girin.",
"encrypted_room_title": "{{room_name}} şifrelenmiştir"
}
4 changes: 3 additions & 1 deletion app/i18n/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -482,5 +482,7 @@
"you": "",
"you_were_mentioned": "你被提到了",
"missing_room_e2ee_description": "房间的加密密钥需要更新,另一位房间成员需要在线才能进行此操作。",
"missing_room_e2ee_title": "过几分钟再回来检查"
"missing_room_e2ee_title": "过几分钟再回来检查",
"encrypted_room_description": "输入您的端到端加密密码以访问。",
"encrypted_room_title": "{{room_name}} 已加密"
}
4 changes: 3 additions & 1 deletion app/i18n/locales/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -511,5 +511,7 @@
"you": "",
"you_were_mentioned": "你被提到了",
"missing_room_e2ee_description": "房間的加密密鑰需要更新,另一位房間成員需要在線才能進行此操作。",
"missing_room_e2ee_title": "過幾分鐘再回來檢查"
"missing_room_e2ee_title": "過幾分鐘再回來檢查",
"encrypted_room_description": "輸入您的端對端加密密碼以存取。",
"encrypted_room_title": "{{room_name}} 已加密"
}
17 changes: 13 additions & 4 deletions app/views/RoomView/RightButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ interface IRightButtonsProps extends Pick<ISubscription, 't'> {
colors?: TColors;
issuesWithNotifications: boolean;
notificationsDisabled?: boolean;
disabled: boolean;
}

interface IRigthButtonsState {
Expand Down Expand Up @@ -361,13 +362,18 @@ class RightButtonsContainer extends Component<IRightButtonsProps, IRigthButtonsS

render() {
const { isFollowingThread, tunread, tunreadUser, tunreadGroup } = this.state;
const { t, tmid, threadsEnabled, rid, colors, issuesWithNotifications, notificationsDisabled } = this.props;
const { t, tmid, threadsEnabled, rid, colors, issuesWithNotifications, notificationsDisabled, disabled } = this.props;

if (t === 'l') {
if (!this.isOmnichannelPreview()) {
return (
<HeaderButton.Container>
<HeaderButton.Item iconName='kebab' onPress={this.showMoreActions} testID='room-view-header-omnichannel-kebab' />
<HeaderButton.Item
iconName='kebab'
onPress={this.showMoreActions}
testID='room-view-header-omnichannel-kebab'
disabled={disabled}
/>
</HeaderButton.Container>
);
}
Expand All @@ -380,6 +386,7 @@ class RightButtonsContainer extends Component<IRightButtonsProps, IRigthButtonsS
iconName={isFollowingThread ? 'notification' : 'notification-disabled'}
onPress={this.toggleFollowThread}
testID={isFollowingThread ? 'room-view-header-unfollow' : 'room-view-header-follow'}
disabled={disabled}
/>
</HeaderButton.Container>
);
Expand All @@ -392,18 +399,20 @@ class RightButtonsContainer extends Component<IRightButtonsProps, IRigthButtonsS
iconName='notification-disabled'
onPress={this.navigateToNotificationOrPushTroubleshoot}
testID='room-view-push-troubleshoot'
disabled={disabled}
/>
) : null}
{rid ? <HeaderCallButton rid={rid} /> : null}
{rid ? <HeaderCallButton rid={rid} disabled={disabled} /> : null}
{threadsEnabled ? (
<HeaderButton.Item
iconName='threads'
onPress={this.goThreadsView}
testID='room-view-header-threads'
badge={() => <HeaderButton.BadgeUnread tunread={tunread} tunreadUser={tunreadUser} tunreadGroup={tunreadGroup} />}
disabled={disabled}
/>
) : null}
<HeaderButton.Item iconName='search' onPress={this.goSearchView} testID='room-view-search' />
<HeaderButton.Item iconName='search' onPress={this.goSearchView} testID='room-view-search' disabled={disabled} />
</HeaderButton.Container>
);
}
Expand Down
7 changes: 5 additions & 2 deletions app/views/RoomView/components/EncryptedRoom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ import Button from '../../../containers/Button';
import sharedStyles from '../../Styles';
import { useAppSelector } from '../../../lib/hooks';
import I18n from '../../../i18n';
import { TNavigation } from '../../../stacks/stackType';

const GAP = 32;

export const EncryptedRoom = ({
roomName,
navigation
}: {
navigation: StackNavigationProp<ChatsStackParamList, 'RoomView'>;
roomName: string;
navigation: StackNavigationProp<ChatsStackParamList & TNavigation, 'RoomView'>;
}): ReactElement => {
const { colors } = useTheme();
const styles = useStyle();
Expand All @@ -36,7 +39,7 @@ export const EncryptedRoom = ({
<View style={styles.icon}>
<CustomIcon name='encrypted' size={42} color={colors.fontSecondaryInfo} />
</View>
<Text style={styles.title}>{I18n.t('encrypted_room_title')}</Text>
<Text style={styles.title}>{I18n.t('encrypted_room_title', { room_name: `#${roomName}` })}</Text>
<Text style={styles.description}>{I18n.t('encrypted_room_description')}</Text>
</View>
<Button title={I18n.t('Enter_E2EE_Password')} onPress={navigate} />
Expand Down
4 changes: 2 additions & 2 deletions app/views/RoomView/components/HeaderCallButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import React from 'react';
import * as HeaderButton from '../../../containers/HeaderButton';
import { useVideoConf } from '../../../lib/hooks/useVideoConf';

export const HeaderCallButton = ({ rid }: { rid: string }): React.ReactElement | null => {
export const HeaderCallButton = ({ rid, disabled }: { rid: string; disabled: boolean }): React.ReactElement | null => {
const { showInitCallActionSheet, callEnabled, disabledTooltip } = useVideoConf(rid);

if (callEnabled)
return (
<HeaderButton.Item
disabled={disabledTooltip}
disabled={disabledTooltip || disabled}
iconName='phone'
onPress={showInitCallActionSheet}
testID='room-view-header-call'
Expand Down
Loading

0 comments on commit dd70481

Please sign in to comment.