Update singular/plural l10n code in Issues tab
new localised string defination moved to UIStrings,return type of getResourceName changed to `LocalizedString`
Bug: 1183249
Change-Id: I0c8124e421227045992e8ed9b5dd92746c00ef6e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2763359
Reviewed-by: Wolfgang Beyer <[email protected]>
Commit-Queue: Wolfgang Beyer <[email protected]>
diff --git a/AUTHORS b/AUTHORS
index 36744e1..9c3daae 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -34,6 +34,7 @@
Luke Swiderski <[email protected]>
Per-Olov Jernberg <[email protected]>
PhistucK <[email protected]>
+Pradhuman Singh Baid <[email protected]>
Rahat Muneeb <[email protected]>
Rajasekar Murugan <[email protected]>
Stephen Tsoi-A-Sue <[email protected]>
diff --git a/front_end/i18n/locales/en-US.json b/front_end/i18n/locales/en-US.json
index bdfa9b3..aa5ed3d 100644
--- a/front_end/i18n/locales/en-US.json
+++ b/front_end/i18n/locales/en-US.json
@@ -1694,6 +1694,9 @@
"issues/AffectedCookiesView.ts | name": {
"message": "Name"
},
+ "issues/AffectedCookiesView.ts | nCookies": {
+ "message": "{n, plural, =1 { cookie} other { cookies}}"
+ },
"issues/AffectedCookiesView.ts | path": {
"message": "Path"
},
diff --git a/front_end/i18n/locales/en-XL.json b/front_end/i18n/locales/en-XL.json
index 0af3545..d650e2b 100644
--- a/front_end/i18n/locales/en-XL.json
+++ b/front_end/i18n/locales/en-XL.json
@@ -1694,6 +1694,9 @@
"issues/AffectedCookiesView.ts | name": {
"message": "N̂ám̂é"
},
+ "issues/AffectedCookiesView.ts | nCookies": {
+ "message": "{n, plural, =1 { ĉóôḱîé} other { ĉóôḱîéŝ}}"
+ },
"issues/AffectedCookiesView.ts | path": {
"message": "P̂át̂h́"
},
diff --git a/front_end/issues/AffectedCookiesView.ts b/front_end/issues/AffectedCookiesView.ts
index 26dd8cc..117c065 100644
--- a/front_end/issues/AffectedCookiesView.ts
+++ b/front_end/issues/AffectedCookiesView.ts
@@ -5,6 +5,7 @@
import * as Host from '../host/host.js';
import * as i18n from '../i18n/i18n.js';
import * as Network from '../network/network.js';
+import * as Platform from '../platform/platform.js';
import * as UI from '../ui/ui.js';
import {AffectedItem, AffectedResourcesView} from './AffectedResourcesView.js';
@@ -13,6 +14,10 @@
const UIStrings = {
/**
+ *@description Noun, singular or plural. Label for the kind and number of affected resources associated with a DevTools issue. A cookie is a small piece of data that a server sends to the user's web browser. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies.
+ */
+ nCookies: '{n, plural, =1 { cookie} other { cookies}}',
+ /**
*@description Noun, singular. Label for the kind and number of affected resources associated with a DevTools issue. A cookie is a small piece of data that a server sends to the user's web browser. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies.
*/
cookie: 'cookie',
@@ -43,6 +48,10 @@
this.issue = issue;
}
+ protected getResourceName(count: number): Platform.UIString.LocalizedString {
+ return i18nString(UIStrings.nCookies, {n: count});
+ }
+
private appendAffectedCookies(cookies: Iterable<{cookie: Protocol.Audits.AffectedCookie, hasRequest: boolean}>):
void {
const header = document.createElement('tr');