l10n.dart 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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. /// `Payment`
  43. String get payment {
  44. return Intl.message(
  45. 'Payment',
  46. name: 'payment',
  47. desc: '',
  48. args: [],
  49. );
  50. }
  51. /// `Rewards`
  52. String get rewards {
  53. return Intl.message(
  54. 'Rewards',
  55. name: 'rewards',
  56. desc: '',
  57. args: [],
  58. );
  59. }
  60. /// `Notification`
  61. String get notification {
  62. return Intl.message(
  63. 'Notification',
  64. name: 'notification',
  65. desc: '',
  66. args: [],
  67. );
  68. }
  69. /// `Facility`
  70. String get facility {
  71. return Intl.message(
  72. 'Facility',
  73. name: 'facility',
  74. desc: '',
  75. args: [],
  76. );
  77. }
  78. /// `Form`
  79. String get form {
  80. return Intl.message(
  81. 'Form',
  82. name: 'form',
  83. desc: '',
  84. args: [],
  85. );
  86. }
  87. /// `Notice Board`
  88. String get notice_board {
  89. return Intl.message(
  90. 'Notice Board',
  91. name: 'notice_board',
  92. desc: '',
  93. args: [],
  94. );
  95. }
  96. }
  97. class AppLocalizationDelegate extends LocalizationsDelegate<S> {
  98. const AppLocalizationDelegate();
  99. List<Locale> get supportedLocales {
  100. return const <Locale>[
  101. Locale.fromSubtags(languageCode: 'en'),
  102. Locale.fromSubtags(languageCode: 'zh', countryCode: 'CN'),
  103. Locale.fromSubtags(languageCode: 'zh', countryCode: 'HK'),
  104. ];
  105. }
  106. @override
  107. bool isSupported(Locale locale) => _isSupported(locale);
  108. @override
  109. Future<S> load(Locale locale) => S.load(locale);
  110. @override
  111. bool shouldReload(AppLocalizationDelegate old) => false;
  112. bool _isSupported(Locale locale) {
  113. for (var supportedLocale in supportedLocales) {
  114. if (supportedLocale.languageCode == locale.languageCode) {
  115. return true;
  116. }
  117. }
  118. return false;
  119. }
  120. }