WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
216136
Web Inspector: Localization: "Low/Medium/High" strings need separate keys for different uses in the UI
https://bugs.webkit.org/show_bug.cgi?id=216136
Summary
Web Inspector: Localization: "Low/Medium/High" strings need separate keys for...
Nikita Vasilyev
Reported
2020-09-03 12:07:05 PDT
<
rdar://67800281
>
Attachments
Patch
(7.85 KB, patch)
2020-09-03 12:20 PDT
,
Nikita Vasilyev
no flags
Details
Formatted Diff
Diff
Patch
(7.68 KB, patch)
2020-09-03 23:40 PDT
,
Nikita Vasilyev
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Nikita Vasilyev
Comment 1
2020-09-03 12:20:53 PDT
Created
attachment 407906
[details]
Patch
Devin Rousso
Comment 2
2020-09-03 12:48:30 PDT
Comment on
attachment 407906
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=407906&action=review
> Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js:685 > +localizedStrings["High @ Energy Impact"] = "High";
Can we have a more descriptive keys/comments that includes where in the UI these are found and more of a description of what it's supposed to mean? e.g. ``` WI.UIString("Low", "Low @ CPU Timeline Energy Impact", "Label indicating that the CPU activity was low during the selected range of the selected timeline recording."); ```
> Source/WebInspectorUI/UserInterface/Views/CPUTimelineView.js:1114 > + if (average === 0) > + this._energyChart.value = 0; > + else > + this._energyChart.value = mapWithBias(average, 0, CPUTimelineView.lowEnergyThreshold, 0, CPUTimelineView.lowEnergyGraphBoundary, 0.85);
NIT: i think we can just drop the `if (average === 0)` branch, as `mapWithBias` should return `0` if `average` is `0`
Nikita Vasilyev
Comment 3
2020-09-03 13:08:04 PDT
Comment on
attachment 407906
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=407906&action=review
>> Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js:685 >> +localizedStrings["High @ Energy Impact"] = "High"; > > Can we have a more descriptive keys/comments that includes where in the UI these are found and more of a description of what it's supposed to mean? > > e.g. > ``` > WI.UIString("Low", "Low @ CPU Timeline Energy Impact", "Label indicating that the CPU activity was low during the selected range of the selected timeline recording."); > ```
The goal of this patch is to provide the exact noun the adjective is used with. I'll provide an example for Russian, which has a concept of grammatical gender (
https://en.wikipedia.org/wiki/Grammatical_gender
): Impact - влияние (оно, neutral grammatical gender) high impact - высокое влияние priority - приоритет (он, masculine grammatical gender) high priority - высокий приоритет The important part here is that "high" is translated differently, "высокОЕ" vs "высокИЙ". --- The description you provided looks like a documentation. I wouldn't know what grammatical gender to use from it. "Energy Impact: High" is slightly excessive already. All required is a noun — "Impact".
Blaze Burg
Comment 4
2020-09-03 16:21:31 PDT
Comment on
attachment 407906
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=407906&action=review
>>> Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js:685 >>> +localizedStrings["High @ Energy Impact"] = "High"; >> >> Can we have a more descriptive keys/comments that includes where in the UI these are found and more of a description of what it's supposed to mean? >> >> e.g. >> ``` >> WI.UIString("Low", "Low @ CPU Timeline Energy Impact", "Label indicating that the CPU activity was low during the selected range of the selected timeline recording."); >> ``` > > The goal of this patch is to provide the exact noun the adjective is used with. > > I'll provide an example for Russian, which has a concept of grammatical gender (
https://en.wikipedia.org/wiki/Grammatical_gender
): > > Impact - влияние (оно, neutral grammatical gender) > high impact - высокое влияние > > priority - приоритет (он, masculine grammatical gender) > high priority - высокий приоритет > > The important part here is that "high" is translated differently, "высокОЕ" vs "высокИЙ". > > --- > > The description you provided looks like a documentation. I wouldn't know what grammatical gender to use from it. > > "Energy Impact: High" is slightly excessive already. All required is a noun — "Impact".
While I understand Nikita's point, the reason for the key to exist is for localizers to be able to find the string in the user interface. A comment would be more appropriate to describe the nouns it should be used with. For example, the comment here could be "Label for timeline samples that have High energy impact." This matches the approach used for other localizable apps / localizable.strings files.
Blaze Burg
Comment 5
2020-09-03 16:22:56 PDT
Comment on
attachment 407906
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=407906&action=review
>>>> Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js:685 >>>> +localizedStrings["High @ Energy Impact"] = "High"; >>> >>> Can we have a more descriptive keys/comments that includes where in the UI these are found and more of a description of what it's supposed to mean? >>> >>> e.g. >>> ``` >>> WI.UIString("Low", "Low @ CPU Timeline Energy Impact", "Label indicating that the CPU activity was low during the selected range of the selected timeline recording."); >>> ``` >> >> The goal of this patch is to provide the exact noun the adjective is used with. >> >> I'll provide an example for Russian, which has a concept of grammatical gender (
https://en.wikipedia.org/wiki/Grammatical_gender
): >> >> Impact - влияние (оно, neutral grammatical gender) >> high impact - высокое влияние >> >> priority - приоритет (он, masculine grammatical gender) >> high priority - высокий приоритет >> >> The important part here is that "high" is translated differently, "высокОЕ" vs "высокИЙ". >> >> --- >> >> The description you provided looks like a documentation. I wouldn't know what grammatical gender to use from it. >> >> "Energy Impact: High" is slightly excessive already. All required is a noun — "Impact". > > While I understand Nikita's point, the reason for the key to exist is for localizers to be able to find the string in the user interface. A comment would be more appropriate to describe the nouns it should be used with. For example, the comment here could be "Label for timeline samples that have High energy impact." This matches the approach used for other localizable apps / localizable.strings files.
So... I think your comments and string values are good, just the key should be more like Devin suggested. Thanks for fixing this!
Nikita Vasilyev
Comment 6
2020-09-03 16:40:58 PDT
(In reply to Brian Burg from
comment #4
)
> While I understand Nikita's point, the reason for the key to exist is for > localizers to be able to find the string in the user interface.
I didn't consider that. What about the one I named "High @ Network Priority"? It's used in several places: Sources details sidebar, Network tab, and Timelines tab - Network Requests. I was using keys just specific enough to distinguish the same UIStrings from each other.
Nikita Vasilyev
Comment 7
2020-09-03 23:40:46 PDT
Created
attachment 407945
[details]
Patch
Blaze Burg
Comment 8
2020-09-04 11:14:47 PDT
Comment on
attachment 407945
[details]
Patch r=me
EWS
Comment 9
2020-09-04 11:23:05 PDT
Committed
r266622
: <
https://trac.webkit.org/changeset/266622
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 407945
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug