import 'dart:async';

import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:intl/intl.dart' as intl;

import 'app_localizations_de.dart';
import 'app_localizations_en.dart';

// ignore_for_file: type=lint

/// Callers can lookup localized strings with an instance of AppLocalizations
/// returned by `AppLocalizations.of(context)`.
///
/// Applications need to include `AppLocalizations.delegate()` in their app's
/// `localizationDelegates` list, and the locales they support in the app's
/// `supportedLocales` list. For example:
///
/// ```dart
/// import 'generated/app_localizations.dart';
///
/// return MaterialApp(
///   localizationsDelegates: AppLocalizations.localizationsDelegates,
///   supportedLocales: AppLocalizations.supportedLocales,
///   home: MyApplicationHome(),
/// );
/// ```
///
/// ## Update pubspec.yaml
///
/// Please make sure to update your pubspec.yaml to include the following
/// packages:
///
/// ```yaml
/// dependencies:
///   # Internationalization support.
///   flutter_localizations:
///     sdk: flutter
///   intl: any # Use the pinned version from flutter_localizations
///
///   # Rest of dependencies
/// ```
///
/// ## iOS Applications
///
/// iOS applications define key application metadata, including supported
/// locales, in an Info.plist file that is built into the application bundle.
/// To configure the locales supported by your app, you’ll need to edit this
/// file.
///
/// First, open your project’s ios/Runner.xcworkspace Xcode workspace file.
/// Then, in the Project Navigator, open the Info.plist file under the Runner
/// project’s Runner folder.
///
/// Next, select the Information Property List item, select Add Item from the
/// Editor menu, then select Localizations from the pop-up menu.
///
/// Select and expand the newly-created Localizations item then, for each
/// locale your application supports, add a new item and select the locale
/// you wish to add from the pop-up menu in the Value field. This list should
/// be consistent with the languages listed in the AppLocalizations.supportedLocales
/// property.
abstract class AppLocalizations {
  AppLocalizations(String locale)
    : localeName = intl.Intl.canonicalizedLocale(locale.toString());

  final String localeName;

  static AppLocalizations of(BuildContext context) {
    return Localizations.of<AppLocalizations>(context, AppLocalizations)!;
  }

  static const LocalizationsDelegate<AppLocalizations> delegate =
      _AppLocalizationsDelegate();

  /// A list of this localizations delegate along with the default localizations
  /// delegates.
  ///
  /// Returns a list of localizations delegates containing this delegate along with
  /// GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate,
  /// and GlobalWidgetsLocalizations.delegate.
  ///
  /// Additional delegates can be added by appending to this list in
  /// MaterialApp. This list does not have to be used at all if a custom list
  /// of delegates is preferred or required.
  static const List<LocalizationsDelegate<dynamic>> localizationsDelegates =
      <LocalizationsDelegate<dynamic>>[
        delegate,
        GlobalMaterialLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
      ];

  /// A list of this localizations delegate's supported locales.
  static const List<Locale> supportedLocales = <Locale>[
    Locale('de'),
    Locale('en'),
  ];

  /// No description provided for @add_team.
  ///
  /// In en, this message translates to:
  /// **'Add Team'**
  String get add_team;

  /// No description provided for @all_players.
  ///
  /// In en, this message translates to:
  /// **'All players'**
  String get all_players;

  /// No description provided for @all_players_selected.
  ///
  /// In en, this message translates to:
  /// **'All players selected'**
  String get all_players_selected;

  /// No description provided for @amount_of_matches.
  ///
  /// In en, this message translates to:
  /// **'Amount of Matches'**
  String get amount_of_matches;

  /// No description provided for @app_name.
  ///
  /// In en, this message translates to:
  /// **'Tallee'**
  String get app_name;

  /// No description provided for @best_player.
  ///
  /// In en, this message translates to:
  /// **'Best Player'**
  String get best_player;

  /// No description provided for @cancel.
  ///
  /// In en, this message translates to:
  /// **'Cancel'**
  String get cancel;

