-
-
Notifications
You must be signed in to change notification settings - Fork 243
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
Reported language doesn't always match reality #1410
Comments
It's not specified if it should be the device's language or the screen's language, maybe we need both. |
I agree, that sounds reasonable. |
One way for us to retrieve the locale would be to use a // somewhere in the SDK
GlobalKey<NavigatorState> sentryNavigatorKey = GlobalKey<NavigatorState>();
// your app
MaterialApp(
navigatorKey: sentryNavigatorKey,
//...
) Then somwhere in the SDK we can do final context = sentryNavigatorKey.currentContext;
final screenLocale = Localizations.localeOf(context);
// ... add it to context @ueman what do you think? any concerns with this approach? |
No concerns on my side, but that kinda goes against the design philosophy of the SDKs of a very simple configuration. Not sure though if that's a blocker or concern for you. |
Indeed, ideally adding a navigatorKey shouldn't be needed but I'm not sure if there are other ways to retrieve the |
Unfortunately, I also don't see any way of doing that. |
We already use a global key to extract the current context for the |
I think that's too high in the widget tree to get the localization, but it's actually a good hint |
Just tested it for confirmation and it seems so, it would be too high in the tree. |
Platform
Flutter Mobile
Obfuscation
Disabled
Debug Info
Disabled
Doctor
Unrelated to the Dart/Flutter version
Version
7.5.0
Steps to Reproduce
Expected Result
I would expect the language to be the one set in the MaterialApp.
Actual Result
Device language is reported.
Are you willing to submit a PR?
None
The text was updated successfully, but these errors were encountered: