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

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

Issue 10535087: Changes to the i18n messages so that they are invoked as (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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/intl_message_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 * Useage example: 15 * Usage examples:
16 * msg(num_people, place) => new IntlMessage( 16 * today(date) => intl.message(
17 '''I see ${intl.plural(num_people, 17 * "Today's date is $date",
18 * desc: 'Indicate the current date',
19 * examples: {'date' : 'June 8, 2012'});
20 * print(today(new Date.now());
21 *
22 * msg(num_people, place) => intl.message(
23 * '''I see ${Intl.plural(num_people,
18 * {'0': 'no one at all', 24 * {'0': 'no one at all',
19 * '1': 'one other person', 25 * '1': 'one other person',
20 * 'other': '$num_people other people'})} in $place.'''', 26 * 'other': '$num_people other people'})} in $place.'''',
21 * desc: 'Description of how many people are seen as program start.', 27 * desc: 'Description of how many people are seen as program start.',
22 * examples: {'num_people': 3, 'place': 'London'}); 28 * examples: {'num_people': 3, 'place': 'London'});
23 * 29 *
24 * Calling `msg({'num_people': 2, 'place': 'Athens'});` would 30 * Calling `msg({'num_people': 2, 'place': 'Athens'});` would
25 * produce "I see 2 other people in Athens." as output. 31 * produce "I see 2 other people in Athens." as output.
26 * <!-- TODO(efortuna): documentation example involving the offset parameter. 32 * <!-- TODO(efortuna): documentation example involving the offset parameter.
27 * --> 33 * -->
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 * concatenation. 71 * concatenation.
66 */ 72 */
67 IntlMessage(this._message, [final String desc='', final Map examples=const {}, 73 IntlMessage(this._message, [final String desc='', final Map examples=const {},
68 final String locale='']) { 74 final String locale='']) {
69 this._messageDescription = desc; 75 this._messageDescription = desc;
70 this._messageExamples = examples; 76 this._messageExamples = examples;
71 this._languageCode = locale; 77 this._languageCode = locale;
72 } 78 }
73 79
74 } 80 }
OLDNEW
« no previous file with comments | « lib/i18n/intl.dart ('k') | tests/lib/i18n/intl_message_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698