-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
io.Platform.localeName is "null" (the string) on iOS simulator #24747
Comments
@GaryQian can you have a look? |
#24481 looks like it is supposed to fix this. Is this normal? This from above
vs from my local setup
where a 5 days old |
@SteveAlexander it looks like you're not synced to the latest master. |
|
Thanks! doctor is now reporting that you're on the latest revision, so now, on that revision, do you still see this bug? |
Some of our internal customers are observing this bug too. I think we should fix it asap. |
yes, I'm still seeing that |
We recently changed the locale system to have a preferred locale of null before it receives information from the OS (before, we always said 'en_US', which is misleading). It is seems that the code in io.Platform is not passing the locale through the locale resolution stack (which should sanitize the null), therefore leaving it null for a brief period before the OS has a chance to pass the locale to flutter/dart. |
I think returning |
Return a Future, as the real locale will show up eventually? |
A future may not work here, as there is no guarantee that the locale will ever show up. There are platforms where there are no locales at all. On Flutter-side, I can return null instead of calling toString on the null locale. Then, hand it off to dart io.Platform, which will resolve it to the _localeName() call (see platform_impl.dart). At that point, the dart fallback system should be able to handle it. |
A
So if we were to use a
Having said that we already have onLocaleChanged and I think it would be great if we found a way to reuse that mechanism. Adding another Future-based mechanism if fraught with complexity and race conditions. |
In any case, I think from flutter's perspective, we do not directly control the In terms of the scope of this bug, I believe making sure |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
On today's master, I'm seeing
io.Platform.localeName
is"null"
— that is, the string "null" excluding the quotes.Time machine is still broken with this, as it (reasonably, I think) expects it to be a valid locale string
xx_YY
or an actualnull
.See also #23241
See also Dana-Ferguson/time_machine#10
The text was updated successfully, but these errors were encountered: