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

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

Issue 12733003: Adds facilities for extracting Intl.message calls and generating code from translations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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
Index: pkg/intl/lib/message_lookup_local.dart
diff --git a/pkg/intl/lib/message_lookup_local.dart b/pkg/intl/lib/message_lookup_local.dart
index e8a0e97ebb09ba3df15a9ebc00fe9ca01a726416..cea67a257649e32d11db5854c3cf6f77a96ce62a 100644
--- a/pkg/intl/lib/message_lookup_local.dart
+++ b/pkg/intl/lib/message_lookup_local.dart
@@ -89,13 +89,13 @@ class MessageLookupLocal {
* will be extracted automatically but for the time being it must be passed
* explicitly in the [name] and [args] arguments.
*/
- Future<String> lookupMessage(String message_str, [final String desc='',
+ String lookupMessage(String message_str, [final String desc='',
final Map examples=const {}, String locale,
String name, List<String> args]) {
- if (name == null) return new Future.immediate(message_str);
+ if (name == null) return message_str;
// The translations also make use of Intl.message, so we need to not
// recurse and just stop when we find the first substitution.
- if (_lookupInProgress) return new Future.immediate(message_str);
+ if (_lookupInProgress) return message_str;
_lookupInProgress = true;
var result;
try {
@@ -110,14 +110,14 @@ class MessageLookupLocal {
LibraryMirror messagesForThisLocale =
_libraries['$_sourcePrefix$verifiedLocale'];
if (messagesForThisLocale == null) {
- return new Future.immediate(message_str);
+ return message_str;
}
MethodMirror localized = messagesForThisLocale.functions[name];
- if (localized == null) return new Future.immediate(message_str);
+ if (localized == null) return message_str;
result = messagesForThisLocale.invoke(localized.simpleName, args);
} finally {
_lookupInProgress = false;
}
- return result.then((value) => value.reflectee);
+ return deprecatedFutureValue(result).reflectee;
Emily Fortuna 2013/03/13 18:54:43 what's the plan for getting rid of this call? Need
Alan Knight 2013/03/14 17:49:05 Oops. This whole file should have been deleted. me
}
}

Powered by Google App Engine
This is Rietveld 408576698