l10n.dart 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. /// `2048`
  43. String get titleName {
  44. return Intl.message(
  45. '2048',
  46. name: 'titleName',
  47. desc: '',
  48. args: [],
  49. );
  50. }
  51. /// `Play 2048 Game flutter`
  52. String get titleWelcome {
  53. return Intl.message(
  54. 'Play 2048 Game flutter',
  55. name: 'titleWelcome',
  56. desc: '',
  57. args: [],
  58. );
  59. }
  60. /// `Join and get to the 2048 tile!`
  61. String get titleWelDesc {
  62. return Intl.message(
  63. 'Join and get to the 2048 tile!',
  64. name: 'titleWelDesc',
  65. desc: '',
  66. args: [],
  67. );
  68. }
  69. /// `BEST`
  70. String get labelBest {
  71. return Intl.message(
  72. 'BEST',
  73. name: 'labelBest',
  74. desc: '',
  75. args: [],
  76. );
  77. }
  78. /// `SCORE`
  79. String get labelScore {
  80. return Intl.message(
  81. 'SCORE',
  82. name: 'labelScore',
  83. desc: '',
  84. args: [],
  85. );
  86. }
  87. /// `New Game`
  88. String get btnNewGame {
  89. return Intl.message(
  90. 'New Game',
  91. name: 'btnNewGame',
  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'),
  103. ];
  104. }
  105. @override
  106. bool isSupported(Locale locale) => _isSupported(locale);
  107. @override
  108. Future<S> load(Locale locale) => S.load(locale);
  109. @override
  110. bool shouldReload(AppLocalizationDelegate old) => false;
  111. bool _isSupported(Locale locale) {
  112. for (var supportedLocale in supportedLocales) {
  113. if (supportedLocale.languageCode == locale.languageCode) {
  114. return true;
  115. }
  116. }
  117. return false;
  118. }
  119. }