mirror of
https://github.com/zoriya/flood.git
synced 2026-06-08 04:41:03 +00:00
WindowTitle: fix speed update and remove from translation
This commit is contained in:
@@ -9,47 +9,36 @@ const WindowTitle: React.FC = () => {
|
||||
const {transferSummary: summary} = TransferDataStore;
|
||||
const intl = useIntl();
|
||||
|
||||
React.useEffect(() => {
|
||||
let title = 'Flood';
|
||||
let title = 'Flood';
|
||||
|
||||
if (summary != null && Object.keys(summary).length > 0) {
|
||||
const down = compute(summary.downRate);
|
||||
const up = compute(summary.upRate);
|
||||
if (summary != null && Object.keys(summary).length > 0) {
|
||||
const down = compute(summary.downRate);
|
||||
const up = compute(summary.upRate);
|
||||
|
||||
const formattedDownSpeed = intl.formatNumber(down.value);
|
||||
const formattedUpSpeed = intl.formatNumber(up.value);
|
||||
const formattedDownSpeed = intl.formatNumber(down.value);
|
||||
const formattedUpSpeed = intl.formatNumber(up.value);
|
||||
|
||||
const translatedDownUnit = intl.formatMessage(
|
||||
{
|
||||
id: 'unit.speed',
|
||||
},
|
||||
{
|
||||
baseUnit: intl.formatMessage({id: getTranslationString(down.unit)}),
|
||||
},
|
||||
);
|
||||
const translatedUpUnit = intl.formatMessage(
|
||||
{
|
||||
id: 'unit.speed',
|
||||
},
|
||||
{
|
||||
baseUnit: intl.formatMessage({id: getTranslationString(up.unit)}),
|
||||
},
|
||||
);
|
||||
const translatedDownUnit = intl.formatMessage(
|
||||
{
|
||||
id: 'unit.speed',
|
||||
},
|
||||
{
|
||||
baseUnit: intl.formatMessage({id: getTranslationString(down.unit)}),
|
||||
},
|
||||
);
|
||||
const translatedUpUnit = intl.formatMessage(
|
||||
{
|
||||
id: 'unit.speed',
|
||||
},
|
||||
{
|
||||
baseUnit: intl.formatMessage({id: getTranslationString(up.unit)}),
|
||||
},
|
||||
);
|
||||
|
||||
title = intl.formatMessage(
|
||||
{
|
||||
id: 'window.title',
|
||||
// \u2193 and \u2191 are down and up arrows, respectively
|
||||
},
|
||||
{
|
||||
down: `${formattedDownSpeed} ${translatedDownUnit}`,
|
||||
up: `${formattedUpSpeed} ${translatedUpUnit}`,
|
||||
},
|
||||
);
|
||||
}
|
||||
title = `↓ ${formattedDownSpeed} ${translatedDownUnit} ↑ ${formattedUpSpeed} ${translatedUpUnit} - Flood`;
|
||||
}
|
||||
|
||||
document.title = title;
|
||||
}, [intl, summary]);
|
||||
document.title = title;
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
@@ -2498,27 +2498,5 @@
|
||||
"type": 0,
|
||||
"value": "yr"
|
||||
}
|
||||
],
|
||||
"window.title": [
|
||||
{
|
||||
"type": 0,
|
||||
"value": "↓ "
|
||||
},
|
||||
{
|
||||
"type": 1,
|
||||
"value": "down"
|
||||
},
|
||||
{
|
||||
"type": 0,
|
||||
"value": " ↑ "
|
||||
},
|
||||
{
|
||||
"type": 1,
|
||||
"value": "up"
|
||||
},
|
||||
{
|
||||
"type": 0,
|
||||
"value": " - Flood"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -352,7 +352,6 @@
|
||||
"status.diskusage.total": "Total",
|
||||
"locale.language.auto": "Automatic",
|
||||
"locale.language.translate": "Start to translate",
|
||||
"window.title": "↓ {down} ↑ {up} - Flood",
|
||||
"dependency.loading.notifications": "Notifications",
|
||||
"dependency.loading.torrent.taxonomy": "Torrent Taxonomy",
|
||||
"dependency.loading.transfer.rate.details": "Data Transfer Rate Details",
|
||||
|
||||
Reference in New Issue
Block a user