-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: auto-detect device language for transcription during onboarding #4404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Required fixes before merge:
Please grab another reviewer to approve. by AI for @beastoin |
When user hasn't set a primary language, automatically detect their device language and set it as the transcription language instead of showing a selection dialog. This provides a smoother onboarding experience. - Added _getDeviceLanguageCode() to detect device locale and match against available transcription languages - Modified setupUserPrimaryLanguage() to auto-set device language - Falls back to dialog only if auto-detection fails or language unsupported Fixes #4323 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
9a5245b to
e5b8823
Compare
|
@beastoin Auto-detecting the primary transcription language from the device locale matches the available language map and the animation repaint reductions look safe; I found no blocking issues and by AI for @beastoin |
beastoin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Required fixes before merge:
Please grab another reviewer to approve. by AI for @beastoin |
|
@beastoin Reviewed app/lib/providers/home_provider.dart:161-239; auto-detect locale mapping and fallback behavior look correct, and Please grab another reviewer to approve. by AI for @beastoin |
|
@beastoin Reviewed Please grab another reviewer to approve. by AI for @beastoin |
|
@beastoin The auto-detect logic has three blockers: Can you update those and add the tests? by AI for @beastoin |
|
@beastoin app/lib/providers/home_provider.dart:1 and :166-168 introduce Can you update those and re-request review? by AI for @beastoin |
- Replace dart:io Platform.localeName with PlatformDispatcher.instance.locale for cross-platform compatibility (including Flutter web) - Fix locale parsing to split on both '-' and '_' for hyphenated locales like en-US and zh-Hant-TW - Extract static getDeviceLanguageCodeFromLocale() for testability - Add comprehensive unit tests covering exact match, base match, and fallback scenarios Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Done. Addressed all three issues:
Ready for final review. 🤖 Generated with Claude Code |
beastoin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@beastoin The PlatformDispatcher-based locale detection and hyphen/underscore parsing look correct, and the static helper plus tests cover exact/base matching and fallbacks; I ran app/test.sh and flutter test test/providers/home_provider_test.dart locally, and I can’t approve my own PR due to GitHub restrictions.
Can you grab another reviewer to approve if CI is green?
by AI for @beastoin
|
Required fixes before merge:
Please merge when ready; I can't approve my own PR. by AI for @beastoin |
|
Required fixes before merge:
Please merge when ready. by AI for @beastoin |
Fixes #4323
Auto-detects the device language and sets it as the default transcription language during onboarding, eliminating the need for manual language selection. The app language is already auto-detected by
LocaleProvider, so this change completes the feature by also auto-setting the transcription language.Changes:
_getDeviceLanguageCode(): Detects device locale (e.g.,en_US) and matches against available transcription languagessetupUserPrimaryLanguage(): Auto-sets device language instead of showing dialog; falls back to dialog only if detection failsby AI for @beastoin