mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-28 13:02:21 +01:00
| Filename | Latest commit message | Latest commit date |
|---|---|---|
TestFlight build 56 testers saw translation stop "after a while" with no sign of why
(a Chinese tester: "翻译功能突然没办法用了,一开始可以"; another lost the Hex key menu's
Paste in Hindi / Paste in English pair and had to re-enable translation in Settings).
Every failure path in DictationTranslator returned nil, so the transcript went in as
spoken with nothing said: no language pack (never downloaded, removed in iOS Settings,
or still downloading), a pair Apple can't translate, a TranslationSession whose
translate() threw (internalError, as when Apple's Translate app is missing), and
build 56's "Paste in <source>" choice, which left pastesTranslation false while
Settings' switch still read on.
What changed:
- DictationTranslator.translate returns a TranslationOutcome (skipped, translated, or
failed with a TranslationFailure: notDownloaded, unsupported, failed, plus Apple's
error code, never the text). A failed translate() is tried once more in a new
TranslationSession; a missing pack or unsupported pair isn't retried. Sessions are
never kept. Apple's framework sits behind TranslationEngine so tests stand in for it.
- The failure rides DictationPipeline.Stages, KeyboardSnapshot (optional, old snapshots
still decode) and in-keyboard dictation's finished phase. When the keyboard inserts
such a dictation, both keyboards show "Couldn't translate, pasted as spoken" over the
fix ("Download Chinese in Settings") for 8 s: the full keyboard's strip in the Full
Access hint's shape with Open Hex, the dictation bar as a tappable two-line note.
Both open hex-dictation://keyboard/translation (KeyboardLaunchRequest.translationSettings),
which opens Settings › Dictation. VoiceOver announces it.
- Settings keeps the last failure (experiments.translateDictation.lastFailure) until a
dictation translates, checks status for the pair that failed, refreshes it on
foreground (packs can be removed meanwhile), and its Download button invalidates a
repeated TranslationSession.Configuration, which translationTask otherwise never
runs again after a cancelled download.
- One switch: removed the pastesTranslation setting, Settings' "Paste in English"
toggle and KeyboardViewModel.pastesTranslation/isTranslating's paste half. A stored
pastesTranslation=false from build 56 reads as off in Settings and the keyboard alike,
and the next switch removes it, so the two never disagree again.
- zh-Hans strings for the new copy.
Verified: xcodebuild test on an iPhone 17 simulator (iOS 27.2), 515 tests, 0 failures,
new cases in HexKeyGestureTests (missing pack zh->en and en->zh, unsupported pair,
retry in a new session, 30 dictations with intermittent failures never sticking,
build 56's stored "as spoken", the pipeline both ways, the strip's note) and
KeyboardBridgeTests (snapshot round trip and old JSON, the launch URL). Screenshots of
both keyboards' notes in English and Chinese. The simulator reports Apple translation
unsupported on the device, so real downloads and sessions need an iPhone.
|
||
| .. | ||
| Emoji | ||
| AccentPicker.swift | ||
| AdaptiveTouch.swift | ||
| AdaptiveTouchLabels.swift | ||
| AutocorrectEngine+Dictionaries.swift | ||
| AutocorrectEngine.swift | ||
| DeleteWordSwipe.swift | ||
| FullKeyboardEngine+SwipeTyping.swift | ||
| FullKeyboardEngine.swift | ||
| FullKeyboardPalette.swift | ||
| FullKeyboardSettings.swift | ||
| FullKeyboardView+Emoji.swift | ||
| FullKeyboardView.swift | ||
| GermanCapitals.swift | ||
| HexKeyGesture.swift | ||
| HexKeyViews.swift | ||
| KeyboardBackdropView.swift | ||
| KeyboardClipboard.swift | ||
| KeyboardKeyPlaneView.swift | ||
| KeyboardLanguage.swift | ||
| KeyboardLayout.swift | ||
| KeyboardStripView.swift | ||
| never-suggest.tsv | ||
| OffensiveWords.swift | ||
| ShiftStateMachine.swift | ||
| SwipeDecoder.swift | ||
| SwipeTyping.swift | ||
| TextChecking.swift | ||
| TypingDecoder.swift | ||
| TypingJournal.swift | ||
| TypingJournalLearning.swift | ||