  /// No description provided for @choose_color.
  ///
  /// In en, this message translates to:
  /// **'Choose Color'**
  String get choose_color;

  /// No description provided for @choose_game.
  ///
  /// In en, this message translates to:
  /// **'Choose Game'**
  String get choose_game;

  /// No description provided for @choose_group.
  ///
  /// In en, this message translates to:
  /// **'Choose Group'**
  String get choose_group;

  /// No description provided for @choose_ruleset.
  ///
  /// In en, this message translates to:
  /// **'Choose Ruleset'**
  String get choose_ruleset;

  /// No description provided for @color.
  ///
  /// In en, this message translates to:
  /// **'Color'**
  String get color;

  /// No description provided for @color_blue.
  ///
  /// In en, this message translates to:
  /// **'Blue'**
  String get color_blue;

  /// No description provided for @color_green.
  ///
  /// In en, this message translates to:
  /// **'Green'**
  String get color_green;

  /// No description provided for @color_orange.
  ///
  /// In en, this message translates to:
  /// **'Orange'**
  String get color_orange;

  /// No description provided for @color_pink.
  ///
  /// In en, this message translates to:
  /// **'Pink'**
  String get color_pink;

  /// No description provided for @color_purple.
  ///
  /// In en, this message translates to:
  /// **'Purple'**
  String get color_purple;

  /// No description provided for @color_red.
  ///
  /// In en, this message translates to:
  /// **'Red'**
  String get color_red;

  /// No description provided for @color_teal.
  ///
  /// In en, this message translates to:
  /// **'Teal'**
  String get color_teal;

  /// No description provided for @color_yellow.
  ///
  /// In en, this message translates to:
  /// **'Yellow'**
  String get color_yellow;

  /// No description provided for @could_not_add_player.
  ///
  /// In en, this message translates to:
  /// **'Could not add player'**
  String could_not_add_player(Object playerName);

  /// No description provided for @create_game.
  ///
  /// In en, this message translates to:
  /// **'Create Game'**
  String get create_game;

  /// No description provided for @create_group.
  ///
  /// In en, this message translates to:
  /// **'Create Group'**
  String get create_group;

  /// No description provided for @create_match.
  ///
  /// In en, this message translates to:
  /// **'Create match'**
  String get create_match;

  /// No description provided for @create_new_group.
  ///
  /// In en, this message translates to:
  /// **'Create new group'**
  String get create_new_group;

  /// No description provided for @create_new_match.
  ///
  /// In en, this message translates to:
  /// **'Create new match'**
  String get create_new_match;

  /// No description provided for @create_teams.
  ///
  /// In en, this message translates to:
  /// **'Create teams'**
  String get create_teams;

  /// No description provided for @created_on.
  ///
  /// In en, this message translates to:
  /// **'Created on'**
  String get created_on;

  /// No description provided for @data.
  ///
  /// In en, this message translates to:
  /// **'Data'**
  String get data;

  /// No description provided for @data_successfully_deleted.
  ///
  /// In en, this message translates to:
  /// **'Data successfully deleted'**
  String get data_successfully_deleted;

  /// No description provided for @data_successfully_exported.
  ///
  /// In en, this message translates to:
  /// **'Data successfully exported'**
  String get data_successfully_exported;

  /// No description provided for @data_successfully_imported.
  ///
  /// In en, this message translates to:
  /// **'Data successfully imported'**
  String get data_successfully_imported;

  /// No description provided for @days_ago.
  ///
  /// In en, this message translates to:
  /// **'{count} days ago'**
  String days_ago(Object count);

  /// No description provided for @delete.
  ///
  /// In en, this message translates to:
  /// **'Delete'**
  String get delete;

  /// No description provided for @delete_all_data.
  ///
  /// In en, this message translates to:
  /// **'Delete all data'**
  String get delete_all_data;

  /// No description provided for @delete_game.
  ///
  /// In en, this message translates to:
  /// **'Delete Game'**
  String get delete_game;

  /// No description provided for @delete_game_with_matches_warning.
  ///
  /// In en, this message translates to:
  /// **'If you delete this game template, {count, plural, =1{1 match} other{{count} matches}} using this game template will also be deleted.'**
  String delete_game_with_matches_warning(int count);

