updated gitignore to ignore generated localization files
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -12,6 +12,7 @@
|
|||||||
.buildlog/
|
.buildlog/
|
||||||
.history
|
.history
|
||||||
.svn/
|
.svn/
|
||||||
|
lib/l10n/app_localizations*
|
||||||
|
|
||||||
# As packages are no longer pinned, we use a lockfile for testing locally.
|
# As packages are no longer pinned, we use a lockfile for testing locally.
|
||||||
# When unpinning packages, Using lockfiles ensures that failures in PRs are
|
# When unpinning packages, Using lockfiles ensures that failures in PRs are
|
||||||
|
|||||||
@@ -1,248 +0,0 @@
|
|||||||
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 'l10n/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 @addToCollection.
|
|
||||||
///
|
|
||||||
/// In en, this message translates to:
|
|
||||||
/// **'Add to {collection_name}'**
|
|
||||||
String addToCollection(String collection_name);
|
|
||||||
|
|
||||||
/// No description provided for @cancel.
|
|
||||||
///
|
|
||||||
/// In en, this message translates to:
|
|
||||||
/// **'Cancel'**
|
|
||||||
String get cancel;
|
|
||||||
|
|
||||||
/// No description provided for @chooseCollection.
|
|
||||||
///
|
|
||||||
/// In en, this message translates to:
|
|
||||||
/// **'Choose Collection'**
|
|
||||||
String get chooseCollection;
|
|
||||||
|
|
||||||
/// No description provided for @collections.
|
|
||||||
///
|
|
||||||
/// In en, this message translates to:
|
|
||||||
/// **'Collections'**
|
|
||||||
String get collections;
|
|
||||||
|
|
||||||
/// No description provided for @tipCreateCollections.
|
|
||||||
///
|
|
||||||
/// In en, this message translates to:
|
|
||||||
/// **'Create your first Collection to get started!'**
|
|
||||||
String get tipCreateCollections;
|
|
||||||
|
|
||||||
/// No description provided for @search.
|
|
||||||
///
|
|
||||||
/// In en, this message translates to:
|
|
||||||
/// **'Search'**
|
|
||||||
String get search;
|
|
||||||
|
|
||||||
/// No description provided for @createBookmark.
|
|
||||||
///
|
|
||||||
/// In en, this message translates to:
|
|
||||||
/// **'Create Bookmark'**
|
|
||||||
String get createBookmark;
|
|
||||||
|
|
||||||
/// No description provided for @createCollection.
|
|
||||||
///
|
|
||||||
/// In en, this message translates to:
|
|
||||||
/// **'Create Collection'**
|
|
||||||
String get createCollection;
|
|
||||||
|
|
||||||
/// No description provided for @create.
|
|
||||||
///
|
|
||||||
/// In en, this message translates to:
|
|
||||||
/// **'Create'**
|
|
||||||
String get create;
|
|
||||||
|
|
||||||
/// No description provided for @delete.
|
|
||||||
///
|
|
||||||
/// In en, this message translates to:
|
|
||||||
/// **'Delete'**
|
|
||||||
String get delete;
|
|
||||||
|
|
||||||
/// No description provided for @add.
|
|
||||||
///
|
|
||||||
/// In en, this message translates to:
|
|
||||||
/// **'Add'**
|
|
||||||
String get add;
|
|
||||||
|
|
||||||
/// No description provided for @startSearching.
|
|
||||||
///
|
|
||||||
/// In en, this message translates to:
|
|
||||||
/// **'Start searching'**
|
|
||||||
String get startSearching;
|
|
||||||
|
|
||||||
/// No description provided for @tipNoResults.
|
|
||||||
///
|
|
||||||
/// In en, this message translates to:
|
|
||||||
/// **'There are no results that match your search'**
|
|
||||||
String get tipNoResults;
|
|
||||||
|
|
||||||
/// No description provided for @collectionName.
|
|
||||||
///
|
|
||||||
/// In en, this message translates to:
|
|
||||||
/// **'Collection Name'**
|
|
||||||
String get collectionName;
|
|
||||||
|
|
||||||
/// No description provided for @bookmarkTitle.
|
|
||||||
///
|
|
||||||
/// In en, this message translates to:
|
|
||||||
/// **'Bookmark Title'**
|
|
||||||
String get bookmarkTitle;
|
|
||||||
|
|
||||||
/// No description provided for @url.
|
|
||||||
///
|
|
||||||
/// In en, this message translates to:
|
|
||||||
/// **'Url'**
|
|
||||||
String get url;
|
|
||||||
|
|
||||||
/// No description provided for @description.
|
|
||||||
///
|
|
||||||
/// In en, this message translates to:
|
|
||||||
/// **'Description'**
|
|
||||||
String get description;
|
|
||||||
|
|
||||||
/// No description provided for @settings.
|
|
||||||
///
|
|
||||||
/// In en, this message translates to:
|
|
||||||
/// **'Settings'**
|
|
||||||
String get settings;
|
|
||||||
|
|
||||||
/// No description provided for @activateJsonExport.
|
|
||||||
///
|
|
||||||
/// In en, this message translates to:
|
|
||||||
/// **'Activate json export'**
|
|
||||||
String get activateJsonExport;
|
|
||||||
}
|
|
||||||
|
|
||||||
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.',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
// ignore: unused_import
|
|
||||||
import 'package:intl/intl.dart' as intl;
|
|
||||||
import 'app_localizations.dart';
|
|
||||||
|
|
||||||
// ignore_for_file: type=lint
|
|
||||||
|
|
||||||
/// The translations for German (`de`).
|
|
||||||
class AppLocalizationsDe extends AppLocalizations {
|
|
||||||
AppLocalizationsDe([String locale = 'de']) : super(locale);
|
|
||||||
|
|
||||||
@override
|
|
||||||
String addToCollection(String collection_name) {
|
|
||||||
return 'Speichern in $collection_name';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get cancel => 'Abbrechen';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get chooseCollection => 'Sammlung auswählen';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get collections => 'Sammlungen';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get tipCreateCollections => 'Erstelle deine erste Sammlung!';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get search => 'Suche';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get createBookmark => 'Lesezeichen erstellen';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get createCollection => 'Sammlung erstellen';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get create => 'Erstellen';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get delete => 'Löschen';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get add => 'Hinzufügen';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get startSearching => 'Suche etwas';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get tipNoResults => 'Keine Suchergebnisse gefunden';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get collectionName => 'Name der Sammlung';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get bookmarkTitle => 'Titel des Lesezeichens';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get url => 'Url';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get description => 'Beschreibung';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get settings => 'Einstellungen';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get activateJsonExport => 'Json-Export aktivieren';
|
|
||||||
}
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
// ignore: unused_import
|
|
||||||
import 'package:intl/intl.dart' as intl;
|
|
||||||
import 'app_localizations.dart';
|
|
||||||
|
|
||||||
// ignore_for_file: type=lint
|
|
||||||
|
|
||||||
/// The translations for English (`en`).
|
|
||||||
class AppLocalizationsEn extends AppLocalizations {
|
|
||||||
AppLocalizationsEn([String locale = 'en']) : super(locale);
|
|
||||||
|
|
||||||
@override
|
|
||||||
String addToCollection(String collection_name) {
|
|
||||||
return 'Add to $collection_name';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get cancel => 'Cancel';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get chooseCollection => 'Choose Collection';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get collections => 'Collections';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get tipCreateCollections =>
|
|
||||||
'Create your first Collection to get started!';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get search => 'Search';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get createBookmark => 'Create Bookmark';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get createCollection => 'Create Collection';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get create => 'Create';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get delete => 'Delete';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get add => 'Add';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get startSearching => 'Start searching';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get tipNoResults => 'There are no results that match your search';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get collectionName => 'Collection Name';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get bookmarkTitle => 'Bookmark Title';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get url => 'Url';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get description => 'Description';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get settings => 'Settings';
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get activateJsonExport => 'Activate json export';
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user