[WEBLATE] fix issues.

pull/4077/head
RiotTranslate 2017-05-30 13:11:04 +00:00
parent 83926eefce
commit e15d070e8f
4 changed files with 29 additions and 5 deletions

View File

@ -40,6 +40,31 @@ module.exports = React.createClass({
onFinished: React.PropTypes.func,
},
getInitialState: function() {
return {
canRedact: false,
};
},
componentWillMount: function() {
MatrixClientPeg.get().on('RoomMember.powerLevel', this._checkCanRedact);
this._checkCanRedact();
},
componentWillUnmount: function() {
const cli = MatrixClientPeg.get();
if (cli) {
cli.removeListener('RoomMember.powerLevel', this._checkCanRedact);
}
},
_checkCanRedact: function() {
const cli = MatrixClientPeg.get();
const room = cli.getRoom(this.props.mxEvent.getRoomId());
const canRedact = room.currentState.maySendRedactionForEvent(this.props.mxEvent, cli.credentials.userId);
this.setState({canRedact});
},
onResendClick: function() {
Resend.resend(this.props.mxEvent);
if (this.props.onFinished) this.props.onFinished();
@ -136,10 +161,10 @@ module.exports = React.createClass({
);
}
if (!eventStatus && !this.props.mxEvent.isRedacted()) { // sent and not redacted
if (this.state.canRedact) {
redactButton = (
<div className="mx_MessageContextMenu_field" onClick={this.onRedactClick}>
{ _t('Redact') }
{ _t('Remove') }
</div>
);
}
@ -206,7 +231,7 @@ module.exports = React.createClass({
externalURLButton = (
<div className="mx_MessageContextMenu_field">
<a href={ this.props.mxEvent.event.content.external_url }
rel="noopener" target="_blank" onClick={ this.closeMenu }>{ _t('Source URL') }</a>
rel="noopener" target="_blank" onClick={ this.closeMenu }>{ _t('Source URL') }</a>
</div>
);
}

View File

@ -178,6 +178,7 @@ module.exports = React.createClass({
Modal.createDialog(TextInputDialog, {
title: _t('Keywords'),
description: _t('Enter keywords separated by a comma:'),
button: _t('OK'),
value: keywords,
onFinished: function onFinished(should_leave, newValue) {

View File

@ -2,7 +2,6 @@
"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.",
"Cancel Sending": "Cancelar o envio",
"Can't update user notification settings": "Não é possível atualizar as preferências de notificação",

View File

@ -2,7 +2,6 @@
"Add an email address above to configure email notifications": "Insira um endereço de email no campo acima para configurar suas 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 desabilitadas para todos os destinatários.",
"An error occurred whilst saving your email notification preferences.": "Um erro ocorreu enquanto o sistema estava salvando suas preferências de notificação por email.",
"Call invitation": "Convite para chamada",
"Cancel Sending": "Cancelar o envio",