Skip to content

Commit e4c3aa0

Browse files
committed
test(core): pin the picker's prefix lookup with codes the locale table does not name whole
Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1494b35 commit e4c3aa0

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎packages/core/src/sentence-locale.test.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ describe('[#35138] pickSentenceLocale — the language of a sentence in a tool r
1111
expect(pickSentenceLocale(['zh-TW'], WRITTEN)).toBe('zh-Hant');
1212
expect(pickSentenceLocale(['zh-Hant-HK'], WRITTEN)).toBe('zh-Hant');
1313
expect(pickSentenceLocale(['fr-FR', 'ja-JP'], WRITTEN)).toBe('ja');
14+
// Not in the table whole: named by a shorter prefix.
15+
expect(pickSentenceLocale(['ja-JP-u-ca-japanese'], WRITTEN)).toBe('ja');
16+
expect(pickSentenceLocale(['zh-Hans-SG-x-a'], WRITTEN)).toBe('zh-Hans');
1417
});
1518

1619
it('a language the producer does not write takes the next rung, and `en` is the floor', () => {

0 commit comments

Comments
 (0)