You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @description Tooltip text that appears when hovering over the 'Focusable' attribute name under the Computed Properties section in the Accessibility pane of the Elements pane.
240
247
*/
241
248
computedPropertyTooltip:'If true, this element can receive focus.',
242
-
};
249
+
} as const;
243
250
```
244
251
245
252
**Bad description**:
@@ -250,39 +257,39 @@ const UIStrings = {
250
257
* @description Elements pane 'Focusable' tooltip.
251
258
*/
252
259
computedPropertyTooltip:'If true, this element can receive focus.',
253
-
};
260
+
} as const;
254
261
```
255
262
256
263
### What information should I provide in the message description?
257
264
258
-
- The type of UI element where the text is displayed. Is it regular text, a
259
-
label, button text, a tooltip, a link, or an accessible label? Button text
260
-
is often imperative i.e. a command to do something, which is important to
261
-
know in some languages.
262
-
- *When*: What triggers the string and/or what is the result? What page or
263
-
text comes before and after? e.g. "Status text while waiting for X", "Shown
264
-
when the audit is finished and X error was encountered".
265
-
- What do the placeholders stand for? Placeholder examples are sent to
266
-
translators, but extra information in the description will help too. e.g.
267
-
"Total time in ms that the profile took to complete", "The CSS property name
268
-
that is being edited"
269
-
- Is this a verb or a noun? Many words in English can be both, e.g. 'request',
270
-
'address', 'change', 'display', 'increase'. Particularly if the string is
271
-
short, this can be hard to guess. If it's an adjective, what does it refer
272
-
to? This is important for inflection in some languages, where the ending of
273
-
the adjective must change for gender or case.
274
-
- Explain or name any complex terms, e.g. "Trust Tokens are a web API -
275
-
https://web.dev/trust-tokens/"
276
-
- Where is the text located? e.g. A table header in the Sources panel, a
277
-
context-menu item in the Network panel. Many strings in the code base have
278
-
*only* the location, which is not the most important context.
265
+
- The type of UI element where the text is displayed. Is it regular text, a
266
+
label, button text, a tooltip, a link, or an accessible label? Button text
267
+
is often imperative i.e. a command to do something, which is important to
268
+
know in some languages.
269
+
- _When_: What triggers the string and/or what is the result? What page or
270
+
text comes before and after? e.g. "Status text while waiting for X", "Shown
271
+
when the audit is finished and X error was encountered".
272
+
- What do the placeholders stand for? Placeholder examples are sent to
273
+
translators, but extra information in the description will help too. e.g.
274
+
"Total time in ms that the profile took to complete", "The CSS property name
275
+
that is being edited"
276
+
- Is this a verb or a noun? Many words in English can be both, e.g. 'request',
277
+
'address', 'change', 'display', 'increase'. Particularly if the string is
278
+
short, this can be hard to guess. If it's an adjective, what does it refer
279
+
to? This is important for inflection in some languages, where the ending of
280
+
the adjective must change for gender or case.
281
+
- Explain or name any complex terms, e.g. "Trust Tokens are a web API -
282
+
https://web.dev/trust-tokens/"
283
+
- Where is the text located? e.g. A table header in the Sources panel, a
284
+
context-menu item in the Network panel. Many strings in the code base have
285
+
_only_ the location, which is not the most important context.
279
286
280
287
## How to prevent a term being localized
281
288
282
289
Any text within the backticks will not be translated. For example, if the
283
290
'robots.txt' in string 'Requesting for robots.txt …' should not be translated:
284
291
285
-
```javascript
292
+
```js
286
293
// in example.js file
287
294
288
295
import*asi18nfrom'../i18n/i18n.js';
@@ -291,7 +298,7 @@ const UIStrings = {
291
298
* @description Example description. Note: "robots.txt" is a canonical filename and should not be translated.
0 commit comments