  /// No description provided for @delete_group.
  ///
  /// In en, this message translates to:
  /// **'Delete Group'**
  String get delete_group;

  /// No description provided for @delete_match.
  ///
  /// In en, this message translates to:
  /// **'Delete Match'**
  String get delete_match;

  /// No description provided for @description.
  ///
  /// In en, this message translates to:
  /// **'Description'**
  String get description;

  /// No description provided for @drag_to_set_placement.
  ///
  /// In en, this message translates to:
  /// **'Drag to set placement'**
  String get drag_to_set_placement;

  /// No description provided for @edit_game.
  ///
  /// In en, this message translates to:
  /// **'Edit Game'**
  String get edit_game;

  /// No description provided for @edit_group.
  ///
  /// In en, this message translates to:
  /// **'Edit Group'**
  String get edit_group;

  /// No description provided for @edit_match.
  ///
  /// In en, this message translates to:
  /// **'Edit Match'**
  String get edit_match;

  /// No description provided for @enter_points.
  ///
  /// In en, this message translates to:
  /// **'Enter points'**
  String get enter_points;

  /// No description provided for @enter_results.
  ///
  /// In en, this message translates to:
  /// **'Enter Results'**
  String get enter_results;

  /// No description provided for @error_creating_group.
  ///
  /// In en, this message translates to:
  /// **'Error while creating group, please try again'**
  String get error_creating_group;

  /// No description provided for @error_deleting_game.
  ///
  /// In en, this message translates to:
  /// **'Error while deleting game, please try again'**
  String get error_deleting_game;

  /// No description provided for @error_deleting_group.
  ///
  /// In en, this message translates to:
  /// **'Error while deleting group, please try again'**
  String get error_deleting_group;

  /// No description provided for @error_editing_group.
  ///
  /// In en, this message translates to:
  /// **'Error while editing group, please try again'**
  String get error_editing_group;

  /// No description provided for @error_reading_file.
  ///
  /// In en, this message translates to:
  /// **'Error reading file'**
  String get error_reading_file;

  /// No description provided for @exit_view.
  ///
  /// In en, this message translates to:
  /// **'Exit View'**
  String get exit_view;

  /// No description provided for @export_canceled.
  ///
  /// In en, this message translates to:
  /// **'Export canceled'**
  String get export_canceled;

  /// No description provided for @export_data.
  ///
  /// In en, this message translates to:
  /// **'Export data'**
  String get export_data;

  /// No description provided for @format_exception.
  ///
  /// In en, this message translates to:
  /// **'Format Exception (see console)'**
  String get format_exception;

  /// No description provided for @game.
  ///
  /// In en, this message translates to:
  /// **'Game'**
  String get game;

  /// No description provided for @game_name.
  ///
  /// In en, this message translates to:
  /// **'Game Name'**
  String get game_name;

  /// No description provided for @group.
  ///
  /// In en, this message translates to:
  /// **'Group'**
  String get group;

  /// No description provided for @group_name.
  ///
  /// In en, this message translates to:
  /// **'Group name'**
  String get group_name;

  /// No description provided for @group_profile.
  ///
  /// In en, this message translates to:
  /// **'Group Profile'**
  String get group_profile;

  /// No description provided for @groups.
  ///
  /// In en, this message translates to:
  /// **'Groups'**
  String get groups;

  /// No description provided for @highest_score.
  ///
  /// In en, this message translates to:
  /// **'Highest Score'**
  String get highest_score;

  /// No description provided for @home.
  ///
  /// In en, this message translates to:
  /// **'Home'**
  String get home;

  /// No description provided for @import_canceled.
  ///
  /// In en, this message translates to:
  /// **'Import canceled'**
  String get import_canceled;

  /// No description provided for @import_data.
  ///
  /// In en, this message translates to:
  /// **'Import data'**
  String get import_data;

  /// No description provided for @info.
  ///
  /// In en, this message translates to:
  /// **'Info'**
  String get info;

