show room name where available when header isn't visible (no preview)
This commit is contained in:
parent
eeb9b4b2e3
commit
f9a2b76966
2 changed files with 22 additions and 11 deletions
|
@ -177,8 +177,15 @@ module.exports = React.createClass({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_roomName: function() {
|
_roomName: function(atStart = false) {
|
||||||
return this.props.room ? this.props.room.name : (this.props.room_alias || _t("This room"));
|
const name = this.props.room ? this.props.room.name : this.props.room_alias;
|
||||||
|
if (name) {
|
||||||
|
return name;
|
||||||
|
} else if (atStart) {
|
||||||
|
return _t("This room");
|
||||||
|
} else {
|
||||||
|
return _t("this room");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onLoginClick: function() {
|
onLoginClick: function() {
|
||||||
|
@ -226,7 +233,8 @@ module.exports = React.createClass({
|
||||||
}
|
}
|
||||||
case MessageCase.Kicked: {
|
case MessageCase.Kicked: {
|
||||||
const {memberName, reason} = this._getKickOrBanInfo();
|
const {memberName, reason} = this._getKickOrBanInfo();
|
||||||
title = _t("You were kicked from this room by %(memberName)s", {memberName});
|
title = _t("You were kicked from %(roomName)s by %(memberName)s",
|
||||||
|
{memberName, roomName: this._roomName()});
|
||||||
subTitle = _t("Reason: %(reason)s", {reason});
|
subTitle = _t("Reason: %(reason)s", {reason});
|
||||||
|
|
||||||
if (this._joinRule() === "invite") {
|
if (this._joinRule() === "invite") {
|
||||||
|
@ -242,7 +250,8 @@ module.exports = React.createClass({
|
||||||
}
|
}
|
||||||
case MessageCase.Banned: {
|
case MessageCase.Banned: {
|
||||||
const {memberName, reason} = this._getKickOrBanInfo();
|
const {memberName, reason} = this._getKickOrBanInfo();
|
||||||
title = _t("You were banned from this room by %(memberName)s", {memberName});
|
title = _t("You were banned from %(roomName)s by %(memberName)s",
|
||||||
|
{memberName, roomName: this._roomName()});
|
||||||
subTitle = _t("Reason: %(reason)s", {reason});
|
subTitle = _t("Reason: %(reason)s", {reason});
|
||||||
primaryActionLabel = _t("Forget this room");
|
primaryActionLabel = _t("Forget this room");
|
||||||
primaryActionHandler = this.props.onForgetClick;
|
primaryActionHandler = this.props.onForgetClick;
|
||||||
|
@ -307,19 +316,20 @@ module.exports = React.createClass({
|
||||||
if (this.props.canPreview) {
|
if (this.props.canPreview) {
|
||||||
title = _t("You're previewing this room. Want to join it?");
|
title = _t("You're previewing this room. Want to join it?");
|
||||||
} else {
|
} else {
|
||||||
title = _t("This room can't be previewed. Do you want to join it?");
|
title = _t("%(roomName)s can't be previewed. Do you want to join it?",
|
||||||
|
{roomName: this._roomName(true)});
|
||||||
}
|
}
|
||||||
primaryActionLabel = _t("Join the discussion");
|
primaryActionLabel = _t("Join the discussion");
|
||||||
primaryActionHandler = this.props.onJoinClick;
|
primaryActionHandler = this.props.onJoinClick;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MessageCase.RoomNotFound: {
|
case MessageCase.RoomNotFound: {
|
||||||
title = _t("%(roomName)s does not exist.", {roomName: this._roomName()});
|
title = _t("%(roomName)s does not exist.", {roomName: this._roomName(true)});
|
||||||
subTitle = _t("This room doesn't exist. Are you sure you're at the right place?");
|
subTitle = _t("This room doesn't exist. Are you sure you're at the right place?");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MessageCase.OtherError: {
|
case MessageCase.OtherError: {
|
||||||
title = _t("%(roomName)s is not accessible at this time.", {roomName: this._roomName()});
|
title = _t("%(roomName)s is not accessible at this time.", {roomName: this._roomName(true)});
|
||||||
subTitle = [
|
subTitle = [
|
||||||
_t("Try again later, or ask a room admin to check if you have access."),
|
_t("Try again later, or ask a room admin to check if you have access."),
|
||||||
_t("%(errcode)s was returned while trying to access the room. If you think you're seeing this message in error, please <issueLink>submit a bug report</issueLink>.",
|
_t("%(errcode)s was returned while trying to access the room. If you think you're seeing this message in error, please <issueLink>submit a bug report</issueLink>.",
|
||||||
|
|
|
@ -790,17 +790,18 @@
|
||||||
"Historical": "Historical",
|
"Historical": "Historical",
|
||||||
"System Alerts": "System Alerts",
|
"System Alerts": "System Alerts",
|
||||||
"This room": "This room",
|
"This room": "This room",
|
||||||
|
"this room": "this room",
|
||||||
"Joining room …": "Joining room …",
|
"Joining room …": "Joining room …",
|
||||||
"Loading …": "Loading …",
|
"Loading …": "Loading …",
|
||||||
"Rejecting invite …": "Rejecting invite …",
|
"Rejecting invite …": "Rejecting invite …",
|
||||||
"Join the conversation with an account": "Join the conversation with an account",
|
"Join the conversation with an account": "Join the conversation with an account",
|
||||||
"Sign Up": "Sign Up",
|
"Sign Up": "Sign Up",
|
||||||
"Sign In": "Sign In",
|
"Sign In": "Sign In",
|
||||||
"You were kicked from this room by %(memberName)s": "You were kicked from this room by %(memberName)s",
|
"You were kicked from %(roomName)s by %(memberName)s": "You were kicked from %(roomName)s by %(memberName)s",
|
||||||
"Reason: %(reason)s": "Reason: %(reason)s",
|
"Reason: %(reason)s": "Reason: %(reason)s",
|
||||||
"Re-join": "Re-join",
|
|
||||||
"Forget this room": "Forget this room",
|
"Forget this room": "Forget this room",
|
||||||
"You were banned from this room by %(memberName)s": "You were banned from this room by %(memberName)s",
|
"Re-join": "Re-join",
|
||||||
|
"You were banned from %(roomName)s by %(memberName)s": "You were banned from %(roomName)s by %(memberName)s",
|
||||||
"Something went wrong with your invite to this room": "Something went wrong with your invite to this room",
|
"Something went wrong with your invite to this room": "Something went wrong with your invite to this room",
|
||||||
"%(errcode)s was returned while trying to valide your invite. You could try to pass this information on to a room admin.": "%(errcode)s was returned while trying to valide your invite. You could try to pass this information on to a room admin.",
|
"%(errcode)s was returned while trying to valide your invite. You could try to pass this information on to a room admin.": "%(errcode)s was returned while trying to valide your invite. You could try to pass this information on to a room admin.",
|
||||||
"You can only join it with a working invite.": "You can only join it with a working invite.",
|
"You can only join it with a working invite.": "You can only join it with a working invite.",
|
||||||
|
@ -814,7 +815,7 @@
|
||||||
"%(memberName)s invited you": "%(memberName)s invited you",
|
"%(memberName)s invited you": "%(memberName)s invited you",
|
||||||
"Reject": "Reject",
|
"Reject": "Reject",
|
||||||
"You're previewing this room. Want to join it?": "You're previewing this room. Want to join it?",
|
"You're previewing this room. Want to join it?": "You're previewing this room. Want to join it?",
|
||||||
"This room can't be previewed. Do you want to join it?": "This room can't be previewed. Do you want to join it?",
|
"%(roomName)s can't be previewed. Do you want to join it?": "%(roomName)s can't be previewed. Do you want to join it?",
|
||||||
"%(roomName)s does not exist.": "%(roomName)s does not exist.",
|
"%(roomName)s does not exist.": "%(roomName)s does not exist.",
|
||||||
"This room doesn't exist. Are you sure you're at the right place?": "This room doesn't exist. Are you sure you're at the right place?",
|
"This room doesn't exist. Are you sure you're at the right place?": "This room doesn't exist. Are you sure you're at the right place?",
|
||||||
"%(roomName)s is not accessible at this time.": "%(roomName)s is not accessible at this time.",
|
"%(roomName)s is not accessible at this time.": "%(roomName)s is not accessible at this time.",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue