Приложение на флаторе, настройки
This commit is contained in:
@@ -0,0 +1,417 @@
|
||||
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_en.dart';
|
||||
import 'app_localizations_ru.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('en'),
|
||||
Locale('ru')
|
||||
];
|
||||
|
||||
/// No description provided for @appTitle.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Messenger'**
|
||||
String get appTitle;
|
||||
|
||||
/// No description provided for @chats.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Chats'**
|
||||
String get chats;
|
||||
|
||||
/// No description provided for @contacts.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Contacts'**
|
||||
String get contacts;
|
||||
|
||||
/// No description provided for @settings.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Settings'**
|
||||
String get settings;
|
||||
|
||||
/// No description provided for @login.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Login'**
|
||||
String get login;
|
||||
|
||||
/// No description provided for @email.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Email'**
|
||||
String get email;
|
||||
|
||||
/// No description provided for @password.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Password'**
|
||||
String get password;
|
||||
|
||||
/// No description provided for @name.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Name'**
|
||||
String get name;
|
||||
|
||||
/// No description provided for @loginButton.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Sign In'**
|
||||
String get loginButton;
|
||||
|
||||
/// No description provided for @register.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Register'**
|
||||
String get register;
|
||||
|
||||
/// No description provided for @noAccount.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'No account? Sign up'**
|
||||
String get noAccount;
|
||||
|
||||
/// No description provided for @logout.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Sign Out'**
|
||||
String get logout;
|
||||
|
||||
/// No description provided for @serverSettings.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Server Settings'**
|
||||
String get serverSettings;
|
||||
|
||||
/// No description provided for @apiUrl.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'API URL'**
|
||||
String get apiUrl;
|
||||
|
||||
/// No description provided for @apiUrlHint.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'https://api.example.com'**
|
||||
String get apiUrlHint;
|
||||
|
||||
/// No description provided for @save.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Save'**
|
||||
String get save;
|
||||
|
||||
/// No description provided for @serverConfig.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Server Configuration'**
|
||||
String get serverConfig;
|
||||
|
||||
/// No description provided for @system.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'System'**
|
||||
String get system;
|
||||
|
||||
/// No description provided for @stories.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Stories'**
|
||||
String get stories;
|
||||
|
||||
/// No description provided for @chatsModule.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Chats'**
|
||||
String get chatsModule;
|
||||
|
||||
/// No description provided for @messages.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Messages'**
|
||||
String get messages;
|
||||
|
||||
/// No description provided for @calls.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Calls'**
|
||||
String get calls;
|
||||
|
||||
/// No description provided for @klipy.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Klipy'**
|
||||
String get klipy;
|
||||
|
||||
/// No description provided for @import.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Import'**
|
||||
String get import;
|
||||
|
||||
/// No description provided for @federation.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Federation'**
|
||||
String get federation;
|
||||
|
||||
/// No description provided for @domainUrl.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Domain'**
|
||||
String get domainUrl;
|
||||
|
||||
/// No description provided for @enableRegistration.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Registration Enabled'**
|
||||
String get enableRegistration;
|
||||
|
||||
/// No description provided for @enabled.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Enabled'**
|
||||
String get enabled;
|
||||
|
||||
/// No description provided for @disabled.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Disabled'**
|
||||
String get disabled;
|
||||
|
||||
/// No description provided for @language.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Language'**
|
||||
String get language;
|
||||
|
||||
/// No description provided for @russian.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Русский'**
|
||||
String get russian;
|
||||
|
||||
/// No description provided for @english.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'English'**
|
||||
String get english;
|
||||
|
||||
/// No description provided for @notifications.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Notifications'**
|
||||
String get notifications;
|
||||
|
||||
/// No description provided for @privacy.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Privacy'**
|
||||
String get privacy;
|
||||
|
||||
/// No description provided for @soundsAndVibration.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Sounds & Vibration'**
|
||||
String get soundsAndVibration;
|
||||
|
||||
/// No description provided for @dataAndStorage.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Data & Storage'**
|
||||
String get dataAndStorage;
|
||||
|
||||
/// No description provided for @aboutApp.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'About App'**
|
||||
String get aboutApp;
|
||||
|
||||
/// No description provided for @help.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Help'**
|
||||
String get help;
|
||||
|
||||
/// No description provided for @version.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Version'**
|
||||
String get version;
|
||||
|
||||
/// No description provided for @loading.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Loading...'**
|
||||
String get loading;
|
||||
|
||||
/// No description provided for @error.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Error'**
|
||||
String get error;
|
||||
|
||||
/// No description provided for @retry.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Retry'**
|
||||
String get retry;
|
||||
|
||||
/// No description provided for @noChats.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'No chats yet'**
|
||||
String get noChats;
|
||||
|
||||
/// No description provided for @inDevelopment.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'In development'**
|
||||
String get inDevelopment;
|
||||
|
||||
/// No description provided for @user.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'User'**
|
||||
String get user;
|
||||
|
||||
/// No description provided for @edit.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Edit'**
|
||||
String get edit;
|
||||
|
||||
/// No description provided for @serverConnectionError.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Server connection error'**
|
||||
String get serverConnectionError;
|
||||
|
||||
/// No description provided for @settingsSaved.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Settings saved'**
|
||||
String get settingsSaved;
|
||||
}
|
||||
|
||||
class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
|
||||
const _AppLocalizationsDelegate();
|
||||
|
||||
@override
|
||||
Future<AppLocalizations> load(Locale locale) {
|
||||
return SynchronousFuture<AppLocalizations>(lookupAppLocalizations(locale));
|
||||
}
|
||||
|
||||
@override
|
||||
bool isSupported(Locale locale) => <String>['en', 'ru'].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 'en': return AppLocalizationsEn();
|
||||
case 'ru': return AppLocalizationsRu();
|
||||
}
|
||||
|
||||
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.'
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
// 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 get appTitle => 'Messenger';
|
||||
|
||||
@override
|
||||
String get chats => 'Chats';
|
||||
|
||||
@override
|
||||
String get contacts => 'Contacts';
|
||||
|
||||
@override
|
||||
String get settings => 'Settings';
|
||||
|
||||
@override
|
||||
String get login => 'Login';
|
||||
|
||||
@override
|
||||
String get email => 'Email';
|
||||
|
||||
@override
|
||||
String get password => 'Password';
|
||||
|
||||
@override
|
||||
String get name => 'Name';
|
||||
|
||||
@override
|
||||
String get loginButton => 'Sign In';
|
||||
|
||||
@override
|
||||
String get register => 'Register';
|
||||
|
||||
@override
|
||||
String get noAccount => 'No account? Sign up';
|
||||
|
||||
@override
|
||||
String get logout => 'Sign Out';
|
||||
|
||||
@override
|
||||
String get serverSettings => 'Server Settings';
|
||||
|
||||
@override
|
||||
String get apiUrl => 'API URL';
|
||||
|
||||
@override
|
||||
String get apiUrlHint => 'https://api.example.com';
|
||||
|
||||
@override
|
||||
String get save => 'Save';
|
||||
|
||||
@override
|
||||
String get serverConfig => 'Server Configuration';
|
||||
|
||||
@override
|
||||
String get system => 'System';
|
||||
|
||||
@override
|
||||
String get stories => 'Stories';
|
||||
|
||||
@override
|
||||
String get chatsModule => 'Chats';
|
||||
|
||||
@override
|
||||
String get messages => 'Messages';
|
||||
|
||||
@override
|
||||
String get calls => 'Calls';
|
||||
|
||||
@override
|
||||
String get klipy => 'Klipy';
|
||||
|
||||
@override
|
||||
String get import => 'Import';
|
||||
|
||||
@override
|
||||
String get federation => 'Federation';
|
||||
|
||||
@override
|
||||
String get domainUrl => 'Domain';
|
||||
|
||||
@override
|
||||
String get enableRegistration => 'Registration Enabled';
|
||||
|
||||
@override
|
||||
String get enabled => 'Enabled';
|
||||
|
||||
@override
|
||||
String get disabled => 'Disabled';
|
||||
|
||||
@override
|
||||
String get language => 'Language';
|
||||
|
||||
@override
|
||||
String get russian => 'Русский';
|
||||
|
||||
@override
|
||||
String get english => 'English';
|
||||
|
||||
@override
|
||||
String get notifications => 'Notifications';
|
||||
|
||||
@override
|
||||
String get privacy => 'Privacy';
|
||||
|
||||
@override
|
||||
String get soundsAndVibration => 'Sounds & Vibration';
|
||||
|
||||
@override
|
||||
String get dataAndStorage => 'Data & Storage';
|
||||
|
||||
@override
|
||||
String get aboutApp => 'About App';
|
||||
|
||||
@override
|
||||
String get help => 'Help';
|
||||
|
||||
@override
|
||||
String get version => 'Version';
|
||||
|
||||
@override
|
||||
String get loading => 'Loading...';
|
||||
|
||||
@override
|
||||
String get error => 'Error';
|
||||
|
||||
@override
|
||||
String get retry => 'Retry';
|
||||
|
||||
@override
|
||||
String get noChats => 'No chats yet';
|
||||
|
||||
@override
|
||||
String get inDevelopment => 'In development';
|
||||
|
||||
@override
|
||||
String get user => 'User';
|
||||
|
||||
@override
|
||||
String get edit => 'Edit';
|
||||
|
||||
@override
|
||||
String get serverConnectionError => 'Server connection error';
|
||||
|
||||
@override
|
||||
String get settingsSaved => 'Settings saved';
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
// ignore: unused_import
|
||||
import 'package:intl/intl.dart' as intl;
|
||||
import 'app_localizations.dart';
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
/// The translations for Russian (`ru`).
|
||||
class AppLocalizationsRu extends AppLocalizations {
|
||||
AppLocalizationsRu([String locale = 'ru']) : super(locale);
|
||||
|
||||
@override
|
||||
String get appTitle => 'Мессенджер';
|
||||
|
||||
@override
|
||||
String get chats => 'Чаты';
|
||||
|
||||
@override
|
||||
String get contacts => 'Контакты';
|
||||
|
||||
@override
|
||||
String get settings => 'Настройки';
|
||||
|
||||
@override
|
||||
String get login => 'Вход';
|
||||
|
||||
@override
|
||||
String get email => 'Email';
|
||||
|
||||
@override
|
||||
String get password => 'Пароль';
|
||||
|
||||
@override
|
||||
String get name => 'Имя';
|
||||
|
||||
@override
|
||||
String get loginButton => 'Войти';
|
||||
|
||||
@override
|
||||
String get register => 'Зарегистрироваться';
|
||||
|
||||
@override
|
||||
String get noAccount => 'Нет аккаунта? Зарегистрироваться';
|
||||
|
||||
@override
|
||||
String get logout => 'Выйти из аккаунта';
|
||||
|
||||
@override
|
||||
String get serverSettings => 'Настройки сервера';
|
||||
|
||||
@override
|
||||
String get apiUrl => 'Адрес API';
|
||||
|
||||
@override
|
||||
String get apiUrlHint => 'https://api.example.com';
|
||||
|
||||
@override
|
||||
String get save => 'Сохранить';
|
||||
|
||||
@override
|
||||
String get serverConfig => 'Конфигурация сервера';
|
||||
|
||||
@override
|
||||
String get system => 'Система';
|
||||
|
||||
@override
|
||||
String get stories => 'Истории';
|
||||
|
||||
@override
|
||||
String get chatsModule => 'Чаты';
|
||||
|
||||
@override
|
||||
String get messages => 'Сообщения';
|
||||
|
||||
@override
|
||||
String get calls => 'Звонки';
|
||||
|
||||
@override
|
||||
String get klipy => 'Клипы';
|
||||
|
||||
@override
|
||||
String get import => 'Импорт';
|
||||
|
||||
@override
|
||||
String get federation => 'Федерация';
|
||||
|
||||
@override
|
||||
String get domainUrl => 'Домен';
|
||||
|
||||
@override
|
||||
String get enableRegistration => 'Регистрация включена';
|
||||
|
||||
@override
|
||||
String get enabled => 'Включено';
|
||||
|
||||
@override
|
||||
String get disabled => 'Отключено';
|
||||
|
||||
@override
|
||||
String get language => 'Язык';
|
||||
|
||||
@override
|
||||
String get russian => 'Русский';
|
||||
|
||||
@override
|
||||
String get english => 'English';
|
||||
|
||||
@override
|
||||
String get notifications => 'Уведомления';
|
||||
|
||||
@override
|
||||
String get privacy => 'Конфиденциальность';
|
||||
|
||||
@override
|
||||
String get soundsAndVibration => 'Звуки и вибрация';
|
||||
|
||||
@override
|
||||
String get dataAndStorage => 'Данные и память';
|
||||
|
||||
@override
|
||||
String get aboutApp => 'О приложении';
|
||||
|
||||
@override
|
||||
String get help => 'Помощь';
|
||||
|
||||
@override
|
||||
String get version => 'Версия';
|
||||
|
||||
@override
|
||||
String get loading => 'Загрузка...';
|
||||
|
||||
@override
|
||||
String get error => 'Ошибка';
|
||||
|
||||
@override
|
||||
String get retry => 'Повторить';
|
||||
|
||||
@override
|
||||
String get noChats => 'У вас пока нет чатов';
|
||||
|
||||
@override
|
||||
String get inDevelopment => 'Функция в разработке';
|
||||
|
||||
@override
|
||||
String get user => 'Пользователь';
|
||||
|
||||
@override
|
||||
String get edit => 'Редактировать';
|
||||
|
||||
@override
|
||||
String get serverConnectionError => 'Ошибка подключения к серверу';
|
||||
|
||||
@override
|
||||
String get settingsSaved => 'Настройки сохранены';
|
||||
}
|
||||
Reference in New Issue
Block a user