Skip to content
Snippets Groups Projects
Commit 7dc92154 authored by Rick Waldron's avatar Rick Waldron Committed by Leo Balter
Browse files

Frontmatter: Adds top level "locale" attribute. Fixes gh-1515 (#1561)

parent 510f7056
No related branches found
No related tags found
No related merge requests found
......@@ -353,3 +353,27 @@ following strings:
- **`generated`** The test file was created procedurally using the project's
test generation tool. This flag is specified for informational purposes only
and has no bearing on how the test should be interpreted.
### `locale`
The `locale` attribute allows tests to declare explicit information regarding locale specificity. Its value is an array of one or more valid language tags or subtags.
*Example*
```js
/*---
locale: [en, en-US, ar]
---*/
var en = new Intl.PluralRules('en');
assert.sameValue(en.select(1), 'one', 'en.select(1) returns "one"');
assert.sameValue(en.select(2), 'other', 'en.select(2) returns "other"');
var enUS = new Intl.PluralRules('en-US');
assert.sameValue(enUS.select(1), 'one', 'enUS.select(1) returns "one"');
assert.sameValue(enUS.select(2), 'other', 'enUS.select(2) returns "other"');
var ar = new Intl.PluralRules('ar');
assert.sameValue(ar.select(1), 'one', 'ar.select(1) returns "one"');
assert.sameValue(ar.select(2), 'other', 'ar.select(2) returns "two"');
```
......@@ -3,7 +3,7 @@ from ..check import Check
_REQUIRED_FIELDS = set(['description'])
_OPTIONAL_FIELDS = set([
'author', 'es5id', 'es6id', 'esid', 'features', 'flags', 'includes',
'info', 'negative', 'timeout'
'info', 'locale', 'negative', 'timeout'
])
_VALID_FIELDS = _REQUIRED_FIELDS | _OPTIONAL_FIELDS
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment