From 4afba2f7964ffcceafce93d1aaf35ab8796a5476 Mon Sep 17 00:00:00 2001 From: "saul.kredi@krutt.org" Date: Mon, 29 May 2017 18:44:39 +0300 Subject: [PATCH 1/5] Add support for RTL languages --- src/HtmlUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HtmlUtils.js b/src/HtmlUtils.js index 4acb314c2f..8af1894c79 100644 --- a/src/HtmlUtils.js +++ b/src/HtmlUtils.js @@ -360,7 +360,7 @@ export function bodyToHtml(content, highlights, opts) { 'mx_EventTile_bigEmoji': emojiBody, 'markdown-body': isHtml, }); - return ; + return ; } export function emojifyText(text) { From 12f923bc81c8ae95d790b65b665bc232f35661b2 Mon Sep 17 00:00:00 2001 From: daniel tygel Date: Tue, 30 May 2017 18:56:52 -0300 Subject: [PATCH 2/5] add new string to translate --- src/components/views/rooms/TopUnreadMessagesBar.js | 2 +- src/i18n/strings/en_EN.json | 1 + src/i18n/strings/pt_BR.json | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/views/rooms/TopUnreadMessagesBar.js b/src/components/views/rooms/TopUnreadMessagesBar.js index 6cb6475a8f..45aba66633 100644 --- a/src/components/views/rooms/TopUnreadMessagesBar.js +++ b/src/components/views/rooms/TopUnreadMessagesBar.js @@ -37,7 +37,7 @@ module.exports = React.createClass({ { - Jump to first unread message. + { _t("Jump to first unread message.") } Date: Tue, 30 May 2017 19:01:23 -0300 Subject: [PATCH 3/5] add string to translate --- src/components/views/rooms/EventTile.js | 2 +- src/i18n/strings/en_EN.json | 1 + src/i18n/strings/pt_BR.json | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index 6db42a4b9d..d9a6925793 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -481,7 +481,7 @@ module.exports = WithMatrixClient(React.createClass({ } const editButton = ( - + ); let e2e; // cosmetic padlocks: diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 73774c52c6..ce2a630bc0 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -677,6 +677,7 @@ "%(oneUser)schanged their avatar": "%(oneUser)schanged their avatar", "Analytics": "Analytics", "Opt out of analytics": "Opt out of analytics", + "Options": "Options", "Riot collects anonymous analytics to allow us to improve the application.": "Riot collects anonymous analytics to allow us to improve the application.", "Please select the destination room for this message": "Please select the destination room for this message", "Passphrases must match": "Passphrases must match", diff --git a/src/i18n/strings/pt_BR.json b/src/i18n/strings/pt_BR.json index 49ef774dac..9a79219a48 100644 --- a/src/i18n/strings/pt_BR.json +++ b/src/i18n/strings/pt_BR.json @@ -729,6 +729,7 @@ "%(senderDisplayName)s removed the room name.": "%(senderDisplayName)s apagou o nome da sala.", "Analytics": "Análise", "Opt out of analytics": "Sair da ferramenta de análise", + "Options": "Opções", "Riot collects anonymous analytics to allow us to improve the application.": "Riot coleta informações anônimas de uso para nos permitir melhorar o sistema.", "Passphrases must match": "As senhas têm que ser iguais", "Passphrase must not be empty": "A senha não pode estar vazia", From 75d2b2319d387eb348563a3e42752c93f395ccd0 Mon Sep 17 00:00:00 2001 From: daniel tygel Date: Wed, 31 May 2017 09:10:19 -0300 Subject: [PATCH 4/5] translate directly in pt_BR.json --- src/i18n/strings/pt_BR.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/strings/pt_BR.json b/src/i18n/strings/pt_BR.json index 220bd7ade5..331fda1947 100644 --- a/src/i18n/strings/pt_BR.json +++ b/src/i18n/strings/pt_BR.json @@ -605,7 +605,7 @@ "'%(alias)s' is not a valid format for an address": "'%(alias)s' não é um formato válido para um endereço", "'%(alias)s' is not a valid format for an alias": "'%(alias)s' não é um formato válido para um alias", "Join Room": "Ingressar na sala", - "Jump to first unread message.": "Jump to first unread message.", + "Jump to first unread message.": "Ir diretamente para a primeira das mensagens não lidas.", "Kick": "Remover", "Level": "Nível", "Local addresses for this room:": "Endereço local desta sala:", From 2d73f094ff71413698771e9eb0707083f258801f Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 31 May 2017 15:09:09 +0100 Subject: [PATCH 5/5] Delint MatrixChat, again (#979) grrr. --- src/components/structures/MatrixChat.js | 60 ++++++++++++------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 1da4b9d988..64b5354eda 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -396,7 +396,7 @@ module.exports = React.createClass({ }, (err) => { modal.close(); Modal.createDialog(ErrorDialog, { - title: _t('Failed to reject invitation'), + title: _t('Failed to reject invitation'), description: err.toString(), }); }); @@ -445,8 +445,8 @@ module.exports = React.createClass({ title: _t('Create Room'), description: _t('Room name (optional)'), button: _t('Create Room'), - onFinished: (should_create, name) => { - if (should_create) { + onFinished: (shouldCreate, name) => { + if (shouldCreate) { const createOpts = {}; if (name) createOpts.name = name; createRoom({createOpts}).done(); @@ -579,44 +579,44 @@ module.exports = React.createClass({ // switch view to the given room // - // @param {Object} room_info Object containing data about the room to be joined - // @param {string=} room_info.room_id ID of the room to join. One of room_id or room_alias must be given. - // @param {string=} room_info.room_alias Alias of the room to join. One of room_id or room_alias must be given. - // @param {boolean=} room_info.auto_join If true, automatically attempt to join the room if not already a member. - // @param {boolean=} room_info.show_settings Makes RoomView show the room settings dialog. - // @param {string=} room_info.event_id ID of the event in this room to show: this will cause a switch to the + // @param {Object} roomInfo Object containing data about the room to be joined + // @param {string=} roomInfo.room_id ID of the room to join. One of room_id or room_alias must be given. + // @param {string=} roomInfo.room_alias Alias of the room to join. One of room_id or room_alias must be given. + // @param {boolean=} roomInfo.auto_join If true, automatically attempt to join the room if not already a member. + // @param {boolean=} roomInfo.show_settings Makes RoomView show the room settings dialog. + // @param {string=} roomInfo.event_id ID of the event in this room to show: this will cause a switch to the // context of that particular event. - // @param {Object=} room_info.third_party_invite Object containing data about the third party + // @param {Object=} roomInfo.third_party_invite Object containing data about the third party // we received to join the room, if any. - // @param {string=} room_info.third_party_invite.inviteSignUrl 3pid invite sign URL - // @param {string=} room_info.third_party_invite.invitedEmail The email address the invite was sent to - // @param {Object=} room_info.oob_data Object of additional data about the room + // @param {string=} roomInfo.third_party_invite.inviteSignUrl 3pid invite sign URL + // @param {string=} roomInfo.third_party_invite.invitedEmail The email address the invite was sent to + // @param {Object=} roomInfo.oob_data Object of additional data about the room // that has been passed out-of-band (eg. // room name and avatar from an invite email) - _viewRoom: function(room_info) { + _viewRoom: function(roomInfo) { this.focusComposer = true; const newState = { - initialEventId: room_info.event_id, - highlightedEventId: room_info.event_id, + initialEventId: roomInfo.event_id, + highlightedEventId: roomInfo.event_id, initialEventPixelOffset: undefined, page_type: PageTypes.RoomView, - thirdPartyInvite: room_info.third_party_invite, - roomOobData: room_info.oob_data, - currentRoomAlias: room_info.room_alias, - autoJoin: room_info.auto_join, + thirdPartyInvite: roomInfo.third_party_invite, + roomOobData: roomInfo.oob_data, + currentRoomAlias: roomInfo.room_alias, + autoJoin: roomInfo.auto_join, }; - if (!room_info.room_alias) { - newState.currentRoomId = room_info.room_id; + if (!roomInfo.room_alias) { + newState.currentRoomId = roomInfo.room_id; } // if we aren't given an explicit event id, look for one in the // scrollStateMap. // // TODO: do this in RoomView rather than here - if (!room_info.event_id && this.refs.loggedInView) { - const scrollState = this.refs.loggedInView.getScrollStateForRoom(room_info.room_id); + if (!roomInfo.event_id && this.refs.loggedInView) { + const scrollState = this.refs.loggedInView.getScrollStateForRoom(roomInfo.room_id); if (scrollState) { newState.initialEventId = scrollState.focussedEvent; newState.initialEventPixelOffset = scrollState.pixelOffset; @@ -628,15 +628,15 @@ module.exports = React.createClass({ let waitFor = q(null); if (!this.firstSyncComplete) { if (!this.firstSyncPromise) { - console.warn('Cannot view a room before first sync. room_id:', room_info.room_id); + console.warn('Cannot view a room before first sync. room_id:', roomInfo.room_id); return; } waitFor = this.firstSyncPromise.promise; } waitFor.done(() => { - let presentedId = room_info.room_alias || room_info.room_id; - const room = MatrixClientPeg.get().getRoom(room_info.room_id); + let presentedId = roomInfo.room_alias || roomInfo.room_id; + const room = MatrixClientPeg.get().getRoom(roomInfo.room_id); if (room) { const theAlias = Rooms.getDisplayAliasForRoom(room); if (theAlias) presentedId = theAlias; @@ -648,8 +648,8 @@ module.exports = React.createClass({ } } - if (room_info.event_id) { - presentedId += "/" + room_info.event_id; + if (roomInfo.event_id) { + presentedId += "/" + roomInfo.event_id; } this.notifyNewScreen('room/' + presentedId); newState.ready = true; @@ -663,7 +663,7 @@ module.exports = React.createClass({ title: _t('Start a chat'), description: _t("Who would you like to communicate with?"), placeholder: _t("Email, name or matrix ID"), - button: _t("Start Chat") + button: _t("Start Chat"), }); },