2020-01-20 08:50:49 +00:00
|
|
|
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
|
|
|
|
// This is a library that looks up messages for specific locales by
|
|
|
|
// delegating to the appropriate library.
|
|
|
|
|
|
|
|
// Ignore issues from commonly used lints in this file.
|
|
|
|
// ignore_for_file:implementation_imports, file_names, unnecessary_new
|
|
|
|
// ignore_for_file:unnecessary_brace_in_string_interps, directives_ordering
|
|
|
|
// ignore_for_file:argument_type_not_assignable, invalid_assignment
|
|
|
|
// ignore_for_file:prefer_single_quotes, prefer_generic_function_type_aliases
|
|
|
|
// ignore_for_file:comment_references
|
|
|
|
|
|
|
|
import 'dart:async';
|
|
|
|
|
|
|
|
import 'package:intl/intl.dart';
|
|
|
|
import 'package:intl/message_lookup_by_library.dart';
|
|
|
|
import 'package:intl/src/intl_helpers.dart';
|
|
|
|
|
2020-06-26 08:13:48 +00:00
|
|
|
import 'messages_cs.dart' as messages_cs;
|
2020-05-09 09:49:17 +00:00
|
|
|
import 'messages_de.dart' as messages_de;
|
2020-06-26 08:13:48 +00:00
|
|
|
import 'messages_es.dart' as messages_es;
|
2020-05-17 08:18:31 +00:00
|
|
|
import 'messages_fr.dart' as messages_fr;
|
2020-05-09 05:19:29 +00:00
|
|
|
import 'messages_hu.dart' as messages_hu;
|
2020-05-09 09:49:17 +00:00
|
|
|
import 'messages_messages.dart' as messages_messages;
|
2020-05-09 13:29:31 +00:00
|
|
|
import 'messages_pl.dart' as messages_pl;
|
2020-06-26 08:13:48 +00:00
|
|
|
import 'messages_sk.dart' as messages_sk;
|
2020-01-20 08:50:49 +00:00
|
|
|
|
|
|
|
typedef Future<dynamic> LibraryLoader();
|
|
|
|
Map<String, LibraryLoader> _deferredLibraries = {
|
2020-06-26 08:13:48 +00:00
|
|
|
'cs': () => new Future.value(null),
|
2020-05-09 09:49:17 +00:00
|
|
|
'de': () => new Future.value(null),
|
2020-06-26 08:13:48 +00:00
|
|
|
'es': () => new Future.value(null),
|
2020-05-17 08:18:31 +00:00
|
|
|
'fr': () => new Future.value(null),
|
2020-05-09 05:19:29 +00:00
|
|
|
'hu': () => new Future.value(null),
|
2020-05-09 09:49:17 +00:00
|
|
|
'messages': () => new Future.value(null),
|
2020-05-09 13:29:31 +00:00
|
|
|
'pl': () => new Future.value(null),
|
2020-06-26 08:13:48 +00:00
|
|
|
'sk': () => new Future.value(null),
|
2020-01-20 08:50:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
MessageLookupByLibrary _findExact(String localeName) {
|
|
|
|
switch (localeName) {
|
2020-06-26 08:13:48 +00:00
|
|
|
case 'cs':
|
|
|
|
return messages_cs.messages;
|
2020-05-09 09:49:17 +00:00
|
|
|
case 'de':
|
|
|
|
return messages_de.messages;
|
2020-06-26 08:13:48 +00:00
|
|
|
case 'es':
|
|
|
|
return messages_es.messages;
|
2020-05-17 08:18:31 +00:00
|
|
|
case 'fr':
|
|
|
|
return messages_fr.messages;
|
2020-05-09 05:19:29 +00:00
|
|
|
case 'hu':
|
|
|
|
return messages_hu.messages;
|
2020-05-09 09:49:17 +00:00
|
|
|
case 'messages':
|
|
|
|
return messages_messages.messages;
|
2020-05-09 13:29:31 +00:00
|
|
|
case 'pl':
|
|
|
|
return messages_pl.messages;
|
2020-06-26 08:13:48 +00:00
|
|
|
case 'sk':
|
|
|
|
return messages_sk.messages;
|
2020-01-20 08:50:49 +00:00
|
|
|
default:
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// User programs should call this before using [localeName] for messages.
|
|
|
|
Future<bool> initializeMessages(String localeName) async {
|
|
|
|
var availableLocale = Intl.verifiedLocale(
|
2020-05-22 10:21:16 +00:00
|
|
|
localeName, (locale) => _deferredLibraries[locale] != null,
|
|
|
|
onFailure: (_) => null);
|
2020-01-20 08:50:49 +00:00
|
|
|
if (availableLocale == null) {
|
|
|
|
return new Future.value(false);
|
|
|
|
}
|
|
|
|
var lib = _deferredLibraries[availableLocale];
|
|
|
|
await (lib == null ? new Future.value(false) : lib());
|
|
|
|
initializeInternalMessageLookup(() => new CompositeMessageLookup());
|
|
|
|
messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor);
|
|
|
|
return new Future.value(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool _messagesExistFor(String locale) {
|
|
|
|
try {
|
|
|
|
return _findExact(locale) != null;
|
|
|
|
} catch (e) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MessageLookupByLibrary _findGeneratedMessagesFor(String locale) {
|
2020-05-22 10:21:16 +00:00
|
|
|
var actualLocale =
|
|
|
|
Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null);
|
2020-01-20 08:50:49 +00:00
|
|
|
if (actualLocale == null) return null;
|
|
|
|
return _findExact(actualLocale);
|
|
|
|
}
|