Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Unified Diff: pkg/intl/lib/intl.dart

Issue 11091012: Clean up TODOs and comments in Intl (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/intl/lib/date_format.dart ('k') | pkg/intl/lib/message_lookup_local.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/intl/lib/intl.dart
===================================================================
--- pkg/intl/lib/intl.dart (revision 13364)
+++ pkg/intl/lib/intl.dart (working copy)
@@ -27,6 +27,40 @@
#source('bidi_formatter.dart');
#source('bidi_utils.dart');
+/**
+ * The Intl class provides a common entry point for internationalization
+ * related tasks. An Intl instance can be created for a particular locale
+ * and used to create a date format via `anIntl.date()`. Static methods
+ * on this class are also used in message formatting.
+ *
+ * Message example:
+ * '''I see ${Intl.plural(num_people,
+ * {'0': 'no one at all',
+ * '1': 'one other person',
+ * 'other': '$num_people other people'})} in $place.''''
+ *
+ * Usage examples:
+ * today(date) => intl.message(
+ * "Today's date is $date",
+ * desc: 'Indicate the current date',
+ * examples: {'date' : 'June 8, 2012'});
+ * print(today(new Date.now());
+ *
+ * msg(num_people, place) => intl.message(
+ * '''I see ${Intl.plural(num_people,
+ * {'0': 'no one at all',
+ * '1': 'one other person',
+ * 'other': '$num_people other people'})} in $place.'''',
+ * desc: 'Description of how many people are seen as program start.',
+ * examples: {'num_people': 3, 'place': 'London'});
+ *
+ * Calling `msg({'num_people': 2, 'place': 'Athens'});` would
+ * produce "I see 2 other people in Athens." as output.
+ *
+ * See `tests/message_format_test.dart` for more examples.
+ */
+ //TODO(efortuna): documentation example involving the offset parameter?
+
class Intl {
/**
* String indicating the locale code with which the message is to be
@@ -46,8 +80,6 @@
* this is not automatically set, and must be set by importing one of
* intl_browser.dart or intl_standalone.dart and calling findSystemLocale().
*/
- // TODO(alanknight): Detect this without forcing the jump through hoops.
- // Issue 5171.
static String systemLocale = 'en_US';
/**
« no previous file with comments | « pkg/intl/lib/date_format.dart ('k') | pkg/intl/lib/message_lookup_local.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698