Repository navigation
pitis/perch#18: Task dates beyond English: numeric dates, Romanian, and other languages via Apple Intelligence - #28
Merged
Conversation
…ames Numeric dates such as 12/25, 25/12 or 25.12.2026 are parsed using the locale's short date format for the day/month order and separator. Screen recordings are recognised by the name macOS gives them in the user's language, read from screencaptureui's own strings.
…ntelligence Romanian dates and times are rewritten into the English phrases the parser already reads, so titles keep their own words. Diacritics are optional. For other languages, the on-device model rewrites the date in English after the task is added, and the parser does the date maths. The Settings snapshot is taller so the Apple Intelligence section shows.
Owner
Author
The model's title is only taken when it's the task's own words with some removed, and only for languages the parser can't read; it now reads the cleaned title instead of the raw text, and a finished task is left alone. A bare dotted pair such as 26.1 or 2.5 is no longer a date unless it ends in a dot, has a year, or follows on or by. Romanian words no longer match capitalised names (Maine, LA, Joi), luni after a quantity, la before a number and a noun, or the adjective anual, and a rewrite the parser doesn't use is undone. Dates that don't exist aren't stored, 7.30pm reads like 7:30pm, model failures are logged, and the Settings footer says what the model really does.
Owner
Author
ReviewRan Fixed
Declined
Known limits, updated
|
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.


Refs #18
Task dates are no longer English-only. This covers all three checkboxes of the ticket. Your answer on the ticket was "all languages, Romanian included", and that settled the first one.
What changed
Romanian, built into the parser (
NLParser.fromRomanian)SystemLanguageModel.supportedLanguages), and neither doesNSDataDetector. The composer preview shows Romanian dates as you type.Every other language, through Apple Intelligence (
AutoClassifier,Workspace.applySchedule)Numeric dates in the Mac's date order, and recordings in any language (first commit, unchanged): 12/25 vs 25.12 follows the locale's short date format. Recordings are matched by the name macOS gives them in your language, read from
screencaptureui's own strings.Snapshot.swift: the Settings snapshot is 1400pt tall instead of 1100, because the Apple Intelligence section was cut off.How it was tested
make check: 44 tests pass. New tests:testRomanian(25 phrases, including inputs that must stay plain titles),testNumericDatesFollowTheLocalesOrder, andtestAnotherReadingOfThePhraseSchedulesIt(applies a German reading, keeps the day for a deadline, an edit made meanwhile wins, no date and a made-up date both change nothing).SystemLanguageModel.default.availabilityismodelNotReady, so I couldn't see what it actually returns for German or French text. The code around it is tested with fixed readings.Refs, notCloses./pr-review-toolkit:review-prand/ponytail:ponytail-reviewwere run. The fixes are in the review comment below.Known limits
1/2 cupreads as January 2. In a locale that writes dates with dots, a bare25.12needs its closing dot or a year, orpe/on/bybefore it. Lowercasemainereads as tomorrow. "2 mai multe" reads "mai" as May. A first name like "Marti" reads as Tuesday.2026/12/25) aren't parsed.