Repository navigation
Conversation
|
@kruschdev is attempting to deploy a commit to the Pascal Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes locale auto-detection for CJK compact date offsets (plan 031, plan 033) and wires
localePacksauto-detection intoparseDateandparseDateRange.detectLocale([zh], '3天后')anddetectLocale([ja], '3日後')fell back to English becausecompactOffset(unitWords+pastSuffixes/futureSuffixes) did not feeddetectionWordsoraliasWords, and CJK tokenization groups<unit><suffix>(天后,日後,週間前,分钟后) into a single word token after the leading digits. I deriveddetectionWordsdirectly fromCOMPACT_UNITSinsidelocales/zh.tsandlocales/ja.tsso the data stays 100% tree-shaken in each locale pack (0 Badded to./coreorlingo (full)).parseDateandparseDateRangecalledresolveLanguageProfile(opts?.localePacks, opts?.locale)directly, defaulting omittedlocaleto'en'even whenlocalePackswas supplied. I extracted a sharedmakePstate helper indate/parse.tsthat reuses the already-computed token scan withdetectLanguageProfilewheneverlocalePacksis provided without an explicitlocale, keeping./date(44.34 / 44.4 kB) and./ai(19.39 / 19.4 kB) within their size budgets.Checklist
Gates
bun run checkgreen (typecheck, tests, build, size budgets, corpus gate, zero-deps gate)bun run lintgreen (Biome via Ultracite)API surface
detectLocale,parseDate, andparseDateRangeauto-detection for loaded CJK packs whenlocaleis omitted)Knowledge layer
[Unreleased]plans/backlog.md