Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/new-poems-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

Fixes a missing translation on the create channel/team modal
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,80 @@ describe.each([
});
});
});

describe('useEncryptedRoomDescription, Portuguese (pt-BR)', () => {
it('returns "Encrypted_not_available" when channel is not private and E2E is enabled,', () => {
const { result } = renderHook(() => useEncryptedRoomDescription('channel'), {
wrapper: mockAppRoot()
.withSetting('E2E_Enable', true)
.withDefaultLanguage('pt-BR')
.withTranslations('pt-BR', 'core', {
Encrypted_not_available: 'Indisponível para {{roomType}} público',
channel: 'canal',
team: 'equipe',
})
.build(),
});
const describe = result.current;

expect(describe({ isPrivate: false, encrypted: false })).toBe('Indisponível para canal público');
});

it('returns "Encrypted_not_available" when team is not private and E2E is enabled,', () => {
const { result } = renderHook(() => useEncryptedRoomDescription('team'), {
wrapper: mockAppRoot()
.withSetting('E2E_Enable', true)
.withDefaultLanguage('pt-BR')
.withTranslations('pt-BR', 'core', {
Encrypted_not_available: 'Indisponível para {{roomType}} público',
channel: 'canal',
team: 'equipe',
})
.build(),
});
const describe = result.current;

expect(describe({ isPrivate: false, encrypted: false })).toBe('Indisponível para equipe público');
});

it('returns "Encrypted_messages" when channel is private and encrypted are true and E2E is enabled', () => {
const { result } = renderHook(() => useEncryptedRoomDescription('channel'), {
wrapper: mockAppRoot()
.withSetting('E2E_Enable', true)
.withDefaultLanguage('pt-BR')
.withTranslations('pt-BR', 'core', {
// TODO: Improve the portuguese translation with a way to captalize the room type for it to be in the start of the sentence
Encrypted_messages:
'Criptografado de ponta a ponta {{roomType}}. A pesquisa não funcionará com {{roomType}} criptografado e as notificações podem não mostrar o conteúdo das mensagens.',
team: 'equipe',
channel: 'canal',
})
.build(),
});
const describe = result.current;

expect(describe({ isPrivate: true, encrypted: true })).toBe(
'Criptografado de ponta a ponta canal. A pesquisa não funcionará com canal criptografado e as notificações podem não mostrar o conteúdo das mensagens.',
);
});

it('returns "Encrypted_messages" when team is private and encrypted are true and E2E is enabled', () => {
const { result } = renderHook(() => useEncryptedRoomDescription('team'), {
wrapper: mockAppRoot()
.withSetting('E2E_Enable', true)
.withTranslations('pt-BR', 'core', {
Encrypted_messages:
'Criptografado de ponta a ponta {{roomType}}. A pesquisa não funcionará com {{roomType}} criptografado e as notificações podem não mostrar o conteúdo das mensagens.',
channel: 'canal',
team: 'equipe',
})
.withDefaultLanguage('pt-BR')
.build(),
});
const describe = result.current;

expect(describe({ isPrivate: true, encrypted: true })).toBe(
'Criptografado de ponta a ponta equipe. A pesquisa não funcionará com equipe criptografado e as notificações podem não mostrar o conteúdo das mensagens.',
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ export const useEncryptedRoomDescription = (roomType: 'channel' | 'team') => {
return t('Not_available_for_this_workspace');
}
if (!isPrivate) {
return t('Encrypted_not_available', { roomType });
return t('Encrypted_not_available', { roomType: t(roomType) });
}
if (encrypted) {
return t('Encrypted_messages', { roomType });
return t('Encrypted_messages', { roomType: t(roomType) });
}
return t('Encrypted_messages_false');
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ export const useEncryptedRoomDescription = (roomType: 'channel' | 'team') => {
return t('Not_available_for_this_workspace');
}
if (!isPrivate) {
return t('Encrypted_not_available', { roomType });
return t('Encrypted_not_available', { roomType: t(roomType) });
}
if (encrypted) {
return t('Encrypted_messages', { roomType });
return t('Encrypted_messages', { roomType: t(roomType) });
}
return t('Encrypted_messages_false');
};
Expand Down
Loading