-
Notifications
You must be signed in to change notification settings - Fork 28.7k
import pkg:intl when DateFormat or NumberFormat is used #83122
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
Conversation
) | ||
..loadResources() | ||
..writeOutputFiles(BufferLogger.test()); | ||
} on Exception catch (e) { |
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.
similar question here, shouldn't this fail if already if an exception is thrown?
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.
I'll remove it, was just copying from the other test cases.
) | ||
..loadResources() | ||
..writeOutputFiles(BufferLogger.test()); | ||
} on Exception catch (e) { |
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.
and here
@@ -1168,7 +1168,7 @@ class LocalizationsGenerator { | |||
.replaceAll('\n\n\n', '\n\n'); | |||
} | |||
|
|||
bool _containsPluralMessage() => _allMessages.any((Message message) => message.isPlural); | |||
bool _requiresIntlImport() => _allMessages.any((Message message) => message.isPlural || message.placeholdersRequireFormatting); |
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.
is the plan to keep adding onto this or is there a comprehensive list of intl type usage?
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.
As far as I can tell, it's a case by case decision whether a feature needs intl or not. If we add more features, this list would grow.
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.
LGTM with nit + question
* [flutter_tools] throw a tool exit if pub cannot be run (#83293) * Re-add the removed MediaQuery.removePadding of PopupMenuButton (#82986) * import pkg:intl when DateFormat or NumberFormat is used (#83122) Co-authored-by: Jonah Williams <[email protected]> Co-authored-by: xubaolin <[email protected]> Co-authored-by: Michael Goderbauer <[email protected]>
Fixes #82713.