mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 05:55:00 +08:00
Merge pull request #1320 from matrix-org/rxl881/timeline
Timeline improvements
This commit is contained in:
commit
e32c499298
@ -252,18 +252,21 @@ function textForWidgetEvent(event) {
|
|||||||
const senderName = event.sender ? event.sender.name : event.getSender();
|
const senderName = event.sender ? event.sender.name : event.getSender();
|
||||||
const previousContent = event.getPrevContent() || {};
|
const previousContent = event.getPrevContent() || {};
|
||||||
const {name, type, url} = event.getContent() || {};
|
const {name, type, url} = event.getContent() || {};
|
||||||
let widgetName = widgetName || name || type || previousContent.type;
|
let widgetName = name || previousContent.name || type || previousContent.type || '';
|
||||||
widgetName = widgetName ? widgetName + ' ' : '';
|
// Apply sentence case to widget name
|
||||||
|
if (widgetName && widgetName.length > 0) {
|
||||||
|
widgetName = widgetName[0].toUpperCase() + widgetName.slice(1) + ' ';
|
||||||
|
}
|
||||||
|
|
||||||
// If the widget was removed, its content should be {}, but this is sufficiently
|
// If the widget was removed, its content should be {}, but this is sufficiently
|
||||||
// equivalent to that condition.
|
// equivalent to that condition.
|
||||||
if (url) {
|
if (url) {
|
||||||
return _t('%(senderName)s added a %(widgetName)swidget', {
|
return _t('%(widgetName)s widget added by %(senderName)s', {
|
||||||
senderName, widgetName,
|
widgetName, senderName,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
return _t('%(senderName)s removed a %(widgetName)swidget', {
|
return _t('%(widgetName)s widget removed by %(senderName)s', {
|
||||||
senderName, widgetName,
|
widgetName, senderName,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -972,7 +972,7 @@
|
|||||||
"Failed to upload image": "Failed to upload image",
|
"Failed to upload image": "Failed to upload image",
|
||||||
"Failed to update group": "Failed to update group",
|
"Failed to update group": "Failed to update group",
|
||||||
"Hide avatars in user and room mentions": "Hide avatars in user and room mentions",
|
"Hide avatars in user and room mentions": "Hide avatars in user and room mentions",
|
||||||
"%(senderName)s added a %(widgetName)swidget": "%(senderName)s added a %(widgetName)swidget",
|
"%(widgetName)s widget added by %(senderName)s": "%(widgetName)s widget added by %(senderName)s",
|
||||||
"%(senderName)s removed a %(widgetName)swidget": "%(senderName)s removed a %(widgetName)swidget",
|
"%(widgetName)s widget removed by %(senderName)s": "%(widgetName)s widget removed by %(senderName)s",
|
||||||
"Robot check is currently unavailable on desktop - please use a <a>web browser</a>": "Robot check is currently unavailable on desktop - please use a <a>web browser</a>"
|
"Robot check is currently unavailable on desktop - please use a <a>web browser</a>": "Robot check is currently unavailable on desktop - please use a <a>web browser</a>"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user