Bug 1192523 - "(cached)" tooltip of request method in netmonitor cannot be localized. r=Honza

MozReview-Commit-ID: BJpmm1nAmhg

--HG--
extra : rebase_source : 427587a7209dc392e3ef6541b0cb8721fa9e4dc7
This commit is contained in:
Vangelis Katsikaros 2017-04-17 11:00:18 +03:00
Родитель 20de7be8a3
Коммит 608abe451f
2 изменённых файлов: 30 добавлений и 6 удалений

Просмотреть файл

@ -815,5 +815,22 @@ netmonitor.backButton=Back
# next to a header list item, with a link to external documentation
netmonitor.headers.learnMore=Learn More
# LOCALIZATION NOTE (netmonitor.status.tooltip.simple): This is the tooltip of the
# column status code, when request is not being cached or is not from a service worker
# %1$S is the status code, %2$S is the status text.
netmonitor.status.tooltip.simple = %1$S %2$S
# LOCALIZATION NOTE (netmonitor.status.tooltip.cached): This is the tooltip of
# the column status code, when the request is cached
# %1$S is the status code, %2$S is the status text.
netmonitor.status.tooltip.cached = %1$S %2$S (cached)
# LOCALIZATION NOTE (netmonitor.status.tooltip.worker): This is the tooltip of
# the column status code, when the request is from a service worker
# %1$S is the status code, %2$S is the status text.
netmonitor.status.tooltip.worker = %1$S %2$S (service worker)
# LOCALIZATION NOTE (netmonitor.status.tooltip.cachedworker): This is the tooltip
# of the column status code, when the request is cached and is from a service worker
# %1$S is the status code, %2$S is the status text.
netmonitor.status.tooltip.cachedworker = %1$S %2$S (cached, service worker)

Просмотреть файл

@ -9,6 +9,7 @@ const {
DOM,
PropTypes,
} = require("devtools/client/shared/vendor/react");
const { L10N } = require("../utils/l10n");
const { propertiesEqual } = require("../utils/request-utils");
const { div, span } = DOM;
@ -46,12 +47,18 @@ const RequestListColumnStatus = createClass({
}
if (statusText) {
title = `${status} ${statusText}`;
if (fromCache) {
title += " (cached)";
}
if (fromServiceWorker) {
title += " (service worker)";
if (fromCache && fromServiceWorker) {
title = L10N.getFormatStr("netmonitor.status.tooltip.cachedworker",
status, statusText);
} else if (fromCache) {
title = L10N.getFormatStr("netmonitor.status.tooltip.cached",
status, statusText);
} else if (fromServiceWorker) {
title = L10N.getFormatStr("netmonitor.status.tooltip.worker",
status, statusText);
} else {
title = L10N.getFormatStr("netmonitor.status.tooltip.simple",
status, statusText);
}
}
}