Skip to content

fix(resume-import): parse non-English month names and ongoing markers - #143

Open
Dwarf1er wants to merge 1 commit into
Gsync:devfrom
Dwarf1er:fix/multilingual-import-dates
Open

Dwarf1er wants to merge 1 commit into
Gsync:devfrom
Dwarf1er:fix/multilingual-import-dates

Conversation

@Dwarf1er

Copy link
Copy Markdown

Summary

parseImportDate only understood English month names and the word "Present". For a non-English resume,
"janvier 2020" fails to parse and the start date silently becomes 2000-01-01, and "Présent" or
"actuel" is not recognised as ongoing. This makes date parsing locale-independent.

Changes

  • New src/actions/resumeImport/dates.ts: month names for about 20 locales are built from Intl (long
    and short forms, accents folded) rather than hand-written lists. Names that mean different months in
    different locales are dropped as ambiguous.
  • Also handles YYYY-MM, YYYY/MM, CJK year-month (2020年3月) and filler words (enero de 2020).
  • Multilingual ongoing markers ("Présent", "actuel", "en cours", "Heute", "Actualidad", "現在", ...).
  • parseImportDate in shared.ts uses the new helpers; existing formats (Jan 2020, 2020,
    MM/YYYY) behave as before.
  • Resume import prompt: copy text values in their original language and never translate; map "ongoing"
    in any language to "Present".
  • New __tests__/resumeImportDates.spec.ts (27 cases).

Related Issues

Testing

  • npm run lint and tsc --noEmit are clean.
  • New spec: 27 passing. The rest of the suite is unchanged: 193 tests fail identically on a clean dev
    in my environment (jsdom/localStorage setup), unrelated to this change.
  • Not covered: the Intl month list depends on the runtime's ICU data, which is full in the Docker
    image's Node 20.

Notes

Independent of the language-output PR; either can merge first.

parseImportDate only understood English month names and "Present", so
"janvier 2020" failed to parse and fell back to 2000-01-01, and "Présent"
or "actuel" were not recognised as ongoing. Build month names for ~20
locales from Intl instead of a hand-written list, and add YYYY-MM, CJK
year-month and multilingual ongoing markers.

Tell the import prompt not to translate text values and to map "ongoing"
in any language to "Present".

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant