l10n.dart 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. // GENERATED CODE - DO NOT MODIFY BY HAND
  2. import 'package:flutter/material.dart';
  3. import 'package:intl/intl.dart';
  4. import 'intl/messages_all.dart';
  5. // **************************************************************************
  6. // Generator: Flutter Intl IDE plugin
  7. // Made by Localizely
  8. // **************************************************************************
  9. // ignore_for_file: non_constant_identifier_names, lines_longer_than_80_chars
  10. // ignore_for_file: join_return_with_assignment, prefer_final_in_for_each
  11. // ignore_for_file: avoid_redundant_argument_values
  12. class S {
  13. S();
  14. static S current;
  15. static const AppLocalizationDelegate delegate =
  16. AppLocalizationDelegate();
  17. static Future<S> load(Locale locale) {
  18. final name = (locale.countryCode?.isEmpty ?? false) ? locale.languageCode : locale.toString();
  19. final localeName = Intl.canonicalizedLocale(name);
  20. return initializeMessages(localeName).then((_) {
  21. Intl.defaultLocale = localeName;
  22. S.current = S();
  23. return S.current;
  24. });
  25. }
  26. static S of(BuildContext context) {
  27. return Localizations.of<S>(context, S);
  28. }
  29. /// `2048`
  30. String get titleName {
  31. return Intl.message(
  32. '2048',
  33. name: 'titleName',
  34. desc: '',
  35. args: [],
  36. );
  37. }
  38. /// `Confirm`
  39. String get pageHomeConfirm {
  40. return Intl.message(
  41. 'Confirm',
  42. name: 'pageHomeConfirm',
  43. desc: '',
  44. args: [],
  45. );
  46. }
  47. /// `Welcome {name}`
  48. String pageHomeWelcome(Object name) {
  49. return Intl.message(
  50. 'Welcome $name',
  51. name: 'pageHomeWelcome',
  52. desc: '',
  53. args: [name],
  54. );
  55. }
  56. }
  57. class AppLocalizationDelegate extends LocalizationsDelegate<S> {
  58. const AppLocalizationDelegate();
  59. List<Locale> get supportedLocales {
  60. return const <Locale>[
  61. Locale.fromSubtags(languageCode: 'en'),
  62. Locale.fromSubtags(languageCode: 'zh'),
  63. ];
  64. }
  65. @override
  66. bool isSupported(Locale locale) => _isSupported(locale);
  67. @override
  68. Future<S> load(Locale locale) => S.load(locale);
  69. @override
  70. bool shouldReload(AppLocalizationDelegate old) => false;
  71. bool _isSupported(Locale locale) {
  72. if (locale != null) {
  73. for (var supportedLocale in supportedLocales) {
  74. if (supportedLocale.languageCode == locale.languageCode) {
  75. return true;
  76. }
  77. }
  78. }
  79. return false;
  80. }
  81. }