| OLD | NEW |
| 1 Intl | 1 Intl |
| 2 ==== | 2 ==== |
| 3 | 3 |
| 4 This package provides internationalization and localization facilities, | 4 This package provides internationalization and localization facilities, |
| 5 including message translation, plurals and genders, date/number formatting | 5 including message translation, plurals and genders, date/number formatting |
| 6 and parsing, and bidirectional text. | 6 and parsing, and bidirectional text. |
| 7 | 7 |
| 8 ## General | 8 ## General |
| 9 The most important library is [intl][intl_lib]. It defines the [Intl][Intl] | 9 The most important library is [intl][intl_lib]. It defines the [Intl][Intl] |
| 10 class, with the default locale and methods for accessing most of the | 10 class, with the default locale and methods for accessing most of the |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 remainingEmailsMessage(int howMany, String userName) => | 116 remainingEmailsMessage(int howMany, String userName) => |
| 117 Intl.message( | 117 Intl.message( |
| 118 "${Intl.plural(howMany, | 118 "${Intl.plural(howMany, |
| 119 zero: 'There are no emails left for $userName.', | 119 zero: 'There are no emails left for $userName.', |
| 120 one: 'There is one email left for $userName.', | 120 one: 'There is one email left for $userName.', |
| 121 other: 'There are $howMany emails left for $userName.')}", | 121 other: 'There are $howMany emails left for $userName.')}", |
| 122 name: "remainingEmailsMessage", | 122 name: "remainingEmailsMessage", |
| 123 args: [howMany, userName], | 123 args: [howMany, userName], |
| 124 desc: "How many emails remain after archiving.", | 124 desc: "How many emails remain after archiving.", |
| 125 examples: {'number': 42, 'userName': 'Fred'}); | 125 examples: {'howMany': 42, 'userName': 'Fred'}); |
| 126 | 126 |
| 127 print(remainingEmailsMessage(1, "Fred")); | 127 print(remainingEmailsMessage(1, "Fred")); |
| 128 | 128 |
| 129 However, since the typical usage for a plural or gender is for it to | 129 However, since the typical usage for a plural or gender is for it to |
| 130 be at the top-level, we can also omit the [Intl.message][Intl.message] call and | 130 be at the top-level, we can also omit the [Intl.message][Intl.message] call and |
| 131 provide its parameters to the [Intl.plural][Intl.plural] call instead. | 131 provide its parameters to the [Intl.plural][Intl.plural] call instead. |
| 132 | 132 |
| 133 remainingEmailsMessage(int howMany, String userName) => | 133 remainingEmailsMessage(int howMany, String userName) => |
| 134 Intl.plural( | 134 Intl.plural( |
| 135 howMany, | 135 howMany, |
| 136 zero: 'There are no emails left for $userName.', | 136 zero: 'There are no emails left for $userName.', |
| 137 one: 'There is one email left for $userName.', | 137 one: 'There is one email left for $userName.', |
| 138 other: 'There are $howMany emails left for $userName.'), | 138 other: 'There are $howMany emails left for $userName.'), |
| 139 name: "remainingEmailsMessage", | 139 name: "remainingEmailsMessage", |
| 140 args: [howMany, userName], | 140 args: [howMany, userName], |
| 141 desc: "How many emails remain after archiving.", | 141 desc: "How many emails remain after archiving.", |
| 142 examples: {'number': 42, 'userName': 'Fred'}); | 142 examples: {'howMany': 42, 'userName': 'Fred'}); |
| 143 | 143 |
| 144 Similarly, there is an [Intl.gender][Intl.gender] message, and plurals | 144 Similarly, there is an [Intl.gender][Intl.gender] message, and plurals |
| 145 and genders can be nested. | 145 and genders can be nested. |
| 146 | 146 |
| 147 notOnlineMessage(String userName, String userGender) => | 147 notOnlineMessage(String userName, String userGender) => |
| 148 Intl.gender( | 148 Intl.gender( |
| 149 userGender, | 149 userGender, |
| 150 male: '$userName is unavailable because he is not online.', | 150 male: '$userName is unavailable because he is not online.', |
| 151 female: '$userName is unavailable because she is not online.', | 151 female: '$userName is unavailable because she is not online.', |
| 152 other: '$userName is unavailable because they are not online'), | 152 other: '$userName is unavailable because they are not online'), |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 [NumberFormat]: https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/
intl/intl.NumberFormat | 297 [NumberFormat]: https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/
intl/intl.NumberFormat |
| 298 [withLocale]: https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/in
tl/intl.Intl#id_withLocale | 298 [withLocale]: https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/in
tl/intl.Intl#id_withLocale |
| 299 [defaultLocale]: https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer
/intl/intl.Intl#id_defaultLocale | 299 [defaultLocale]: https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer
/intl/intl.Intl#id_defaultLocale |
| 300 [Intl.message]: https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/
intl/intl.Intl#id_message | 300 [Intl.message]: https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/
intl/intl.Intl#id_message |
| 301 [Intl.plural]: https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/i
ntl/intl.Intl#id_plural | 301 [Intl.plural]: https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/i
ntl/intl.Intl#id_plural |
| 302 [Intl.gender]: https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/i
ntl/intl.Intl#id_gender | 302 [Intl.gender]: https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/i
ntl/intl.Intl#id_gender |
| 303 [DateTime]: https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart
:core.DateTime | 303 [DateTime]: https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart
:core.DateTime |
| 304 [BidiFormatter]: https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer
/intl/intl.BidiFormatter | 304 [BidiFormatter]: https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer
/intl/intl.BidiFormatter |
| 305 [BidiFormatter.RTL]: https://api.dartlang.org/apidocs/channels/stable/dartdoc-vi
ewer/intl/intl.BidiFormatter#id_BidiFormatter-RTL | 305 [BidiFormatter.RTL]: https://api.dartlang.org/apidocs/channels/stable/dartdoc-vi
ewer/intl/intl.BidiFormatter#id_BidiFormatter-RTL |
| 306 [BidiFormatter.LTR]: https://api.dartlang.org/apidocs/channels/stable/dartdoc-vi
ewer/intl/intl.BidiFormatter#id_BidiFormatter-LTR | 306 [BidiFormatter.LTR]: https://api.dartlang.org/apidocs/channels/stable/dartdoc-vi
ewer/intl/intl.BidiFormatter#id_BidiFormatter-LTR |
| OLD | NEW |