Skip to content

Commit

Permalink
Add callout in auto-translate sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusbsilva137 committed Sep 14, 2023
1 parent 9655b88 commit 7d2c64c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FieldGroup, Field, ToggleSwitch, Select } from '@rocket.chat/fuselage';
import { FieldGroup, Field, ToggleSwitch, Select, Callout } from '@rocket.chat/fuselage';
import type { SelectOption } from '@rocket.chat/fuselage';
import { useTranslation } from '@rocket.chat/ui-contexts';
import type { ReactElement, ChangeEvent } from 'react';
Expand Down Expand Up @@ -42,6 +42,11 @@ const AutoTranslate = ({
</ContextualbarHeader>
<ContextualbarContent pbs={24}>
<FieldGroup>
{room.encrypted && (
<Callout title={t('Automatic_translation_not_available')} type='warning'>
{t('Automatic_translation_not_available_info')}
</Callout>
)}
<Field>
<Field.Row>
<ToggleSwitch
Expand All @@ -54,7 +59,7 @@ const AutoTranslate = ({
</Field.Row>
</Field>
<Field>
<Field.Label htmlFor='language'>{t('Language')}</Field.Label>
<Field.Label htmlFor='translate-to'>{t('Translate_to')}</Field.Label>
<Field.Row verticalAlign='middle'>
<Select
id='language'
Expand Down
3 changes: 3 additions & 0 deletions apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,8 @@
"Authorization_URL": "Authorization URL",
"Authorize": "Authorize",
"Authorize_access_to_your_account": "Authorize access to your account",
"Automatic_translation_not_available": "Automatic translation not available",
"Automatic_translation_not_available_info": "This room has E2E encryption enabled, translation cannot work with encrypted messages",
"Auto_Load_Images": "Auto Load Images",
"Auto_Selection": "Auto Selection",
"Auto_Translate": "Auto-Translate",
Expand Down Expand Up @@ -5154,6 +5156,7 @@
"Transferred": "Transferred",
"Translate": "Translate",
"Translated": "Translated",
"Translate_to": "Translate to",
"Translations": "Translations",
"Travel_and_Places": "Travel & Places",
"Trigger_removed": "Trigger removed",
Expand Down
3 changes: 3 additions & 0 deletions apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,8 @@
"Author_Site": "Página do autor",
"Authorization_URL": "URL de autorização",
"Authorize": "Autorizar",
"Automatic_translation_not_available": "Tradução automática indisponível",
"Automatic_translation_not_available_info": "Esta sala tem criptografia E2E ativada, a tradução não pode funcionar com mensagens criptografadas",
"Auto_Load_Images": "Carregar imagens automaticamente",
"Auto_Selection": "Seleção automática",
"Auto_Translate": "Traduzir automaticamente",
Expand Down Expand Up @@ -4336,6 +4338,7 @@
"Transferred": "Transferido",
"Translate": "Traduzir",
"Translated": "Traduzido",
"Translate_to": "Traduzir para",
"Translations": "Traduções",
"Travel_and_Places": "Viagem e Locais",
"Trigger_removed": "Gatilho removido",
Expand Down

0 comments on commit 7d2c64c

Please sign in to comment.