  /// No description provided for @invalid_schema.
  ///
  /// In en, this message translates to:
  /// **'Invalid Schema'**
  String get invalid_schema;

  /// No description provided for @least_points.
  ///
  /// In en, this message translates to:
  /// **'Least Points'**
  String get least_points;

  /// No description provided for @legal.
  ///
  /// In en, this message translates to:
  /// **'Legal'**
  String get legal;

  /// No description provided for @legal_notice.
  ///
  /// In en, this message translates to:
  /// **'Legal Notice'**
  String get legal_notice;

  /// No description provided for @licenses.
  ///
  /// In en, this message translates to:
  /// **'Licenses'**
  String get licenses;

  /// No description provided for @live_edit_mode.
  ///
  /// In en, this message translates to:
  /// **'Live Edit Mode'**
  String get live_edit_mode;

  /// No description provided for @loser.
  ///
  /// In en, this message translates to:
  /// **'Loser'**
  String get loser;

  /// No description provided for @lowest_score.
  ///
  /// In en, this message translates to:
  /// **'Lowest Score'**
  String get lowest_score;

  /// No description provided for @manage_members.
  ///
  /// In en, this message translates to:
  /// **'Manage Members'**
  String get manage_members;

  /// No description provided for @match_in_progress.
  ///
  /// In en, this message translates to:
  /// **'Match in progress...'**
  String get match_in_progress;

  /// No description provided for @match_name.
  ///
  /// In en, this message translates to:
  /// **'Match name'**
  String get match_name;

  /// No description provided for @match_profile.
  ///
  /// In en, this message translates to:
  /// **'Match Profile'**
  String get match_profile;

  /// No description provided for @matches.
  ///
  /// In en, this message translates to:
  /// **'Matches'**
  String get matches;

  /// No description provided for @member.
  ///
  /// In en, this message translates to:
  /// **'Member'**
  String get member;

  /// No description provided for @members.
  ///
  /// In en, this message translates to:
  /// **'Members'**
  String get members;

  /// No description provided for @most_points.
  ///
  /// In en, this message translates to:
  /// **'Most Points'**
  String get most_points;

  /// No description provided for @multiple_winners.
  ///
  /// In en, this message translates to:
  /// **'Multiple Winners'**
  String get multiple_winners;

  /// No description provided for @no_data_available.
  ///
  /// In en, this message translates to:
  /// **'No data available'**
  String get no_data_available;

  /// No description provided for @no_games_created_yet.
  ///
  /// In en, this message translates to:
  /// **'No games created yet'**
  String get no_games_created_yet;

  /// No description provided for @no_groups_created_yet.
  ///
  /// In en, this message translates to:
  /// **'No groups created yet'**
  String get no_groups_created_yet;

  /// No description provided for @no_license_text_available.
  ///
  /// In en, this message translates to:
  /// **'No license text available'**
  String get no_license_text_available;

  /// No description provided for @no_licenses_found.
  ///
  /// In en, this message translates to:
  /// **'No licenses found'**
  String get no_licenses_found;

  /// No description provided for @no_matches_created_yet.
  ///
  /// In en, this message translates to:
  /// **'No matches created yet'**
  String get no_matches_created_yet;

  /// No description provided for @no_players_created_yet.
  ///
  /// In en, this message translates to:
  /// **'No players created yet'**
  String get no_players_created_yet;

  /// No description provided for @no_players_found_with_that_name.
  ///
  /// In en, this message translates to:
  /// **'No players found with that name'**
  String get no_players_found_with_that_name;

  /// No description provided for @no_players_selected.
  ///
  /// In en, this message translates to:
  /// **'No players selected'**
  String get no_players_selected;

  /// No description provided for @no_recent_matches_available.
  ///
  /// In en, this message translates to:
  /// **'No recent matches available'**
  String get no_recent_matches_available;

  /// No description provided for @no_results_entered_yet.
  ///
  /// In en, this message translates to:
  /// **'No results entered yet'**
  String get no_results_entered_yet;

