diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index d094b4eddf2..7117be0f782 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -184,9 +184,9 @@ module.exports = React.createClass({ var desc; if (alias) { - desc = counterpart.translate("Delete the room alias") + " " + alias + " " + counterpart.translate("and remove") + " " + name + " " + counterpart.translate("from the directory") + "?"; + desc = counterpart.translate("Delete the room alias %(alias)s and remove %(name)s from the directory?", {alias: alias, name: name}); } else { - desc = counterpart.translate("Remove") + " " + name + " " + counterpart.translate("from the directory") + "?"; + desc = counterpart.translate("Remove %(name)s from the directory?", {name: name}); } Modal.createDialog(QuestionDialog, { @@ -197,7 +197,7 @@ module.exports = React.createClass({ var Loader = sdk.getComponent("elements.Spinner"); var modal = Modal.createDialog(Loader); - var step = counterpart.translate("remove") + " " + name + " " + counterpart.translate("from the directory") + "."; + var step = counterpart.translate("remove %(name)s from the directory", {name: name}) + "."; MatrixClientPeg.get().setRoomDirectoryVisibility(room.room_id, 'private').then(() => { if (!alias) return; diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index c6928622b6c..2ba15e51bf6 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -457,8 +457,8 @@ var RoomSubList = React.createClass({ var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); console.error("Failed to add tag " + self.props.tagName + " to room" + err); Modal.createDialog(ErrorDialog, { - title: "Failed to add tag " + self.props.tagName + " to room", - description: ((err && err.message) ? err.message : "Operation failed"), + title: counterpart.translate("Failed to add tag %(tagName)s to room", {tagName: self.props.tagName}), + description: ((err && err.message) ? err.message : counterpart.translate("Operation failed")), }); }); break; diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index db416b8a06d..5d38c7f5606 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -21,6 +21,7 @@ var React = require('react'); var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg'); var dis = require('matrix-react-sdk/lib/dispatcher'); var sdk = require('matrix-react-sdk'); +import counterpart from 'counterpart'; var Modal = require('matrix-react-sdk/lib/Modal'); var Resend = require("matrix-react-sdk/lib/Resend"); import * as UserSettingsStore from 'matrix-react-sdk/lib/UserSettingsStore'; @@ -74,8 +75,8 @@ module.exports = React.createClass({ // display error message stating you couldn't delete this. var code = e.errcode || e.statusCode; Modal.createDialog(ErrorDialog, { - title: "Error", - description: "You cannot delete this message. (" + code + ")" + title: counterpart.translate("Error"), + description: counterpart.translate("You cannot delete this message. (%(code)s)", {code: code}) }); }).done(); }, @@ -121,7 +122,7 @@ module.exports = React.createClass({ if (eventStatus === 'not_sent') { resendButton = (
- Resend + { counterpart.translate("Resend") }
); } @@ -129,7 +130,7 @@ module.exports = React.createClass({ if (!eventStatus && !this.props.mxEvent.isRedacted()) { // sent and not redacted redactButton = (
- Redact + { counterpart.translate("Redact") }
); } @@ -137,21 +138,21 @@ module.exports = React.createClass({ if (eventStatus === "queued" || eventStatus === "not_sent") { cancelButton = (
- Cancel Sending + { counterpart.translate("Cancel Sending") }
); } viewSourceButton = (
- View Source + { counterpart.translate("View Source") }
); if (this.props.mxEvent.getType() !== this.props.mxEvent.getWireType()) { viewClearSourceButton = (
- View Decrypted Source + { counterpart.translate("View Decrypted Source") }
); } @@ -160,7 +161,7 @@ module.exports = React.createClass({ if (this.props.eventTileOps.isWidgetHidden()) { unhidePreviewButton = (
- Unhide Preview + { counterpart.translate("Unhide Preview") }
) } @@ -170,13 +171,13 @@ module.exports = React.createClass({ permalinkButton = (
Permalink + target="_blank" rel="noopener" onClick={ this.closeMenu }>{ counterpart.translate("Permalink") }
); const quoteButton = (
- Quote + { counterpart.translate("Quote") }
); @@ -185,7 +186,7 @@ module.exports = React.createClass({ externalURLButton = (
Source URL + rel="noopener" target="_blank" onClick={ this.closeMenu }>{ counterpart.translate("Source URL") }
); } diff --git a/src/components/views/context_menus/RoomTileContextMenu.js b/src/components/views/context_menus/RoomTileContextMenu.js index 675d64c1ace..5f760ca58e9 100644 --- a/src/components/views/context_menus/RoomTileContextMenu.js +++ b/src/components/views/context_menus/RoomTileContextMenu.js @@ -71,8 +71,8 @@ module.exports = React.createClass({ }).fail(function(err) { var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createDialog(ErrorDialog, { - title: "Failed to remove tag " + tagNameOff + " from room", - description: ((err && err.message) ? err.message : "Operation failed"), + title: counterpart.translate("Failed to remove tag %(tagName)s from room", {tagName: tagNameOff}), + description: ((err && err.message) ? err.message : counterpart.translate("Operation failed")), }); }); } @@ -88,8 +88,8 @@ module.exports = React.createClass({ }).fail(function(err) { var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createDialog(ErrorDialog, { - title: "Failed to add tag " + tagNameOn + " to room", - description: ((err && err.message) ? err.message : "Operation failed"), + title: counterpart.translate("Failed to remove tag %(tagName)s from room", {tagName: tagNameOn}), + description: ((err && err.message) ? err.message : counterpart.translate("Operation failed")), }); }); } @@ -149,8 +149,8 @@ module.exports = React.createClass({ }, (err) => { var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createDialog(ErrorDialog, { - title: "Failed to set Direct Message status of room", - description: ((err && err.message) ? err.message : "Operation failed"), + title: counterpart.translate("Failed to set Direct Message status of room"), + description: ((err && err.message) ? err.message : counterpart.translate("Operation failed")), }); }); }, @@ -188,8 +188,8 @@ module.exports = React.createClass({ var errCode = err.errcode || "unknown error code"; var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createDialog(ErrorDialog, { - title: `Failed to forget room (${errCode})`, - description: ((err && err.message) ? err.message : "Operation failed"), + title: counterpart.translate("Failed to forget room %(errCode)s", {errCode: errCode}), + description: ((err && err.message) ? err.message : counterpart.translate("Operation failed")), }); }); @@ -275,22 +275,22 @@ module.exports = React.createClass({
- All messages (loud) + { counterpart.translate("All messages (loud)") }
- All messages + { counterpart.translate("All messages") }
- Mentions only + { counterpart.translate("Mentions only") }
- Mute + { counterpart.translate("Mute") }
); @@ -307,16 +307,16 @@ module.exports = React.createClass({ switch (membership) { case "join": leaveClickHandler = this._onClickLeave; - leaveText = "Leave"; + leaveText = counterpart.translate("Leave"); break; case "leave": case "ban": leaveClickHandler = this._onClickForget; - leaveText = "Forget"; + leaveText = counterpart.translate("Forget"); break; case "invite": leaveClickHandler = this._onClickReject; - leaveText = "Reject"; + leaveText = counterpart.translate("Reject"); break; } diff --git a/src/components/views/elements/ImageView.js b/src/components/views/elements/ImageView.js index ab3e9ee8f0d..4a8479df87f 100644 --- a/src/components/views/elements/ImageView.js +++ b/src/components/views/elements/ImageView.js @@ -25,6 +25,7 @@ var filesize = require('filesize'); var AccessibleButton = require('matrix-react-sdk/lib/components/views/elements/AccessibleButton'); const Modal = require('matrix-react-sdk/lib/Modal'); const sdk = require('matrix-react-sdk'); +import counterpart from 'counterpart'; module.exports = React.createClass({ displayName: 'ImageView', @@ -76,8 +77,8 @@ module.exports = React.createClass({ // display error message stating you couldn't delete this. var code = e.errcode || e.statusCode; Modal.createDialog(ErrorDialog, { - title: "Error", - description: "You cannot delete this image. (" + code + ")" + title: counterpart.translate("Error"), + description: counterpart.translate("You cannot delete this image. (%(code)s)", {code: code}) }); }).done(); } @@ -150,14 +151,14 @@ module.exports = React.createClass({ var eventMeta; if(showEventMeta) { eventMeta = (
- Uploaded on { DateUtils.formatDate(new Date(this.props.mxEvent.getTs())) } by { this.props.mxEvent.getSender() } + { counterpart.translate("Uploaded on %(date)s by %(user)s", {date: DateUtils.formatDate(new Date(this.props.mxEvent.getTs())), user: this.props.mxEvent.getSender()}) }
); } var eventRedact; if(showEventMeta) { eventRedact = (
- Redact + { counterpart.translate("Redact") }
); } @@ -169,7 +170,7 @@ module.exports = React.createClass({
- Close + {
@@ -178,7 +179,7 @@ module.exports = React.createClass({ { eventMeta }
- Download this file
+ { counterpart.translate("Download this file") }
{ size_res }
diff --git a/src/components/views/rooms/DNDRoomTile.js b/src/components/views/rooms/DNDRoomTile.js index 4bcf29ed9ae..bbfb815f0e5 100644 --- a/src/components/views/rooms/DNDRoomTile.js +++ b/src/components/views/rooms/DNDRoomTile.js @@ -23,6 +23,7 @@ import {DropTarget} from 'react-dnd'; import dis from 'matrix-react-sdk/lib/dispatcher'; import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg'; import sdk from 'matrix-react-sdk'; +import counterpart from 'counterpart'; import RoomTile from 'matrix-react-sdk/lib/components/views/rooms/RoomTile'; import * as Rooms from 'matrix-react-sdk/lib/Rooms'; import Modal from 'matrix-react-sdk/lib/Modal'; @@ -90,8 +91,8 @@ var roomTileSource = { const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); console.error("Failed to set direct chat tag " + err); Modal.createDialog(ErrorDialog, { - title: "Failed to set direct chat tag", - description: ((err && err.message) ? err.message : "Operation failed"), + title: counterpart.translate("Failed to set direct chat tag"), + description: ((err && err.message) ? err.message : counterpart.translate("Operation failed")), }); }); return; @@ -115,8 +116,8 @@ var roomTileSource = { var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); console.error("Failed to remove tag " + prevTag + " from room: " + err); Modal.createDialog(ErrorDialog, { - title: "Failed to remove tag " + prevTag + " from room", - description: ((err && err.message) ? err.message : "Operation failed"), + title: counterpart.translate("Failed to remove tag %(tagName)s from room", {tagName: prevTag}), + description: ((err && err.message) ? err.message : counterpart.translate("Operation failed")), }); }); } @@ -137,8 +138,8 @@ var roomTileSource = { var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); console.error("Failed to add tag " + newTag + " to room: " + err); Modal.createDialog(ErrorDialog, { - title: "Failed to add tag " + newTag + " to room", - description: ((err && err.message) ? err.message : "Operation failed"), + title: counterpart.translate("Failed to add tag %(tagName)s to room", {tagName: newTag}), + description: ((err && err.message) ? err.message : counterpart.translate("Operation failed")), }); }); } diff --git a/src/i18n/en_EN.json b/src/i18n/en_EN.json index 78b200e47a4..91a84425e41 100644 --- a/src/i18n/en_EN.json +++ b/src/i18n/en_EN.json @@ -1,17 +1,21 @@ { "Add an email address above to configure email notifications": "Add an email address above to configure email notifications", + "All messages": "All messages", + "All messages (loud)": "All messages (loud)", "All notifications are currently disabled for all targets.": "All notifications are currently disabled for all targets.", "An error occurred whilst saving your email notification preferences": "An error occurred whilst saving your email notification preferences", - "and remove": "and remove", + "Cancel Sending": "Cancel Sending", "Can't update user notification settings": "Can't update user notification settings", + "Close": "Close", "Create new room": "Create new room", "Couldn't find a matching Matrix room": "Couldn't find a matching Matrix room", "Custom Server Options": "Custom Server Options", "delete the alias": "delete the alias", - "Delete the room alias": "Delete the room alias", + "Delete the room alias %(alias)s and remove %(name)s from the directory?": "Delete the room alias %(alias)s and remove %(name)s from the directory?", "Direct Chat": "Direct Chat", "Directory": "Directory", "Dismiss": "Dismiss", + "Download this file": "Download this file", "Drop here to %(verb)s": "Drop here to %(verb)s", "Enable audible notifications in web client": "Enable audible notifications in web client", "Enable desktop notifications": "Enable desktop notifications", @@ -23,20 +27,21 @@ "Error saving email notification preferences": "Error saving email notification preferences", "#example": "#example", "Failed to": "Failed to", - "Failed to add tag ": "Failed to add tag ", - "Failed to change settings": "Failed to change settings", + "Failed to add tag %(tagName)s to room": "Failed to add tag %(tagName)s to room", + "Failed to change settings": "Failed to change settings", + "Failed to forget room %(errCode)s": "Failed to forget room %(errCode)s", "Failed to update keywords": "Failed to update keywords", "Failed to get protocol list from Home Server": "Failed to get protocol list from Home Server", "Failed to get public room list": "Failed to get public room list", "Failed to join the room": "Failed to join the room", - "Failed to remove tag ": "Failed to remove tag ", + "Failed to remove tag %(prevTag)s from room": "Failed to remove tag %(prevTag)s from room", + "Failed to set direct chat tag": "Failed to set direct chat tag", "Failed to set Direct Message status of room": "Failed to set Direct Message status of room", "Favourite": "Favourite", "Fetching third party location failed": "Fetching third party location failed", "Files": "Files", "Filter room names": "Filter room names", "Forget": "Forget", - "from the directory": "from the directory", " from room": " from room", "Guests can join": "Guests can join", "Guest users can't invite users. Please register to invite": "Guest users can't invite users. Please register to invite", @@ -45,6 +50,8 @@ "Leave": "Leave", "Low Priority": "Low Priority", "Members": "Members", + "Mentions only": "Mentions only", + "Mute": "Mute", "No rooms to show": "No rooms to show", "Noisy": "Noisy", "Notification targets": "Notification targets", @@ -55,17 +62,23 @@ "Off": "Off", "On": "On", "Operation failed": "Operation failed", + "Permalink": "Permalink", "Please Register": "Please Register", "powered by Matrix": "powered by Matrix", + "Quote": "Quote", + "Redact": "Redact", "Reject": "Reject", + "Remove %(name)s from the directory?": "Remove %(name)s from the directory?", "Remove": "Remove", - "remove": "remover", + "remove %(name)s from the directory": "remove %(name)s from the directory", "Remove from Directory": "Remove from Directory", + "Resend": "Resend", "Riot does not know how to join a room on this network": "Riot does not know how to join a room on this network", "Room directory": "Room directory", "Room not found": "Room not found", "Search for a room": "Search for a room", "Settings": "Settings", + "Source URL": "Source URL", "Start chat": "Start chat", "The Home Server may be too old to support third party networks": "The Home Server may be too old to support third party networks", "There are advanced notifications which are not shown here": "There are advanced notifications which are not shown here", @@ -75,9 +88,15 @@ "Unable to fetch notification target list": "Unable to fetch notification target list", "Unable to join network": "Unable to join network", "Unable to look up room ID from server": "Unable to look up room ID from server", + "Unhide Preview": "Unhide Preview", "unknown error code": "unknown error code", "Unnamed room": "Unnamed room", + "Uploaded on %(date)s by %(user)s": "Uploaded on %(date)s by %(user)s", + "View Decrypted Source": "View Decrypted Source", + "View Source": "View Source", "World readable": "World readable", + "You cannot delete this image. (%(code)s)": "You cannot delete this image. (%(code)s)", + "You cannot delete this message. (%(code)s)": "You cannot delete this message. (%(code)s)", "You are not receiving desktop notifications": "You are not receiving desktop notifications", "You might have configured them in a client other than Riot. You cannot tune them in Riot but they still apply": "You might have configured them in a client other than Riot. You cannot tune them in Riot but they still apply" } diff --git a/src/i18n/pt_BR.json b/src/i18n/pt_BR.json index 270306c008a..506adf2efbf 100644 --- a/src/i18n/pt_BR.json +++ b/src/i18n/pt_BR.json @@ -1,17 +1,21 @@ { "Add an email address above to configure email notifications": "Adicione um endereço de email acima para configurar as notificações por email", + "All messages": "Todas as mensagens", + "All messages (loud)": "Todas as mensagens (alto)", "All notifications are currently disabled for all targets": "Todas as notificações estão atualmente desativadas para todos os destinos", "An error occurred whilst saving your email notification preferences": "Um erro ocorreu enquanto salvava suas preferências de notificação por email", - "and remove": "e remover", + "Cancel Sending": "Cancelar o envio", "Can't update user notification settings": "Não é possível atualizar as preferências de notificação", + "Close": "Fechar", "Create new room": "Criar nova sala", "Couldn't find a matching Matrix room": "Não foi possível encontrar uma sala correspondente no servidor Matrix", "Custom Server Options": "Opções de customização do servidor", "delete the alias": "apagar o apelido da sala", - "Delete the room alias": "Apagar o apelido da sala", + "Delete the room alias %(alias)s and remove %(name)s from the directory?": "Apagar o apelido %(alias)s da sala e remover %(nome)s da lista pública?", "Direct Chat": "Conversa pessoal", "Directory": "Diretório", "Dismiss": "Encerrar", + "Download this file": "Baixar este arquivo", "Drop here to %(verb)s": "Arraste aqui para %(verb)s", "Enable audible notifications in web client": "Ativar notificações de áudio no cliente web", "Enable desktop notifications": "Ativar notificações no desktop", @@ -23,20 +27,21 @@ "Error saving email notification preferences": "Erro ao salvar as preferências de notificação por email", "#example:": "#exemplo", "Failed to": "Falha ao", - "Failed to add tag ": "Falha ao adicionar a palavra-chave ", - "Failed to change settings": "Falha ao mudar as preferências", + "Failed to add tag %(tagName)s to room": "Falha ao adicionar %(tagName)s à sala", + "Failed to change settings": "Falha ao mudar as preferências", + "Failed to forget room %(errCode)s": "Falha ao esquecer a sala %(errCode)s", "Failed to update keywords": "Falha ao alterar as palavras-chave", "Failed to get protocol list from Home Server": "Falha em acessar a lista de protocolos do servidor padrão", "Failed to get public room list": "Falha ao acessar a lista pública de salas", "Failed to join the room": "Falha ao entrar na sala", - "Failed to remove tag ": "Falha ao remover a palavra-chave ", + "Failed to remove tag %(tag)s from room": "Falha ao remover a palavra-chave %(tag)s da sala", + "Failed to set direct chat tag": "Falha ao definir conversa como pessoal", "Failed to set Direct Message status of room": "Falha em definr a mensagem de status da sala", "Favourite": "Favorito", "Fetching third party location failed": "Falha ao acessar localização de terceiros", "Files": "Arquivos", "Filter room names": "Filtrar salas por título", "Forget": "Esquecer", - "from the directory": "da lista pública de salas", " from room": " da sala", "Guests can join": "Convidados podem entrar", "Guest users can't invite users. Please register to invite": "Usuários convidados não podem convidar outros usuários. Por gentileza se registre para enviar convites", @@ -45,6 +50,8 @@ "Leave": "Sair", "Low Priority": "Baixa prioridade", "Members": "Membros", + "Mentions only": "Apenas menções", + "Mute": "Mudo", "No rooms to show": "Não existem salas a serem exibidas", "Noisy": "Barulhento", "Notification targets": "Alvos de notificação", @@ -55,17 +62,23 @@ "Off": "Desativado", "On": "Ativado", "Operation failed": "A operação falhou", + "Permalink": "Link permanente", "Please Register": "Por favor, registre-se", "powered by Matrix": "distribuído por Matrix", + "Quote": "Citar", + "Redact": "Remover", "Reject": "Rejeitar", "Remove": "Remover", - "remove": "remover", + "Remove %(name)s from the directory?": "Remover %(name)s da lista pública de salas?", + "remove %(name)s from the directory": "remover %(name)s da lista pública de salas", "Remove from Directory": "Remover da lista pública de salas", + "Resend": "Reenviar", "Riot does not know how to join a room on this network": "O sistema não sabe como entrar na sala desta rede", "Room directory": "Lista de salas públicas", "Room not found": "Sala não encontrada", "Search for a room": "Procurar por uma sala", "Settings": "Configurações", + "Source URL": "URL fonte", "Start chat": "Começar conversa", "The Home Server may be too old to support third party networks": "O servidor pode ser muito antigo para suportar redes de terceiros.", "There are advanced notifications which are not shown here": "Existem opções avançadas que não são exibidas aqui", @@ -75,9 +88,15 @@ "Unable to fetch notification target list": "Não foi possível obter a lista de alvos de notificação", "Unable to join network": "Não foi possível conectar na rede", "Unable to look up room ID from server": "Não foi possivel buscar identificação da sala no servidor", + "Unhide Preview": "Mostrar a pré-visualização novamente", "unknown error code": "Código de erro desconhecido", "Unnamed room": "Sala sem nome", + "Uploaded on %(date)s by %(user)s": "Enviada em %(date)s por %(user)s", + "View Decrypted Source": "Ver a fonte descriptografada", + "View Source": "Ver a fonte", "World readable": "Público", + "You cannot delete this image. (%(code)s)": "Você não pode apagar esta imagem. (%(code)s)", + "You cannot delete this message. (%(code)s)": "Você não pode apagar esta mensagem. (%(code)s)", "You are not receiving desktop notifications": "Você não está recebendo notificações desktop", "You might have configured them in a client other than Riot. You cannot tune them in Riot but they still apply": "Você pode te-las configurado em outro cliente além do Riot. Você não pode ajustá-las no Riot, mas ainda assim elas se aplicam aqui" }