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

Side by Side Diff: lib/i18n/intl_message.dart

Issue 10700013: revert 9192,9194 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « lib/i18n/intl.dart ('k') | tests/lib/i18n/bidi_format_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Message/plural format library with locale support. 6 * Message/plural format library with locale support.
7 * 7 *
8 * 8 *
9 * _message example: 9 * _message example:
10 * '''I see ${Intl.plural(num_people, 10 * '''I see ${Intl.plural(num_people,
11 * {'0': 'no one at all', 11 * {'0': 'no one at all',
12 * '1': 'one other person', 12 * '1': 'one other person',
13 * 'other': '$num_people other people'})} in $place.'''' 13 * 'other': '$num_people other people'})} in $place.''''
14 * 14 *
15 * Usage examples: 15 * Usage examples:
16 * today(date) => intl.message( 16 * today(date) => intl.message(
17 * "Today's date is $date", 17 * "Today's date is $date",
18 * desc: 'Indicate the current date', 18 * desc: 'Indicate the current date',
19 * examples: {'date' : 'June 8, 2012'}); 19 * examples: {'date' : 'June 8, 2012'});
20 * print(today(new Date.now()); 20 * print(today(new Date.now());
21 * 21 *
22 * msg(num_people, place) => intl.message( 22 * msg(num_people, place) => intl.message(
23 * '''I see ${Intl.plural(num_people, 23 * '''I see ${Intl.plural(num_people,
24 * {'0': 'no one at all', 24 * {'0': 'no one at all',
25 * '1': 'one other person', 25 * '1': 'one other person',
26 * 'other': '$num_people other people'})} in $place.'''', 26 * 'other': '$num_people other people'})} in $place.'''',
27 * desc: 'Description of how many people are seen as program start.', 27 * desc: 'Description of how many people are seen as program start.',
28 * examples: {'num_people': 3, 'place': 'London'}); 28 * examples: {'num_people': 3, 'place': 'London'});
29 * 29 *
30 * Calling `msg({'num_people': 2, 'place': 'Athens'});` would 30 * Calling `msg({'num_people': 2, 'place': 'Athens'});` would
31 * produce "I see 2 other people in Athens." as output. 31 * produce "I see 2 other people in Athens." as output.
32 * <!-- TODO(efortuna): documentation example involving the offset parameter.
33 * -->
32 * 34 *
33 * See tests/message_format_test.dart for more examples. 35 * See tests/message_format_test.dart for more examples.
34 */ 36 */
35 //TODO(efortuna): documentation example involving the offset parameter? 37
38 #library('intl_message');
36 39
37 class IntlMessage { 40 class IntlMessage {
38 41
39 /** String describing the use case for this message. */ 42 /** String describing the use case for this message. */
40 String _messageDescription; 43 String _messageDescription;
41 44
42 /** 45 /**
43 * String that contains the message to be displayed. It may contain 46 * String that contains the message to be displayed. It may contain
44 * placeholders in the form of string interpolated items (ie 'hello$foo') that 47 * placeholders in the form of string interpolated items (ie 'hello$foo') that
45 * will be substituted in to complete the message. 48 * will be substituted in to complete the message.
(...skipping 21 matching lines...) Expand all
67 * simple Strings available at compile time: no String interpolation or 70 * simple Strings available at compile time: no String interpolation or
68 * concatenation. 71 * concatenation.
69 */ 72 */
70 IntlMessage(this._message, [final String desc='', final Map examples=const {}, 73 IntlMessage(this._message, [final String desc='', final Map examples=const {},
71 final String locale='']) { 74 final String locale='']) {
72 this._messageDescription = desc; 75 this._messageDescription = desc;
73 this._messageExamples = examples; 76 this._messageExamples = examples;
74 this._languageCode = locale; 77 this._languageCode = locale;
75 } 78 }
76 } 79 }
OLDNEW
« no previous file with comments | « lib/i18n/intl.dart ('k') | tests/lib/i18n/bidi_format_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698