Remove the Intl example, which is out of date and should be a separate package anyway.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=148589402
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f00fd7c..78462d1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,7 @@
* Allow passing enums to a select.
* Remove the cacheBlocker parameter from HttpRequestDataReader
* Optimize padding numbers when printing
+ * Remove the out of date example directory
## 0.14.0
* MAJOR BREAKING CHANGE! Remove message extraction and code generation into a
diff --git a/example/basic/basic_example.dart b/example/basic/basic_example.dart
deleted file mode 100644
index b0f5c07..0000000
--- a/example/basic/basic_example.dart
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/// This provides a basic example of internationalization usage. It uses the
-/// local variant of all the facilities, meaning that libraries with the
-/// data for all the locales are directly imported by the program. Once lazy
-/// loading is available, we expect this to be the preferred mode, with
-/// the initialization code actually loading the specific libraries needed.
-///
-/// This defines messages for an English locale directly in the program and
-/// has separate libraries that define German and Thai messages that say more or
-/// less the same thing, and prints the message with the date and time in it
-/// formatted appropriately for the locale.
-
-library intl_basic_example;
-
-import 'dart:async';
-import 'package:intl/date_symbol_data_local.dart';
-import 'package:intl/intl.dart';
-import 'messages_all.dart';
-
-/// In order to use this both as an example and as a test case, we pass in
-/// the function for what we're going to do with the output. For a simple
-/// example we just pass in [print] and for tests we pass in a function that
-/// adds it a list to be verified.
-Function doThisWithTheOutput;
-typedef ThenList(List l);
-
-void setup(ThenList program, Function output) {
- // Before we use any messages or use date formatting for a locale we must
- // call their initialization messages, which are asynchronous, since they
- // might be reading information from files or over the web. Since we are
- // running here in local mode they will all complete immediately.
- doThisWithTheOutput = output;
- var germanDatesFuture = initializeDateFormatting('de_DE', null);
- var thaiDatesFuture = initializeDateFormatting('th_TH', null);
- var germanMessagesFuture = initializeMessages('de_DE');
- var thaiMessagesFuture = initializeMessages('th_TH');
- Future.wait/*<Future>*/(<Future>[
- germanDatesFuture,
- thaiDatesFuture,
- germanMessagesFuture,
- thaiMessagesFuture
- ]).then(program);
-}
-
-// Because the initialization messages return futures we split out the main
-// part of our program into a separate function that runs once all the
-// futures have completed. We are passed the collection of futures, but we
-// don't need to use them, so ignore the parameter.
-runProgram(List _) {
- var aDate = new DateTime.fromMillisecondsSinceEpoch(0, isUtc: true);
- var de = new Intl('de_DE');
- var th = new Intl('th_TH');
- // This defines a message that can be internationalized. It is written as a
- // function that returns the result of an Intl.message call. The primary
- // parameter is a string that may use interpolation.
- runAt(time, date) =>
- Intl.message('Ran at $time on $date', name: 'runAt', args: [time, date]);
- printForLocale(aDate, new Intl(), runAt);
- printForLocale(aDate, de, runAt);
- printForLocale(aDate, th, runAt);
- // Example making use of the return value from withLocale;
- var returnValue = Intl.withLocale(th.locale, () => runAt('now', 'today'));
- doThisWithTheOutput(returnValue);
-}
-
-printForLocale(aDate, intl, operation) {
- var hmsFormat = intl.date().add_Hms();
- var dayFormat = intl.date().add_yMMMMEEEEd();
- var time = hmsFormat.format(aDate);
- var day = dayFormat.format(aDate);
- Intl.withLocale(intl.locale, () => doThisWithTheOutput(operation(time, day)));
-}
diff --git a/example/basic/basic_example_runner.dart b/example/basic/basic_example_runner.dart
deleted file mode 100644
index 2c67c7b..0000000
--- a/example/basic/basic_example_runner.dart
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/// This is just a shell that runs the code in basic_example.dart, leaving
-/// that as a library that can also be run by tests.
-
-import 'basic_example.dart';
-
-main() {
- setup(runProgram, print);
-}
diff --git a/example/basic/messages_all.dart b/example/basic/messages_all.dart
deleted file mode 100644
index a2fb844..0000000
--- a/example/basic/messages_all.dart
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/// This imports all of the different message libraries and provides an
-/// [initializeMessages] function that sets up the lookup for a particular
-/// library.
-library messages_all;
-
-import 'dart:async';
-import 'package:intl/message_lookup_by_library.dart';
-import 'package:intl/src/intl_helpers.dart';
-import 'messages_th_th.dart' as th_TH;
-import 'messages_de.dart' as de;
-import 'package:intl/intl.dart';
-
-// TODO(alanknight): Use lazy loading of the requested library.
-MessageLookupByLibrary _findExact(localeName) {
- switch (localeName) {
- case 'th_TH':
- return th_TH.messages;
- case 'de':
- return de.messages;
- default:
- return null;
- }
-}
-
-initializeMessages(localeName) {
- initializeInternalMessageLookup(() => new CompositeMessageLookup());
- messageLookup.addLocale(localeName, _findGeneratedMessagesFor);
- return new Future.value();
-}
-
-MessageLookupByLibrary _findGeneratedMessagesFor(locale) {
- var actualLocale = Intl.verifiedLocale(locale, (x) => _findExact(x) != null,
- onFailure: (_) => null);
- if (actualLocale == null) return null;
- return _findExact(actualLocale);
-}
diff --git a/example/basic/messages_de.dart b/example/basic/messages_de.dart
deleted file mode 100644
index ce80108..0000000
--- a/example/basic/messages_de.dart
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/// This is a library that provides messages for a German locale. All the
-/// messages from the main program should be duplicated here with the same
-/// function name.
-library messages_de;
-
-import 'package:intl/intl.dart';
-import 'package:intl/message_lookup_by_library.dart';
-
-final messages = new MessageLookup();
-
-class MessageLookup extends MessageLookupByLibrary {
- get localeName => 'de';
-
- final messages = {
- "runAt": (time, day) => Intl.message("Ausgedruckt am $time am $day.")
- };
-}
diff --git a/example/basic/messages_th_th.dart b/example/basic/messages_th_th.dart
deleted file mode 100644
index c478981..0000000
--- a/example/basic/messages_th_th.dart
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/// This is a library that provides messages for a German locale. All the
-/// messages from the main program should be duplicated here with the same
-/// function name.
-library messages_th_TH;
-
-import 'package:intl/intl.dart';
-import 'package:intl/message_lookup_by_library.dart';
-
-final messages = new MessageLookup();
-
-class MessageLookup extends MessageLookupByLibrary {
- get localeName => 'th_TH';
-
- final messages = {
- "runAt": (time, day) => Intl.message('วิ่ง $time on $day.')
- };
-}
diff --git a/test/intl_message_basic_example_test.dart b/test/intl_message_basic_example_test.dart
deleted file mode 100644
index a873b23..0000000
--- a/test/intl_message_basic_example_test.dart
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/// Tests internationalization of messages using the basic example as a
-/// template.
-library intl_message_test_2;
-
-import '../example/basic/basic_example.dart';
-import 'package:unittest/unittest.dart';
-import 'dart:async';
-
-main() {
- var list = [];
- var waitForIt = new Completer();
-
- addToList(x) {
- list.add(x);
- if (list.length == 4) {
- waitForIt.complete(list);
- }
- }
-
- test('Verify basic example printing localized messages', () {
- runAllTests(_) {
- setup(expectAsync(runProgram) as ThenList, addToList);
- }
- setup(expectAsync(runAllTests) as ThenList, addToList);
- waitForIt.future.then(expectAsync((_) {
- expect(list[0], "Ran at 00:00:00 on Thursday, January 1, 1970");
- expect(list[1], "Ausgedruckt am 00:00:00 am Donnerstag, 1. Januar 1970.");
- expect(list[2], "วิ่ง 00:00:00 on วันพฤหัสบดีที่ 1 มกราคม ค.ศ. 1970.");
- expect(list[3], "วิ่ง now on today.");
- }));
- });
-}