i18n of video calls

This commit is contained in:
or-else
2022-05-28 16:54:43 -07:00
parent 535d276665
commit 43e3395350
16 changed files with 182 additions and 215 deletions
+6 -3
View File
@@ -8,12 +8,15 @@ import { secondsToTime } from '../lib/strformat.js';
export default class CallMessage extends React.PureComponent {
render() {
const isCallDropped = this.props.content == 'disconnected';
const successClass = 'material-icons medium ' + (isCallDropped ? 'red' : 'green');
const callIcon = this.props.response ?
(isCallDropped ? 'call_missed' : 'call_received') :
(isCallDropped ? 'call_missed_outgoing' : 'call_made');
const successClass = 'material-icons medium ' + (isCallDropped ? 'red' : 'green');
const duration = isCallDropped ?
<FormattedMessage id="call_cancelled" defaultMessage="cancelled" dexcription="Label for cancelled call, incoming or outgoing" /> :
const duration = isCallDropped ? (
this.props.response ?
<FormattedMessage id="call_missed" defaultMessage="missed" description="Label for cancelled incoming call" /> :
<FormattedMessage id="call_cancelled" defaultMessage="cancelled" description="Label for cancelled outgoing call" />
) :
<span>{secondsToTime(this.props.duration / 1000)}</span>;
return <div className="call-message">
<div><i className="material-icons big gray">call</i></div>
+4 -2
View File
@@ -71,8 +71,10 @@ class Contact extends React.Component {
// The this.props.preview contains alreay shortened Drafty or string.
let preview;
if (this.props.previewIsVideoCall) {
preview = <><i className="material-icons">{this.props.previewIsResponse ? 'call_received' : 'call_made'}</i>
<i className="material-icons">video_call</i></>;
preview = <>
<i className="material-icons">call</i>
<i className="material-icons medium">{this.props.previewIsResponse ? 'call_received' : 'call_made'}</i>
</>;
} else if (typeof this.props.preview == 'string') {
preview = this.props.preview;
} else if (Drafty.isValid(this.props.preview)) {