l10n.dart 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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, avoid_escaping_inner_quotes
  12. class S {
  13. S();
  14. static S? _current;
  15. static S get current {
  16. assert(_current != null,
  17. 'No instance of S was loaded. Try to initialize the S delegate before accessing S.current.');
  18. return _current!;
  19. }
  20. static const AppLocalizationDelegate delegate = AppLocalizationDelegate();
  21. static Future<S> load(Locale locale) {
  22. final name = (locale.countryCode?.isEmpty ?? false)
  23. ? locale.languageCode
  24. : locale.toString();
  25. final localeName = Intl.canonicalizedLocale(name);
  26. return initializeMessages(localeName).then((_) {
  27. Intl.defaultLocale = localeName;
  28. final instance = S();
  29. S._current = instance;
  30. return instance;
  31. });
  32. }
  33. static S of(BuildContext context) {
  34. final instance = S.maybeOf(context);
  35. assert(instance != null,
  36. 'No instance of S present in the widget tree. Did you add S.delegate in localizationsDelegates?');
  37. return instance!;
  38. }
  39. static S? maybeOf(BuildContext context) {
  40. return Localizations.of<S>(context, S);
  41. }
  42. /// `PAUSE/RESUME`
  43. String get pause_resume {
  44. return Intl.message(
  45. 'PAUSE/RESUME',
  46. name: 'pause_resume',
  47. desc: '',
  48. args: [],
  49. );
  50. }
  51. /// `RESET`
  52. String get reset {
  53. return Intl.message(
  54. 'RESET',
  55. name: 'reset',
  56. desc: '',
  57. args: [],
  58. );
  59. }
  60. /// `SOUNDS`
  61. String get sounds {
  62. return Intl.message(
  63. 'SOUNDS',
  64. name: 'sounds',
  65. desc: '',
  66. args: [],
  67. );
  68. }
  69. /// `Points`
  70. String get points {
  71. return Intl.message(
  72. 'Points',
  73. name: 'points',
  74. desc: '',
  75. args: [],
  76. );
  77. }
  78. /// `Cleans`
  79. String get cleans {
  80. return Intl.message(
  81. 'Cleans',
  82. name: 'cleans',
  83. desc: '',
  84. args: [],
  85. );
  86. }
  87. /// `Level`
  88. String get level {
  89. return Intl.message(
  90. 'Level',
  91. name: 'level',
  92. desc: '',
  93. args: [],
  94. );
  95. }
  96. /// `Next`
  97. String get next {
  98. return Intl.message(
  99. 'Next',
  100. name: 'next',
  101. desc: '',
  102. args: [],
  103. );
  104. }
  105. /// `Reward`
  106. String get reward {
  107. return Intl.message(
  108. 'Reward',
  109. name: 'reward',
  110. desc: '',
  111. args: [],
  112. );
  113. }
  114. }
  115. class AppLocalizationDelegate extends LocalizationsDelegate<S> {
  116. const AppLocalizationDelegate();
  117. List<Locale> get supportedLocales {
  118. return const <Locale>[
  119. Locale.fromSubtags(languageCode: 'en'),
  120. Locale.fromSubtags(languageCode: 'zh', countryCode: 'CN'),
  121. ];
  122. }
  123. @override
  124. bool isSupported(Locale locale) => _isSupported(locale);
  125. @override
  126. Future<S> load(Locale locale) => S.load(locale);
  127. @override
  128. bool shouldReload(AppLocalizationDelegate old) => false;
  129. bool _isSupported(Locale locale) {
  130. for (var supportedLocale in supportedLocales) {
  131. if (supportedLocale.languageCode == locale.languageCode) {
  132. return true;
  133. }
  134. }
  135. return false;
  136. }
  137. }