app/lib/generated/intl/messages_all.dart

76 lines
2.5 KiB
Dart
Raw Normal View History

2024-03-14 21:49:21 +08: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:flutter/foundation.dart';
import 'package:intl/intl.dart';
import 'package:intl/message_lookup_by_library.dart';
import 'package:intl/src/intl_helpers.dart';
import 'messages_en.dart' as messages_en;
2024-03-17 19:33:34 +08:00
import 'messages_ja.dart' as messages_ja;
2024-03-14 21:49:21 +08:00
import 'messages_zh_CN.dart' as messages_zh_cn;
2024-03-16 19:15:30 +08:00
import 'messages_zh_TW.dart' as messages_zh_tw;
2024-03-14 21:49:21 +08:00
typedef Future<dynamic> LibraryLoader();
Map<String, LibraryLoader> _deferredLibraries = {
'en': () => new SynchronousFuture(null),
2024-03-17 19:33:34 +08:00
'ja': () => new SynchronousFuture(null),
2024-03-14 21:49:21 +08:00
'zh_CN': () => new SynchronousFuture(null),
2024-03-16 19:15:30 +08:00
'zh_TW': () => new SynchronousFuture(null),
2024-03-14 21:49:21 +08:00
};
MessageLookupByLibrary? _findExact(String localeName) {
switch (localeName) {
case 'en':
return messages_en.messages;
2024-03-17 19:33:34 +08:00
case 'ja':
return messages_ja.messages;
2024-03-14 21:49:21 +08:00
case 'zh_CN':
return messages_zh_cn.messages;
2024-03-16 19:15:30 +08:00
case 'zh_TW':
return messages_zh_tw.messages;
2024-03-14 21:49:21 +08:00
default:
return null;
}
}
/// User programs should call this before using [localeName] for messages.
Future<bool> initializeMessages(String localeName) {
var availableLocale = Intl.verifiedLocale(
localeName, (locale) => _deferredLibraries[locale] != null,
onFailure: (_) => null);
if (availableLocale == null) {
return new SynchronousFuture(false);
}
var lib = _deferredLibraries[availableLocale];
lib == null ? new SynchronousFuture(false) : lib();
initializeInternalMessageLookup(() => new CompositeMessageLookup());
messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor);
return new SynchronousFuture(true);
}
bool _messagesExistFor(String locale) {
try {
return _findExact(locale) != null;
} catch (e) {
return false;
}
}
MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) {
var actualLocale =
Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null);
if (actualLocale == null) return null;
return _findExact(actualLocale);
}