  /// No description provided for @no_second_match_available.
  ///
  /// In en, this message translates to:
  /// **'No second match available'**
  String get no_second_match_available;

  /// No description provided for @no_statistics_available.
  ///
  /// In en, this message translates to:
  /// **'No statistics available'**
  String get no_statistics_available;

  /// No description provided for @none.
  ///
  /// In en, this message translates to:
  /// **'None'**
  String get none;

  /// No description provided for @none_group.
  ///
  /// In en, this message translates to:
  /// **'None'**
  String get none_group;

  /// No description provided for @not_available.
  ///
  /// In en, this message translates to:
  /// **'Not available'**
  String get not_available;

  /// No description provided for @place.
  ///
  /// In en, this message translates to:
  /// **'place'**
  String get place;

  /// No description provided for @placement.
  ///
  /// In en, this message translates to:
  /// **'Placement'**
  String get placement;

  /// No description provided for @played_matches.
  ///
  /// In en, this message translates to:
  /// **'Played Matches'**
  String get played_matches;

  /// No description provided for @player_name.
  ///
  /// In en, this message translates to:
  /// **'Player name'**
  String get player_name;

  /// No description provided for @players.
  ///
  /// In en, this message translates to:
  /// **'Players'**
  String get players;

  /// No description provided for @point.
  ///
  /// In en, this message translates to:
  /// **'Point'**
  String get point;

  /// No description provided for @points.
  ///
  /// In en, this message translates to:
  /// **'Points'**
  String get points;

  /// No description provided for @privacy_policy.
  ///
  /// In en, this message translates to:
  /// **'Privacy Policy'**
  String get privacy_policy;

  /// No description provided for @quick_create.
  ///
  /// In en, this message translates to:
  /// **'Quick Create'**
  String get quick_create;

  /// No description provided for @recent_matches.
  ///
  /// In en, this message translates to:
  /// **'Recent Matches'**
  String get recent_matches;

  /// No description provided for @redistribute.
  ///
  /// In en, this message translates to:
  /// **'Redistribute'**
  String get redistribute;

  /// No description provided for @results.
  ///
  /// In en, this message translates to:
  /// **'Results'**
  String get results;

  /// No description provided for @ruleset.
  ///
  /// In en, this message translates to:
  /// **'Ruleset'**
  String get ruleset;

  /// No description provided for @ruleset_least_points.
  ///
  /// In en, this message translates to:
  /// **'Inverse scoring: the player with the fewest points wins.'**
  String get ruleset_least_points;

  /// No description provided for @ruleset_most_points.
  ///
  /// In en, this message translates to:
  /// **'Traditional ruleset: the player with the most points wins.'**
  String get ruleset_most_points;

  /// No description provided for @ruleset_placement.
  ///
  /// In en, this message translates to:
  /// **'Players can be arranged in an order, which reflects their placement.'**
  String get ruleset_placement;

  /// No description provided for @ruleset_single_loser.
  ///
  /// In en, this message translates to:
  /// **'Exactly one loser is determined; last place receives the penalty or consequence.'**
  String get ruleset_single_loser;

  /// No description provided for @ruleset_single_winner.
  ///
  /// In en, this message translates to:
  /// **'Exactly one winner is chosen; ties are resolved by a predefined tiebreaker.'**
  String get ruleset_single_winner;

  /// No description provided for @save_changes.
  ///
  /// In en, this message translates to:
  /// **'Save Changes'**
  String get save_changes;

  /// No description provided for @search_for_groups.
  ///
  /// In en, this message translates to:
  /// **'Search for groups'**
  String get search_for_groups;

  /// No description provided for @search_for_players.
  ///
  /// In en, this message translates to:
  /// **'Search for players'**
  String get search_for_players;

  /// No description provided for @select_loser.
  ///
  /// In en, this message translates to:
  /// **'Select Loser'**
  String get select_loser;

  /// No description provided for @select_winner.
  ///
  /// In en, this message translates to:
  /// **'Select Winner'**
  String get select_winner;

  /// No description provided for @select_winners.
  ///
  /// In en, this message translates to:
  /// **'Select Winners'**
  String get select_winners;

