forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Locale.fromSubtags and support for scriptCode. (flutter#6518)
* Add Locale.fromComponents. * Change toString from underscores to dashes. Expand the unit tests. * Rename 'fromComponents' to 'create'. Change variants from String to List<String>. * Use default for language parameter. Use hashCode/hashList. * Have toString() stick with old (underscore) behaviour. * Demonstrate empty-list bug in assert code. * Fix empty-list assert bug. * Add ignores for lint issues. Unsure about 71340 though. * Fix operator== via _listEquals. * Remove length-checking asserts: we're anyway not checking characters in fields. * Documentation update. * Change reasoning for ignore:prefer_initializing_formals. * Try 'fromSubtags' as new constructor name. * Documentation improvements based on Pull Request review. * Assert-fail for invalid-length subtags and drop bad subtags in production code. * Revert "Assert-fail for invalid-length subtags and drop bad subtags in production code." This reverts commit d6f06f5. * Re-fix Locale.toString() for variants=[]. * Tear out variants, in case we want to have one fewer pointer in the future. * Make named parameters' names consistent with member names. * Also remove _listEquals: no longer in use. * Lint fix. * Fix code review nits. * Lint fix for assert, and a couple more not-zero-length-string asserts. * Code Review: two of three nits addressed... * Review fix: change 'should' to 'must' for subtag prescriptions. * Assert-check that countryCode is never ''.
- Loading branch information
Showing
2 changed files
with
121 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters