diff --git a/src/components/views/globals/UpdateCheckBar.js b/src/components/views/globals/UpdateCheckBar.js
index d19a21cb8..926ccbccc 100644
--- a/src/components/views/globals/UpdateCheckBar.js
+++ b/src/components/views/globals/UpdateCheckBar.js
@@ -22,13 +22,6 @@ import PlatformPeg from 'matrix-react-sdk/lib/PlatformPeg';
import {updateCheckStatusEnum} from '../../../vector/platform/VectorBasePlatform';
import AccessibleButton from 'matrix-react-sdk/lib/components/views/elements/AccessibleButton';
-const statusText = {
- CHECKING: 'Checking for an update...',
- ERROR: 'Error encountered (%(errorDetail)s).',
- NOTAVAILABLE: 'No update available.',
- DOWNLOADING: 'Downloading update...',
-};
-
const doneStatuses = [
updateCheckStatusEnum.ERROR,
updateCheckStatusEnum.NOTAVAILABLE,
@@ -42,16 +35,37 @@ export default React.createClass({
detail: React.PropTypes.string,
},
+ getDefaultProps: function() {
+ return {
+ detail: '',
+ }
+ },
+
+ getStatusText: function() {
+ switch(this.props.status) {
+ case updateCheckStatusEnum.ERROR:
+ return _t('Error encountered (%(errorDetail)s).', { errorDetail: this.props.detail });
+ case updateCheckStatusEnum.CHECKING:
+ return _t('Checking for an update...');
+ case updateCheckStatusEnum.NOTAVAILABLE:
+ return _t('No update available.');
+ case updateCheckStatusEnum.DOWNLOADING:
+ return _t('Downloading update...');
+ }
+ }
+ ,
+
hideToolbar: function() {
PlatformPeg.get().stopUpdateCheck();
},
render: function() {
- const message = _t(statusText[this.props.status], { errorDetail: this.props.detail || '' });
+ const message = this.getStatusText();
+ const warning = _t('Warning');
let image;
if (doneStatuses.includes(this.props.status)) {
- image = ;
+ image = ;
} else {
image = ;
}
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json
index a535ced6c..10c21a62d 100644
--- a/src/i18n/strings/en_EN.json
+++ b/src/i18n/strings/en_EN.json
@@ -159,6 +159,7 @@
"Today": "Today",
"Yesterday": "Yesterday",
"OK": "OK",
+ "Warning": "Warning",
"Checking for an update...": "Checking for an update...",
"Error encountered (%(errorDetail)s).": "Error encountered (%(errorDetail)s).",
"No update available.": "No update available.",