From 64feb8eddadeb4db00e0289592fae35a6d0ef2eb Mon Sep 17 00:00:00 2001 From: Leandro Schwab Dias Carneiro Date: Thu, 29 Dec 2022 11:21:17 -0300 Subject: [PATCH 1/2] PT-BR Translations Adds PT-BR Localization Co-Authored-By: Aliffy Benevides <56937947+aliffy-benevides@users.noreply.github.com> --- .../src/index.js | 6 ++- .../src/messages.js | 13 ++++++ .../src/messages.js | 4 +- .../src/calculateDateText.js | 4 +- .../src/list-item.js | 4 +- .../src/messages.js | 13 ++++++ .../@webex/react-component-utils/src/date.js | 6 +-- .../src/enhancers/withIntl.js | 4 ++ .../@webex/widget-files/src/container.js | 5 ++- .../@webex/widget-files/src/index.js | 4 +- .../@webex/widget-files/src/messages.js | 12 ++++++ .../@webex/widget-files/src/selectors.js | 2 +- .../widget-files/src/translations/index.js | 7 ++++ .../widget-files/src/translations/pt-BR.js | 4 ++ .../@webex/widget-meet/src/index.js | 4 +- .../widget-meet/src/translations/index.js | 7 ++++ .../widget-meet/src/translations/pt-BR.js | 18 ++++++++ .../@webex/widget-message/src/index.js | 4 +- .../widget-message/src/translations/en.js | 1 + .../widget-message/src/translations/index.js | 7 ++++ .../widget-message/src/translations/pt-BR.js | 41 +++++++++++++++++++ .../src/components/add-participant/index.js | 4 +- .../@webex/widget-roster/src/container.js | 2 +- .../@webex/widget-roster/src/index.js | 4 +- .../@webex/widget-roster/src/messages.js | 8 ++++ .../widget-roster/src/translations/index.js | 7 ++++ .../widget-roster/src/translations/pt-BR.js | 15 +++++++ .../src/enhancers/activity-menu.js | 10 +++-- .../@webex/widget-space/src/index.js | 4 +- .../@webex/widget-space/src/messages.js | 16 ++++++++ .../widget-space/src/translations/index.js | 7 ++++ .../widget-space/src/translations/pt-BR.js | 19 +++++++++ 32 files changed, 237 insertions(+), 29 deletions(-) create mode 100644 packages/node_modules/@webex/react-component-activity-item-base/src/messages.js create mode 100644 packages/node_modules/@webex/react-component-people-list/src/messages.js create mode 100644 packages/node_modules/@webex/widget-files/src/messages.js create mode 100644 packages/node_modules/@webex/widget-files/src/translations/index.js create mode 100644 packages/node_modules/@webex/widget-files/src/translations/pt-BR.js create mode 100644 packages/node_modules/@webex/widget-meet/src/translations/index.js create mode 100644 packages/node_modules/@webex/widget-meet/src/translations/pt-BR.js create mode 100644 packages/node_modules/@webex/widget-message/src/translations/index.js create mode 100644 packages/node_modules/@webex/widget-message/src/translations/pt-BR.js create mode 100644 packages/node_modules/@webex/widget-roster/src/translations/index.js create mode 100644 packages/node_modules/@webex/widget-roster/src/translations/pt-BR.js create mode 100644 packages/node_modules/@webex/widget-space/src/translations/index.js create mode 100644 packages/node_modules/@webex/widget-space/src/translations/pt-BR.js diff --git a/packages/node_modules/@webex/react-component-activity-item-base/src/index.js b/packages/node_modules/@webex/react-component-activity-item-base/src/index.js index 4444da5af..a6ee9b745 100644 --- a/packages/node_modules/@webex/react-component-activity-item-base/src/index.js +++ b/packages/node_modules/@webex/react-component-activity-item-base/src/index.js @@ -5,6 +5,7 @@ import classNames from 'classnames'; import PresenceAvatar from '@webex/react-container-presence-avatar'; import {Icon} from '@momentum-ui/react'; +import messages from './messages'; import styles from './styles.css'; @@ -55,12 +56,13 @@ function ActivityItemBase({ onActivityDelete, onActivityFlag, onActivityRetry, - timestamp + timestamp, + intl, }) { let deleteAction; let flagAction; let errorDisplay; - const displayName = isSelf ? 'You' : name; + const displayName = isSelf ? intl.formatMessage(messages.you) : name; function handleOnDelete() { onActivityDelete(id); diff --git a/packages/node_modules/@webex/react-component-activity-item-base/src/messages.js b/packages/node_modules/@webex/react-component-activity-item-base/src/messages.js new file mode 100644 index 000000000..79c38a87c --- /dev/null +++ b/packages/node_modules/@webex/react-component-activity-item-base/src/messages.js @@ -0,0 +1,13 @@ +/* + * Activity Item Base + * + * This contains all the text for the ActivityItemBase component. + */ +import {defineMessages} from 'react-intl'; + +export default defineMessages({ + you: { + id: 'ciscospark.itemBaseActivity.message.you', + defaultMessage: 'You' + }, +}); diff --git a/packages/node_modules/@webex/react-component-activity-system-message/src/messages.js b/packages/node_modules/@webex/react-component-activity-system-message/src/messages.js index 38c0a8379..85b22810b 100644 --- a/packages/node_modules/@webex/react-component-activity-system-message/src/messages.js +++ b/packages/node_modules/@webex/react-component-activity-system-message/src/messages.js @@ -27,7 +27,7 @@ export default defineMessages({ defaultMessage: 'You added {name} to this space.' }, someoneAdded: { - id: 'ciscospark.systemMessage.message.youAdded', + id: 'ciscospark.systemMessage.message.someoneAdded', defaultMessage: '{name} was added to this space.' }, youRemoved: { @@ -35,7 +35,7 @@ export default defineMessages({ defaultMessage: 'You removed {name} from this space.' }, someoneRemoved: { - id: 'ciscospark.systemMessage.message.youRemoved', + id: 'ciscospark.systemMessage.message.someoneRemoved', defaultMessage: '{name} was removed from this space.' } }); diff --git a/packages/node_modules/@webex/react-component-day-separator/src/calculateDateText.js b/packages/node_modules/@webex/react-component-day-separator/src/calculateDateText.js index 32eb460b1..e754fab73 100644 --- a/packages/node_modules/@webex/react-component-day-separator/src/calculateDateText.js +++ b/packages/node_modules/@webex/react-component-day-separator/src/calculateDateText.js @@ -28,7 +28,7 @@ export default function calculateDateText(fromDate, now, toDate) { ); } @@ -39,7 +39,7 @@ export default function calculateDateText(fromDate, now, toDate) { ); } diff --git a/packages/node_modules/@webex/react-component-people-list/src/list-item.js b/packages/node_modules/@webex/react-component-people-list/src/list-item.js index f294b8efb..6d611e13f 100644 --- a/packages/node_modules/@webex/react-component-people-list/src/list-item.js +++ b/packages/node_modules/@webex/react-component-people-list/src/list-item.js @@ -5,6 +5,8 @@ import classNames from 'classnames'; import PresenceAvatar from '@webex/react-container-presence-avatar'; import {Button, Icon, ListItem, ListItemSection, Popover} from '@momentum-ui/react'; +import { FormattedMessage } from 'react-intl'; +import messages from './messages'; import styles from './list-item.css'; @@ -67,7 +69,7 @@ function Person({ onClick={handleRemove} removeStyle > - Remove from space + ); diff --git a/packages/node_modules/@webex/react-component-people-list/src/messages.js b/packages/node_modules/@webex/react-component-people-list/src/messages.js new file mode 100644 index 000000000..51db82818 --- /dev/null +++ b/packages/node_modules/@webex/react-component-people-list/src/messages.js @@ -0,0 +1,13 @@ +/* + * PeopleList Messages + * + * This contains all the text for the PeopleList component. + */ +import {defineMessages} from 'react-intl'; + +export default defineMessages({ + removeFromSpace: { + id: 'ciscospark.container.roster.peopleList.removeFromSpace', + defaultMessage: 'Remove from space' + } +}); diff --git a/packages/node_modules/@webex/react-component-utils/src/date.js b/packages/node_modules/@webex/react-component-utils/src/date.js index 3ced6b0ed..ba8b57ca4 100644 --- a/packages/node_modules/@webex/react-component-utils/src/date.js +++ b/packages/node_modules/@webex/react-component-utils/src/date.js @@ -24,7 +24,7 @@ export function formatDate(time) { // note endOf(day) compare to normalize now no matter how it was created if (now.endOf('day').diff(rawTime, 'days') === 0) { // today - return rawTime.format('h:mm A'); + return rawTime.format('LT'); } if (now.startOf('day').diff(rawTime) <= 86400000) { // yesterday (60*60*24*1000 = 86400000) @@ -32,10 +32,10 @@ export function formatDate(time) { } if (now.startOf('day').diff(rawTime) <= 518400000) { // 6 days ago from today (60*60*24*6*1000 = 518400000) - return rawTime.format('dddd h:mm A'); + return rawTime.format('dddd LT'); } - return rawTime.format('M/D/YY, h:mm A'); + return rawTime.format('L, LT'); } export default {}; diff --git a/packages/node_modules/@webex/webex-widget-base/src/enhancers/withIntl.js b/packages/node_modules/@webex/webex-widget-base/src/enhancers/withIntl.js index 9ffb93fdc..03ec97fc5 100644 --- a/packages/node_modules/@webex/webex-widget-base/src/enhancers/withIntl.js +++ b/packages/node_modules/@webex/webex-widget-base/src/enhancers/withIntl.js @@ -1,6 +1,8 @@ import React from 'react'; import {IntlProvider, injectIntl} from 'react-intl'; import {shape, func} from 'prop-types'; +import moment from 'moment'; +import 'moment/min/locales'; import {setWrappedDisplayName} from '@webex/react-component-utils'; @@ -21,6 +23,8 @@ export default function withIntl({ } /* eslint-enable import/no-dynamic-require, global-require */ + moment.locale(locale); + return (BaseComponent) => { const WrappedComponent = injectIntl(BaseComponent); diff --git a/packages/node_modules/@webex/widget-files/src/container.js b/packages/node_modules/@webex/widget-files/src/container.js index 50a3f8ad3..181e8fcf1 100644 --- a/packages/node_modules/@webex/widget-files/src/container.js +++ b/packages/node_modules/@webex/widget-files/src/container.js @@ -9,6 +9,7 @@ import ActivityMenuHeader from '@webex/react-component-activity-menu-header'; import ShareListingItem from './components/ShareListingItem'; import getFilesWidgetProps from './selectors'; +import messages from './messages'; import styles from './styles.css'; @@ -41,7 +42,7 @@ class FilesWidget extends Component { activityTypes={this.props.activityTypes} onClose={this.props.onClickClose && this.handleCloseClick} onMenuClick={this.props.onClickMenu && this.handleMenuClick} - title={`Files (${this.props.fileShares.length})`} + title={this.props.intl.formatMessage(messages.title, { total: this.props.fileShares.length ?? 0 })} />
{ @@ -55,7 +56,7 @@ class FilesWidget extends Component { } { !this.props.fileShares.length && ( -
No Files Found
+
{this.props.intl.formatMessage(messages.noFilesFound)}
) }
diff --git a/packages/node_modules/@webex/widget-files/src/index.js b/packages/node_modules/@webex/widget-files/src/index.js index 9f6577f1a..6702ec74c 100644 --- a/packages/node_modules/@webex/widget-files/src/index.js +++ b/packages/node_modules/@webex/widget-files/src/index.js @@ -4,12 +4,12 @@ import {constructWebexEnhancer, withIntl} from '@webex/webex-widget-base'; import ConnectedFiles from './container'; import {reducers} from './reducer'; -import messages from './translations/en'; +import messages from './translations'; export default compose( constructWebexEnhancer({ name: 'files', reducers }), - withIntl({locale: 'en', messages}) + withIntl({locale: 'pt-BR', messages: messages['pt-BR']}) )(ConnectedFiles); diff --git a/packages/node_modules/@webex/widget-files/src/messages.js b/packages/node_modules/@webex/widget-files/src/messages.js new file mode 100644 index 000000000..7fda71b08 --- /dev/null +++ b/packages/node_modules/@webex/widget-files/src/messages.js @@ -0,0 +1,12 @@ +import { defineMessages } from "react-intl"; + +export default defineMessages({ + title: { + id: 'ciscospark.container.files.title', + defaultMessage: 'Files ({total})' + }, + noFilesFound: { + id: 'ciscospark.container.files.noFilesFound', + defaultMessage: 'No Files Found' + } +}); diff --git a/packages/node_modules/@webex/widget-files/src/selectors.js b/packages/node_modules/@webex/widget-files/src/selectors.js index a6d7dad3e..97f30532b 100644 --- a/packages/node_modules/@webex/widget-files/src/selectors.js +++ b/packages/node_modules/@webex/widget-files/src/selectors.js @@ -13,7 +13,7 @@ const getConversationNonThreadActivities = (state) => state.conversation.get('so * @returns {String} */ function formatDate(dateString) { - return moment(dateString).format('M/D/YY'); + return moment(dateString).format('L'); } /** diff --git a/packages/node_modules/@webex/widget-files/src/translations/index.js b/packages/node_modules/@webex/widget-files/src/translations/index.js new file mode 100644 index 000000000..2f0e85ada --- /dev/null +++ b/packages/node_modules/@webex/widget-files/src/translations/index.js @@ -0,0 +1,7 @@ +import en from './en'; +import ptBR from './pt-BR'; + +export default { + en: en, + 'pt-BR': ptBR, +}; diff --git a/packages/node_modules/@webex/widget-files/src/translations/pt-BR.js b/packages/node_modules/@webex/widget-files/src/translations/pt-BR.js new file mode 100644 index 000000000..114299386 --- /dev/null +++ b/packages/node_modules/@webex/widget-files/src/translations/pt-BR.js @@ -0,0 +1,4 @@ +export default { + 'ciscospark.container.files.title': 'Arquivos ({total})', + 'ciscospark.container.files.noFilesFound': 'Nenhum Arquivo Encontrado', +}; diff --git a/packages/node_modules/@webex/widget-meet/src/index.js b/packages/node_modules/@webex/widget-meet/src/index.js index 5d3622164..6bb0b6135 100644 --- a/packages/node_modules/@webex/widget-meet/src/index.js +++ b/packages/node_modules/@webex/widget-meet/src/index.js @@ -6,7 +6,7 @@ import {enhancer as mediaEnhancer} from '@webex/redux-module-media'; import {reducers} from './reducer'; import ConnectedMeet from './container'; -import messages from './translations/en'; +import messages from './translations'; export {reducers}; @@ -23,7 +23,7 @@ export default compose( name: 'meet', reducers }), - withIntl({locale: 'en', messages}), + withIntl({locale: 'pt-BR', messages: messages['pt-BR']}), mediaEnhancer, mercuryEnhancer )(ConnectedMeet); diff --git a/packages/node_modules/@webex/widget-meet/src/translations/index.js b/packages/node_modules/@webex/widget-meet/src/translations/index.js new file mode 100644 index 000000000..2f0e85ada --- /dev/null +++ b/packages/node_modules/@webex/widget-meet/src/translations/index.js @@ -0,0 +1,7 @@ +import en from './en'; +import ptBR from './pt-BR'; + +export default { + en: en, + 'pt-BR': ptBR, +}; diff --git a/packages/node_modules/@webex/widget-meet/src/translations/pt-BR.js b/packages/node_modules/@webex/widget-meet/src/translations/pt-BR.js new file mode 100644 index 000000000..a5be4451f --- /dev/null +++ b/packages/node_modules/@webex/widget-meet/src/translations/pt-BR.js @@ -0,0 +1,18 @@ +export default { + 'ciscospark.container.meet.button.answer': 'Atender', + 'ciscospark.container.meet.button.aria.call': 'Iniciar Reunião', + 'ciscospark.container.meet.button.call': 'Ligar', + 'ciscospark.container.meet.button.decline': 'Recusar', + 'ciscospark.container.meet.button.hangup': 'Desligar', + 'ciscospark.container.meet.button.ok': 'Ok', + 'ciscospark.container.meet.message.deviceNotFound': 'Webex não consegue encontrar sua câmera. Por favor verifique as configurações do seu navegador, se sua câmera está acessível e tente novamente.', + 'ciscospark.container.meet.message.errorNotAllowed': 'Webex não consegue acessar sua câmera. Por favor verifique as configurações do seu navegador e tente novamente.', + 'ciscospark.container.meet.message.errorSecurity': 'Ligação por vídeo é suportado apenas em sites seguros (HTTPS).', + 'ciscospark.container.meet.message.errorUnknown': 'Webex não consegue conectar a ligação. Por favor tente novamente.', + 'ciscospark.container.meet.message.errorBadToPropTitle': 'Detalhes incompletos ou inválidos', + 'ciscospark.container.meet.message.errorBadToPropMessage': 'Por favor forneça um endereço de email, ID de usuário, uri SIP, ID de sala, ou objeto de ligação válido', + 'ciscospark.container.meet.message.callPerson': 'Ligar', + 'ciscospark.container.meet.message.incomingCall': 'Ligação entrante', + 'ciscospark.container.meet.message.noWebRTCBrowserSupport': 'Ligação por vídeo não é suportado neste navegador.', + 'ciscospark.container.meet.message.useSupportedBrowser': 'Para uma melhor experiência, utilize a última versão do Chrome ou Firefox.', +}; diff --git a/packages/node_modules/@webex/widget-message/src/index.js b/packages/node_modules/@webex/widget-message/src/index.js index 80ca633aa..9362807b8 100644 --- a/packages/node_modules/@webex/widget-message/src/index.js +++ b/packages/node_modules/@webex/widget-message/src/index.js @@ -4,7 +4,7 @@ import {constructWebexEnhancer, withIntl} from '@webex/webex-widget-base'; import {reducers} from './reducer'; import ConnectedMessage from './container'; -import messages from './translations/en'; +import messages from './translations'; export {reducers}; @@ -19,5 +19,5 @@ export default compose( name: 'message', reducers }), - withIntl({locale: 'en', messages}) + withIntl({locale: 'pt-BR', messages: messages['pt-BR']}) )(ConnectedMessage); diff --git a/packages/node_modules/@webex/widget-message/src/translations/en.js b/packages/node_modules/@webex/widget-message/src/translations/en.js index 79b9a9ae0..1027aac8b 100644 --- a/packages/node_modules/@webex/widget-message/src/translations/en.js +++ b/packages/node_modules/@webex/widget-message/src/translations/en.js @@ -1,6 +1,7 @@ export default { 'ciscospark.container.message.deleteAlert.body': 'Are you sure you want to delete this message?', 'ciscospark.container.message.deleteAlert.title': 'Delete', + 'ciscospark.container.message.deleteAlert.confirmButton': 'Delete', 'ciscospark.container.message.deleteAlert.cancelButton': 'Cancel', 'ciscospark.container.message.messageComposer.placeholder': 'Send a message to {displayName}', 'ciscospark.systemMessage.conversation.youCreate': 'You created this conversation.', diff --git a/packages/node_modules/@webex/widget-message/src/translations/index.js b/packages/node_modules/@webex/widget-message/src/translations/index.js new file mode 100644 index 000000000..2f0e85ada --- /dev/null +++ b/packages/node_modules/@webex/widget-message/src/translations/index.js @@ -0,0 +1,7 @@ +import en from './en'; +import ptBR from './pt-BR'; + +export default { + en: en, + 'pt-BR': ptBR, +}; diff --git a/packages/node_modules/@webex/widget-message/src/translations/pt-BR.js b/packages/node_modules/@webex/widget-message/src/translations/pt-BR.js new file mode 100644 index 000000000..fb054d789 --- /dev/null +++ b/packages/node_modules/@webex/widget-message/src/translations/pt-BR.js @@ -0,0 +1,41 @@ +export default { + 'ciscospark.container.message.deleteAlert.body': 'Certeza que deseja excluir esta mensagem?', + 'ciscospark.container.message.deleteAlert.title': 'Excluir', + 'ciscospark.container.message.deleteAlert.confirmButton': 'Excluir', + 'ciscospark.container.message.deleteAlert.cancelButton': 'Cancelar', + 'ciscospark.container.message.messageComposer.placeholder': 'Envie uma mensagem para {displayName}', + 'ciscospark.datetime.today': 'Hoje', + 'ciscospark.datetime.yesterday': 'Ontem', + 'ciscospark.container.message.scrollToBottom': 'Clique para ir até a última mensagem', + 'ciscospark.container.message.newMessages.message': 'NOVAS MENSAGENS', + 'ciscospark.container.message.dropzone.coverMessage': 'Arraste e solte seus arquivos aqui', + 'ciscospark.container.message.sharedCards': '{cardsLength, plural, =1 {Responded with a card} other {Responded with # cards}}', + 'ciscospark.container.message.sharedPhotos': '{imagesLength, plural, =1 {Shared a photo} other {Shared # photos}}', + 'ciscospark.container.message.sending': 'Enviando...', + 'ciscospark.container.message.sent': 'Enviado', + 'ciscospark.container.message.unableToSendYourRequest': 'Não foi possível enviar sua solicitação', + + // System Messages (react-component-activity-system-message) + 'ciscospark.systemMessage.conversation.youCreate': 'Você criou este grupo.', + 'ciscospark.systemMessage.conversation.someoneCreate': '{name} criou este grupo.', + 'ciscospark.systemMessage.message.youDelete': 'Você deletou sua mensagem.', + 'ciscospark.systemMessage.message.someoneDelete': '{name} deletou a mensagem dele(a).', + 'ciscospark.systemMessage.message.youAdded': 'Você adicionou {name} neste grupo.', + 'ciscospark.systemMessage.message.someoneAdded': '{name} foi adicionado neste grupo.', + 'ciscospark.systemMessage.message.youRemoved': 'Você removeu {name} deste grupo.', + 'ciscospark.systemMessage.message.someoneRemoved': '{name} foi removido deste grupo.', + + // Call Data Activity (react-component-call-data-activity) + 'ciscospark.callDataActivity.message.someoneWasUnavailable': '{name} está indisponível.', + 'ciscospark.callDataActivity.message.youCancelledACall': 'Você cancelou a ligação.', + 'ciscospark.callDataActivity.message.someoneCancelledACall': '{name} cancelou a ligação.', + 'ciscospark.callDataActivity.message.youHadACall': 'Você teve uma ligação ({duration}).', + 'ciscospark.callDataActivity.message.youMissedACall': 'Você perdeu uma ligação.', + 'ciscospark.callDataActivity.message.youHadAMeeting': 'Você teve uma reunião ({duration}).', + 'ciscospark.callDataActivity.message.nobodyJoinedYourMeeting': 'Você iniciou uma reunião mas ninguém estava disponível.', + 'ciscospark.callDataActivity.message.nobodyJoinedTheMeeting': '{name} cancelou uma reunião.', + 'ciscospark.callDataActivity.message.youMissedAMeeting': 'Você perdeu uma reunião ({duration}).', + + // Item Base Activity (react-component-activity-item-base) + 'ciscospark.itemBaseActivity.message.you': 'Você', +}; diff --git a/packages/node_modules/@webex/widget-roster/src/components/add-participant/index.js b/packages/node_modules/@webex/widget-roster/src/components/add-participant/index.js index fd3f593ba..6e46d6dbd 100644 --- a/packages/node_modules/@webex/widget-roster/src/components/add-participant/index.js +++ b/packages/node_modules/@webex/widget-roster/src/components/add-participant/index.js @@ -5,6 +5,8 @@ import classNames from 'classnames'; import PeopleList from '@webex/react-component-people-list'; import {Button, Icon, Input, Spinner} from '@momentum-ui/react'; +import { FormattedMessage } from 'react-intl'; +import messages from '../../messages'; import styles from './styles.css'; @@ -92,7 +94,7 @@ function AddParticipant({ tabIndex="0" >
-
{`Invite ${searchTerm}`}
+ ); } diff --git a/packages/node_modules/@webex/widget-roster/src/container.js b/packages/node_modules/@webex/widget-roster/src/container.js index 0277a984a..c5ec71637 100644 --- a/packages/node_modules/@webex/widget-roster/src/container.js +++ b/packages/node_modules/@webex/widget-roster/src/container.js @@ -218,7 +218,7 @@ export class RosterWidget extends Component { activityTypes={activityTypes} onClose={this.props.onClickClose && this.handleCloseClick} onMenuClick={this.props.onClickMenu && this.handleMenuClick} - title={`People (${participants.count ? participants.count : null})`} + title={this.props.intl.formatMessage(messages.title, { total: this.props.participants.count ?? 0 })} />
{mainArea} diff --git a/packages/node_modules/@webex/widget-roster/src/index.js b/packages/node_modules/@webex/widget-roster/src/index.js index dc85b3a2f..9e0f8f171 100644 --- a/packages/node_modules/@webex/widget-roster/src/index.js +++ b/packages/node_modules/@webex/widget-roster/src/index.js @@ -3,7 +3,7 @@ import {constructWebexEnhancer, withIntl} from '@webex/webex-widget-base'; import {reducers} from './reducer'; import ConnectedRoster from './container'; -import messages from './translations/en'; +import messages from './translations'; export {reducers}; @@ -12,5 +12,5 @@ export default compose( name: 'roster', reducers }), - withIntl({locale: 'en', messages}) + withIntl({locale: 'pt-BR', messages: messages['pt-BR']}) )(ConnectedRoster); diff --git a/packages/node_modules/@webex/widget-roster/src/messages.js b/packages/node_modules/@webex/widget-roster/src/messages.js index f1488590f..1c96e63fe 100644 --- a/packages/node_modules/@webex/widget-roster/src/messages.js +++ b/packages/node_modules/@webex/widget-roster/src/messages.js @@ -6,6 +6,10 @@ import {defineMessages} from 'react-intl'; export default defineMessages({ + title: { + id: 'ciscospark.container.roster.message.title', + defaultMessage: 'People ({total})' + }, addPeople: { id: 'ciscospark.container.roster.message.addPeople', defaultMessage: 'Add people' @@ -26,6 +30,10 @@ export default defineMessages({ id: 'ciscospark.container.roster.message.addPeople.noResults', defaultMessage: 'No Results' }, + inviteParticipantMessage: { + id: 'ciscospark.container.roster.message.addPeople.inviteParticipantMessage', + defaultMessage: 'Invite {value}' + }, externalParticipants: { id: 'ciscospark.container.roster.message.externalParticipants', defaultMessage: 'People outside your company are included in this space' diff --git a/packages/node_modules/@webex/widget-roster/src/translations/index.js b/packages/node_modules/@webex/widget-roster/src/translations/index.js new file mode 100644 index 000000000..2f0e85ada --- /dev/null +++ b/packages/node_modules/@webex/widget-roster/src/translations/index.js @@ -0,0 +1,7 @@ +import en from './en'; +import ptBR from './pt-BR'; + +export default { + en: en, + 'pt-BR': ptBR, +}; diff --git a/packages/node_modules/@webex/widget-roster/src/translations/pt-BR.js b/packages/node_modules/@webex/widget-roster/src/translations/pt-BR.js new file mode 100644 index 000000000..bba83aa33 --- /dev/null +++ b/packages/node_modules/@webex/widget-roster/src/translations/pt-BR.js @@ -0,0 +1,15 @@ +export default { + 'ciscospark.container.roster.message.title': 'Participantes ({total})', + 'ciscospark.container.roster.message.addPeople': 'Adicionar pessoas', + 'ciscospark.container.roster.message.addPeople.placeholder': 'Quem é que você está procurando?', + 'ciscospark.container.roster.message.cancelDetails': 'Cancelar', + 'ciscospark.container.roster.message.removeParticipant': 'Remover', + 'ciscospark.container.roster.message.addPeople.noResults': 'Sem Resultados', + 'ciscospark.container.roster.message.addPeople.inviteParticipantMessage': 'Convidar {value}', + 'ciscospark.container.roster.message.externalParticipants': 'Pessoas de fora da sua empresa estão incluídas neste espaço', + 'ciscospark.container.roster.title.moderators': 'Moderadores', + 'ciscospark.container.roster.title.participants': 'Participantes', + 'ciscospark.container.roster.title.inMeeting': 'Em Reunião', + 'ciscospark.container.roster.title.notInMeeting': 'Não está em Reunião', + 'ciscospark.container.roster.peopleList.removeFromSpace': 'Remover do grupo' +}; diff --git a/packages/node_modules/@webex/widget-space/src/enhancers/activity-menu.js b/packages/node_modules/@webex/widget-space/src/enhancers/activity-menu.js index 9023c6790..f7e885acd 100644 --- a/packages/node_modules/@webex/widget-space/src/enhancers/activity-menu.js +++ b/packages/node_modules/@webex/widget-space/src/enhancers/activity-menu.js @@ -26,6 +26,7 @@ import { updateSecondaryActivityType } from '../actions'; import {eventNames} from '../events'; +import messages from '../messages'; import styles from '../styles.css'; export const ACTIVITY_TYPE_PRIMARY = 'ACTIVITY_TYPE_PRIMARY'; @@ -179,11 +180,12 @@ export default compose( const { props } = this; + const { formatMessage } = props.intl; // Store activity types used in widget const DEFAULT_ACTIVITY_TYPES = [ { - displayName: 'Messages', + displayName: formatMessage(messages.tabsMessage), name: 'message', buttonClassName: styles.messageButton, buttonType: 'chat', @@ -192,7 +194,7 @@ export default compose( type: ACTIVITY_TYPE_PRIMARY }, { - displayName: 'Content', + displayName: formatMessage(messages.tabsFiles), name: 'files', buttonClassName: styles.filesButton, buttonType: 'files', @@ -205,7 +207,7 @@ export default compose( } }, { - displayName: 'People', + displayName: formatMessage(messages.tabsPeople), name: 'people', buttonClassName: styles.peopleButton, buttonType: {color: 'mint', icon: }, @@ -218,7 +220,7 @@ export default compose( } }, { - displayName: 'Call', + displayName: formatMessage(messages.tabsMeet), name: 'meet', buttonClassName: styles.meetButton, buttonType: 'camera', diff --git a/packages/node_modules/@webex/widget-space/src/index.js b/packages/node_modules/@webex/widget-space/src/index.js index 8667a41e3..7c6a326c4 100644 --- a/packages/node_modules/@webex/widget-space/src/index.js +++ b/packages/node_modules/@webex/widget-space/src/index.js @@ -4,7 +4,7 @@ import {enhancer as mercuryEnhancer} from '@webex/redux-module-mercury'; import reducers from './reducer'; import ConnectedSpace from './container'; -import messages from './translations/en'; +import messages from './translations'; import events from './events'; import {destinationTypes} from './constants'; @@ -22,5 +22,5 @@ export default compose( reducers }), mercuryEnhancer, - withIntl({locale: 'en', messages}) + withIntl({locale: 'pt-BR', messages: messages['pt-BR']}) )(ConnectedSpace); diff --git a/packages/node_modules/@webex/widget-space/src/messages.js b/packages/node_modules/@webex/widget-space/src/messages.js index b649cf6c5..17a1f0495 100644 --- a/packages/node_modules/@webex/widget-space/src/messages.js +++ b/packages/node_modules/@webex/widget-space/src/messages.js @@ -57,5 +57,21 @@ export default defineMessages({ errorConversation: { id: 'ciscospark.container.space.error.noConversation', defaultMessage: 'Conversation Not Available' + }, + tabsMessage: { + id: 'ciscospark.container.space.tabs.message', + defaultMessage: 'Messages' + }, + tabsFiles: { + id: 'ciscospark.container.space.tabs.files', + defaultMessage: 'Content' + }, + tabsPeople: { + id: 'ciscospark.container.space.tabs.people', + defaultMessage: 'People' + }, + tabsMeet: { + id: 'ciscospark.container.space.tabs.meet', + defaultMessage: 'Call' } }); diff --git a/packages/node_modules/@webex/widget-space/src/translations/index.js b/packages/node_modules/@webex/widget-space/src/translations/index.js new file mode 100644 index 000000000..2f0e85ada --- /dev/null +++ b/packages/node_modules/@webex/widget-space/src/translations/index.js @@ -0,0 +1,7 @@ +import en from './en'; +import ptBR from './pt-BR'; + +export default { + en: en, + 'pt-BR': ptBR, +}; diff --git a/packages/node_modules/@webex/widget-space/src/translations/pt-BR.js b/packages/node_modules/@webex/widget-space/src/translations/pt-BR.js new file mode 100644 index 000000000..c526dae0f --- /dev/null +++ b/packages/node_modules/@webex/widget-space/src/translations/pt-BR.js @@ -0,0 +1,19 @@ +export default { + 'ciscospark.container.space.error.connection': 'Conexão indisponível.', + 'ciscospark.container.space.error.notfound': 'A sala não existe ou você não tem permissão para ver esta sala', + 'ciscospark.container.space.error.badtoken': 'Erro: Token de Acesso Inválido', + 'ciscospark.container.space.error.toself': 'Erro: Você não Pode Criar uma Sala com Você Mesmo', + 'ciscospark.container.space.error.badid': 'Erro: ID da sala é Inválido', + 'ciscospark.container.space.error.invalidActivity': 'Erro: O menu inicial selecionado é inválido', + 'ciscospark.container.space.error.invalidSendMessageConfiguration': 'Erro: A configuração atual não permite o envio de mensagens', + 'ciscospark.container.space.error.unabletoload': 'Não foi Possível Carregar a Sala', + 'ciscospark.container.space.error.unknownDestination': 'Por favor forneça o ID de uma Sala ou de um Contato', + 'ciscospark.container.space.error.invalidDestination': 'IDs de salas precisam estar completamente codificados', + 'ciscospark.container.space.error.unknown': 'Houve um problema ao carregar a sala', + 'ciscospark.container.space.error.reconnecting': 'Reconectando...', + 'ciscospark.container.space.error.noConversation': 'Conversa Não Disponível', + 'ciscospark.container.space.tabs.message': 'Mensagens', + 'ciscospark.container.space.tabs.files': 'Conteúdo', + 'ciscospark.container.space.tabs.people': 'Participantes', + 'ciscospark.container.space.tabs.meet': 'Chamada', +}; From d9ec83d828256b35b92c1fdbc52b5372091384b4 Mon Sep 17 00:00:00 2001 From: Leandro Schwab Dias Carneiro Date: Tue, 17 Jan 2023 20:43:43 -0300 Subject: [PATCH 2/2] Setting default to english Default language in english Added readme with instruction to translations --- README.md | 22 +++++++++++++++++++ .../@webex/widget-files/src/index.js | 4 +++- .../@webex/widget-meet/src/index.js | 3 ++- .../@webex/widget-message/src/index.js | 3 ++- .../@webex/widget-roster/src/index.js | 3 ++- .../@webex/widget-space/src/index.js | 3 ++- 6 files changed, 33 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d8f1ae4e2..c40c7de9b 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,28 @@ $ npm start ``` 1. The widget demo will be running on http://localhost:8000 +## localization +This widget provides localization in portuguese. To run in portuguese change this lines: + +```js + withIntl({locale: 'en', messages: messages['en']}) +``` + + to this + +```js + withIntl({locale: 'pt-BR', messages: messages['pt-BR']}) +``` + +In these files: + +`packages\node_modules\@webex\widget-files\src\index.js` +`packages\node_modules\@webex\widget-meet\src\index.js` +`packages\node_modules\@webex\widget-message\src\index.js` +`packages\node_modules\@webex\widget-roster\src\index.js` +`packages\node_modules\@webex\widget-space\src\index.js` + + ## Version When a widget is bundled and loaded via script tag, the version number is available in the following ways: diff --git a/packages/node_modules/@webex/widget-files/src/index.js b/packages/node_modules/@webex/widget-files/src/index.js index 6702ec74c..1fa4ecbdb 100644 --- a/packages/node_modules/@webex/widget-files/src/index.js +++ b/packages/node_modules/@webex/widget-files/src/index.js @@ -11,5 +11,7 @@ export default compose( name: 'files', reducers }), - withIntl({locale: 'pt-BR', messages: messages['pt-BR']}) + //withIntl({locale: 'pt-BR', messages: messages['pt-BR']}) + withIntl({locale: 'en', messages: messages['en']}) + )(ConnectedFiles); diff --git a/packages/node_modules/@webex/widget-meet/src/index.js b/packages/node_modules/@webex/widget-meet/src/index.js index 6bb0b6135..0892b052f 100644 --- a/packages/node_modules/@webex/widget-meet/src/index.js +++ b/packages/node_modules/@webex/widget-meet/src/index.js @@ -23,7 +23,8 @@ export default compose( name: 'meet', reducers }), - withIntl({locale: 'pt-BR', messages: messages['pt-BR']}), + //withIntl({locale: 'pt-BR', messages: messages['pt-BR']}) + withIntl({locale: 'en', messages: messages['en']}), mediaEnhancer, mercuryEnhancer )(ConnectedMeet); diff --git a/packages/node_modules/@webex/widget-message/src/index.js b/packages/node_modules/@webex/widget-message/src/index.js index 9362807b8..a894cbd03 100644 --- a/packages/node_modules/@webex/widget-message/src/index.js +++ b/packages/node_modules/@webex/widget-message/src/index.js @@ -19,5 +19,6 @@ export default compose( name: 'message', reducers }), - withIntl({locale: 'pt-BR', messages: messages['pt-BR']}) + //withIntl({locale: 'pt-BR', messages: messages['pt-BR']}) + withIntl({locale: 'en', messages: messages['en']}) )(ConnectedMessage); diff --git a/packages/node_modules/@webex/widget-roster/src/index.js b/packages/node_modules/@webex/widget-roster/src/index.js index 9e0f8f171..8709d3be6 100644 --- a/packages/node_modules/@webex/widget-roster/src/index.js +++ b/packages/node_modules/@webex/widget-roster/src/index.js @@ -12,5 +12,6 @@ export default compose( name: 'roster', reducers }), - withIntl({locale: 'pt-BR', messages: messages['pt-BR']}) + //withIntl({locale: 'pt-BR', messages: messages['pt-BR']}) + withIntl({locale: 'en', messages: messages['en']}) )(ConnectedRoster); diff --git a/packages/node_modules/@webex/widget-space/src/index.js b/packages/node_modules/@webex/widget-space/src/index.js index 7c6a326c4..14d02a5e8 100644 --- a/packages/node_modules/@webex/widget-space/src/index.js +++ b/packages/node_modules/@webex/widget-space/src/index.js @@ -22,5 +22,6 @@ export default compose( reducers }), mercuryEnhancer, - withIntl({locale: 'pt-BR', messages: messages['pt-BR']}) + //withIntl({locale: 'pt-BR', messages: messages['pt-BR']}) + withIntl({locale: 'en', messages: messages['en']}) )(ConnectedSpace);