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

Unified Diff: README.md

Issue 832073002: Make withLocale use a zone (Closed) Base URL: https://github.com/dart-lang/intl.git@master
Patch Set: Mention that defaultLocale is superceded by withLocale Created 5 years, 12 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 | « CHANGELOG.md ('k') | lib/intl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: README.md
diff --git a/README.md b/README.md
index 18951c750a0f0193d350509557b6b0a5decbc602..860fb10e7c07b4acc92a715d29baabd24f3d753e 100644
--- a/README.md
+++ b/README.md
@@ -17,22 +17,28 @@ internationalization mechanisms. This library also defines the
The package has a single current locale, called [defaultLocale][defaultLocale].
Operations will use that locale unless told to do otherwise.
-To set the global locale, you can explicitly set it, e.g.
+You can explicitly set the global locale
Intl.defaultLocale = 'pt_BR';
-or get it from the browser by
+or get it from the browser
import "package:intl/intl_browser.dart";
...
findSystemLocale().then(runTheRestOfMyProgram);
-To temporarily override the current locale, pass the operation
-to [withLocale][withLocale].
+To override the current locale for a particular operation, pass the operation
+to [withLocale][withLocale]. Note that this includes async tasks
+spawned from that operation, and that the argument to
+[withLocale][withLocale]
+will supercede the [defaultLocale][defaultLocale] while the operation
+is active. If you are using different locales within an application,
+the [withLocale][withLocale] operation may be preferable to setting
+[defaultLocale][defaultLocale].
Intl.withLocale('fr', () => print(myLocalizedMessage());
-To override it for a very specific operation you can create a format object in
+To specify the locale for an operation you can create a format object in
a specific locale, or pass in the locale as a parameter to methods.
var format = new DateFormat.yMd("ar");
« no previous file with comments | « CHANGELOG.md ('k') | lib/intl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698