  /// No description provided for @selected_players.
  ///
  /// In en, this message translates to:
  /// **'Selected players'**
  String get selected_players;

  /// No description provided for @settings.
  ///
  /// In en, this message translates to:
  /// **'Settings'**
  String get settings;

  /// No description provided for @single_loser.
  ///
  /// In en, this message translates to:
  /// **'Single Loser'**
  String get single_loser;

  /// No description provided for @single_winner.
  ///
  /// In en, this message translates to:
  /// **'Single Winner'**
  String get single_winner;

  /// No description provided for @statistics.
  ///
  /// In en, this message translates to:
  /// **'Statistics'**
  String get statistics;

  /// No description provided for @stats.
  ///
  /// In en, this message translates to:
  /// **'Stats'**
  String get stats;

  /// Success message when adding a player
  ///
  /// In en, this message translates to:
  /// **'Successfully added player {playerName}'**
  String successfully_added_player(String playerName);

  /// No description provided for @team.
  ///
  /// In en, this message translates to:
  /// **'Team'**
  String get team;

  /// No description provided for @team_match.
  ///
  /// In en, this message translates to:
  /// **'Team Match'**
  String get team_match;

  /// No description provided for @teams.
  ///
  /// In en, this message translates to:
  /// **'Teams'**
  String get teams;

  /// No description provided for @there_are_no_games_matching_your_search.
  ///
  /// In en, this message translates to:
  /// **'There are no games matching your search'**
  String get there_are_no_games_matching_your_search;

  /// No description provided for @there_is_no_group_matching_your_search.
  ///
  /// In en, this message translates to:
  /// **'There is no group matching your search'**
  String get there_is_no_group_matching_your_search;

  /// No description provided for @this_cannot_be_undone.
  ///
  /// In en, this message translates to:
  /// **'This can\'t be undone.'**
  String get this_cannot_be_undone;

  /// No description provided for @tie.
  ///
  /// In en, this message translates to:
  /// **'Tie'**
  String get tie;

  /// No description provided for @today_at.
  ///
  /// In en, this message translates to:
  /// **'Today at'**
  String get today_at;

  /// No description provided for @undo.
  ///
  /// In en, this message translates to:
  /// **'Undo'**
  String get undo;

  /// No description provided for @unknown_exception.
  ///
  /// In en, this message translates to:
  /// **'Unknown Exception (see console)'**
  String get unknown_exception;

  /// No description provided for @winner.
  ///
  /// In en, this message translates to:
  /// **'Winner'**
  String get winner;

  /// No description provided for @winners.
  ///
  /// In en, this message translates to:
  /// **'Winners'**
  String get winners;

  /// No description provided for @winrate.
  ///
  /// In en, this message translates to:
  /// **'Winrate'**
  String get winrate;

  /// No description provided for @wins.
  ///
  /// In en, this message translates to:
  /// **'Wins'**
  String get wins;

  /// No description provided for @yesterday_at.
  ///
  /// In en, this message translates to:
  /// **'Yesterday at'**
  String get yesterday_at;
}

class _AppLocalizationsDelegate
    extends LocalizationsDelegate<AppLocalizations> {
  const _AppLocalizationsDelegate();

  @override
  Future<AppLocalizations> load(Locale locale) {
    return SynchronousFuture<AppLocalizations>(lookupAppLocalizations(locale));
  }

  @override
  bool isSupported(Locale locale) =>
      <String>['de', 'en'].contains(locale.languageCode);

  @override
  bool shouldReload(_AppLocalizationsDelegate old) => false;
}

AppLocalizations lookupAppLocalizations(Locale locale) {
  // Lookup logic when only language code is specified.
  switch (locale.languageCode) {
    case 'de':
      return AppLocalizationsDe();
    case 'en':
      return AppLocalizationsEn();
  }

  throw FlutterError(
    'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
    'an issue with the localizations generation tool. Please file an issue '
    'on GitHub with a reproducible sample app and the gen-l10n configuration '
    'that was used.',
  );
}
