Skip to content

Normative: Allow locale based ignorePunctuation default #833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions spec/annexes.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ <h1>Implementation Dependent Behaviour</h1>
<li>
The default search sensitivity per locale (<emu-xref href="#sec-intl-collator-internal-slots"></emu-xref>)
</li>
<li>
The default ignore punctuation value per locale (<emu-xref href="#sec-intl-collator-internal-slots"></emu-xref>)
</li>
<li>
The sort order for each supported locale and options combination (<emu-xref href="#sec-collator-compare-functions"></emu-xref>)
</li>
Expand Down
8 changes: 5 additions & 3 deletions spec/collator.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,17 @@ <h1>
1. Set _collator_.[[Numeric]] to SameValue(_r_.[[kn]], *"true"*).
1. If _relevantExtensionKeys_ contains *"kf"*, then
1. Set _collator_.[[CaseFirst]] to _r_.[[kf]].
1. Let _dataLocale_ be _r_.[[dataLocale]].
1. Let _dataLocaleData_ be _localeData_.[[&lt;_dataLocale_&gt;]].
1. Let _sensitivity_ be ? GetOption(_options_, *"sensitivity"*, ~string~, &laquo; *"base"*, *"accent"*, *"case"*, *"variant"* &raquo;, *undefined*).
1. If _sensitivity_ is *undefined*, then
1. If _usage_ is *"sort"*, then
1. Set _sensitivity_ to *"variant"*.
1. Else,
1. Let _dataLocale_ be _r_.[[dataLocale]].
1. Let _dataLocaleData_ be _localeData_.[[&lt;_dataLocale_&gt;]].
1. Set _sensitivity_ to _dataLocaleData_.[[sensitivity]].
1. Set _collator_.[[Sensitivity]] to _sensitivity_.
1. Let _ignorePunctuation_ be ? GetOption(_options_, *"ignorePunctuation"*, ~boolean~, ~empty~, *false*).
1. Let _defaultIgnorePunctuation_ be _dataLocaleData_.[[ignorePunctuation]].
1. Let _ignorePunctuation_ be ? GetOption(_options_, *"ignorePunctuation"*, ~boolean~, ~empty~, _defaultIgnorePunctuation_).
1. Set _collator_.[[IgnorePunctuation]] to _ignorePunctuation_.
1. Return _collator_.
</emu-alg>
Expand Down Expand Up @@ -141,6 +142,7 @@ <h1>Internal slots</h1>
<li>The first element of [[SortLocaleData]].[[&lt;_locale_&gt;]].[[co]] and [[SearchLocaleData]].[[&lt;_locale_&gt;]].[[co]] must be *null*.</li>
<li>The values *"standard"* and *"search"* must not be used as elements in any [[SortLocaleData]].[[&lt;_locale_&gt;]].[[co]] and [[SearchLocaleData]].[[&lt;_locale_&gt;]].[[co]] list.</li>
<li>[[SearchLocaleData]].[[&lt;_locale_&gt;]] must have a [[sensitivity]] field with a String value equal to *"base"*, *"accent"*, *"case"*, or *"variant"*.</li>
<li>[[SearchLocaleData]].[[&lt;_locale_&gt;]] and [[SortLocaleData]].[[&lt;_locale_&gt;]] must have an [[ignorePunctuation]] field with a Boolean value.</li>
</ul>
</emu-clause>
</emu-clause>
Expand Down