Настройки, авторизация

This commit is contained in:
Халимов Рустам
2026-05-14 12:06:34 +03:00
parent e8161d23d4
commit ccffc5a53c
41 changed files with 2556 additions and 1375 deletions
+307 -111
View File
@@ -62,7 +62,8 @@ import 'app_localizations_ru.dart';
/// be consistent with the languages listed in the AppLocalizations.supportedLocales
/// property.
abstract class AppLocalizations {
AppLocalizations(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString());
AppLocalizations(String locale)
: localeName = intl.Intl.canonicalizedLocale(locale.toString());
final String localeName;
@@ -70,7 +71,8 @@ abstract class AppLocalizations {
return Localizations.of<AppLocalizations>(context, AppLocalizations);
}
static const LocalizationsDelegate<AppLocalizations> delegate = _AppLocalizationsDelegate();
static const LocalizationsDelegate<AppLocalizations> delegate =
_AppLocalizationsDelegate();
/// A list of this localizations delegate along with the default localizations
/// delegates.
@@ -82,7 +84,8 @@ abstract class AppLocalizations {
/// 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>>[
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates =
<LocalizationsDelegate<dynamic>>[
delegate,
GlobalMaterialLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
@@ -97,294 +100,487 @@ abstract class AppLocalizations {
/// No description provided for @appTitle.
///
/// In en, this message translates to:
/// **'Messenger'**
/// In ru, this message translates to:
/// **'Мессенджер'**
String get appTitle;
/// No description provided for @chats.
///
/// In en, this message translates to:
/// **'Chats'**
/// In ru, this message translates to:
/// **'Чаты'**
String get chats;
/// No description provided for @contacts.
///
/// In en, this message translates to:
/// **'Contacts'**
/// In ru, this message translates to:
/// **'Контакты'**
String get contacts;
/// No description provided for @settings.
///
/// In en, this message translates to:
/// **'Settings'**
/// In ru, this message translates to:
/// **'Настройки'**
String get settings;
/// No description provided for @login.
///
/// In en, this message translates to:
/// **'Login'**
/// In ru, this message translates to:
/// **'Вход'**
String get login;
/// No description provided for @email.
/// No description provided for @username.
///
/// In en, this message translates to:
/// **'Email'**
String get email;
/// In ru, this message translates to:
/// **'Логин'**
String get username;
/// No description provided for @password.
///
/// In en, this message translates to:
/// **'Password'**
/// In ru, this message translates to:
/// **'Пароль'**
String get password;
/// No description provided for @name.
///
/// In en, this message translates to:
/// **'Name'**
/// In ru, this message translates to:
/// **'Имя'**
String get name;
/// No description provided for @loginButton.
///
/// In en, this message translates to:
/// **'Sign In'**
/// In ru, this message translates to:
/// **'Войти'**
String get loginButton;
/// No description provided for @register.
///
/// In en, this message translates to:
/// **'Register'**
/// In ru, this message translates to:
/// **'Зарегистрироваться'**
String get register;
/// No description provided for @noAccount.
///
/// In en, this message translates to:
/// **'No account? Sign up'**
/// In ru, this message translates to:
/// **'Нет аккаунта? Зарегистрироваться'**
String get noAccount;
/// No description provided for @logout.
///
/// In en, this message translates to:
/// **'Sign Out'**
/// In ru, this message translates to:
/// **'Выйти из аккаунта'**
String get logout;
/// No description provided for @serverSettings.
///
/// In en, this message translates to:
/// **'Server Settings'**
/// In ru, this message translates to:
/// **'Настройки сервера'**
String get serverSettings;
/// No description provided for @apiUrl.
///
/// In en, this message translates to:
/// **'API URL'**
/// In ru, this message translates to:
/// **'Адрес API'**
String get apiUrl;
/// No description provided for @apiUrlHint.
///
/// In en, this message translates to:
/// In ru, this message translates to:
/// **'https://api.example.com'**
String get apiUrlHint;
/// No description provided for @save.
///
/// In en, this message translates to:
/// **'Save'**
/// In ru, this message translates to:
/// **'Сохранить'**
String get save;
/// No description provided for @serverConfig.
///
/// In en, this message translates to:
/// **'Server Configuration'**
/// In ru, this message translates to:
/// **'Конфигурация сервера'**
String get serverConfig;
/// No description provided for @system.
///
/// In en, this message translates to:
/// **'System'**
/// In ru, this message translates to:
/// **'Система'**
String get system;
/// No description provided for @stories.
///
/// In en, this message translates to:
/// **'Stories'**
/// In ru, this message translates to:
/// **'Истории'**
String get stories;
/// No description provided for @chatsModule.
///
/// In en, this message translates to:
/// **'Chats'**
/// In ru, this message translates to:
/// **'Чаты'**
String get chatsModule;
/// No description provided for @messages.
///
/// In en, this message translates to:
/// **'Messages'**
/// In ru, this message translates to:
/// **'Сообщения'**
String get messages;
/// No description provided for @calls.
///
/// In en, this message translates to:
/// **'Calls'**
/// In ru, this message translates to:
/// **'Звонки'**
String get calls;
/// No description provided for @klipy.
///
/// In en, this message translates to:
/// **'Klipy'**
/// In ru, this message translates to:
/// **'Клипы'**
String get klipy;
/// No description provided for @import.
///
/// In en, this message translates to:
/// **'Import'**
/// In ru, this message translates to:
/// **'Импорт'**
String get import;
/// No description provided for @federation.
///
/// In en, this message translates to:
/// **'Federation'**
/// In ru, this message translates to:
/// **'Федерация'**
String get federation;
/// No description provided for @domainUrl.
///
/// In en, this message translates to:
/// **'Domain'**
/// In ru, this message translates to:
/// **'Домен'**
String get domainUrl;
/// No description provided for @enableRegistration.
/// No description provided for @registrationStatus.
///
/// In en, this message translates to:
/// **'Registration Enabled'**
String get enableRegistration;
/// In ru, this message translates to:
/// **'Регистрация'**
String get registrationStatus;
/// No description provided for @enabled.
///
/// In en, this message translates to:
/// **'Enabled'**
/// In ru, this message translates to:
/// **'Включено'**
String get enabled;
/// No description provided for @disabled.
///
/// In en, this message translates to:
/// **'Disabled'**
/// In ru, this message translates to:
/// **'Отключено'**
String get disabled;
/// No description provided for @language.
///
/// In en, this message translates to:
/// **'Language'**
/// In ru, this message translates to:
/// **'Язык'**
String get language;
/// No description provided for @russian.
///
/// In en, this message translates to:
/// In ru, this message translates to:
/// **'Русский'**
String get russian;
/// No description provided for @english.
///
/// In en, this message translates to:
/// In ru, this message translates to:
/// **'English'**
String get english;
/// No description provided for @notifications.
///
/// In en, this message translates to:
/// **'Notifications'**
/// In ru, this message translates to:
/// **'Уведомления'**
String get notifications;
/// No description provided for @privacy.
///
/// In en, this message translates to:
/// **'Privacy'**
/// In ru, this message translates to:
/// **'Конфиденциальность'**
String get privacy;
/// No description provided for @soundsAndVibration.
///
/// In en, this message translates to:
/// **'Sounds & Vibration'**
/// In ru, this message translates to:
/// **'Звуки и вибрация'**
String get soundsAndVibration;
/// No description provided for @dataAndStorage.
///
/// In en, this message translates to:
/// **'Data & Storage'**
/// In ru, this message translates to:
/// **'Данные и память'**
String get dataAndStorage;
/// No description provided for @aboutApp.
///
/// In en, this message translates to:
/// **'About App'**
/// In ru, this message translates to:
/// **'О приложении'**
String get aboutApp;
/// No description provided for @help.
///
/// In en, this message translates to:
/// **'Help'**
/// In ru, this message translates to:
/// **'Помощь'**
String get help;
/// No description provided for @version.
///
/// In en, this message translates to:
/// **'Version'**
/// In ru, this message translates to:
/// **'Версия'**
String get version;
/// No description provided for @loading.
///
/// In en, this message translates to:
/// **'Loading...'**
/// In ru, this message translates to:
/// **'Загрузка...'**
String get loading;
/// No description provided for @error.
///
/// In en, this message translates to:
/// **'Error'**
/// In ru, this message translates to:
/// **'Ошибка'**
String get error;
/// No description provided for @retry.
///
/// In en, this message translates to:
/// **'Retry'**
/// In ru, this message translates to:
/// **'Повторить'**
String get retry;
/// No description provided for @noChats.
///
/// In en, this message translates to:
/// **'No chats yet'**
/// In ru, this message translates to:
/// **'У вас пока нет чатов'**
String get noChats;
/// No description provided for @inDevelopment.
///
/// In en, this message translates to:
/// **'In development'**
/// In ru, this message translates to:
/// **'Функция в разработке'**
String get inDevelopment;
/// No description provided for @user.
///
/// In en, this message translates to:
/// **'User'**
/// In ru, this message translates to:
/// **'Пользователь'**
String get user;
/// No description provided for @edit.
///
/// In en, this message translates to:
/// **'Edit'**
/// In ru, this message translates to:
/// **'Редактировать'**
String get edit;
/// No description provided for @serverConnectionError.
///
/// In en, this message translates to:
/// **'Server connection error'**
/// In ru, this message translates to:
/// **'Ошибка подключения к серверу'**
String get serverConnectionError;
/// No description provided for @connected.
///
/// In ru, this message translates to:
/// **'Подключено'**
String get connected;
/// No description provided for @unknownError.
///
/// In ru, this message translates to:
/// **'Неизвестная ошибка'**
String get unknownError;
/// No description provided for @networkError.
///
/// In ru, this message translates to:
/// **'Ошибка сети'**
String get networkError;
/// No description provided for @serverError.
///
/// In ru, this message translates to:
/// **'Ошибка сервера'**
String get serverError;
/// No description provided for @parsingError.
///
/// In ru, this message translates to:
/// **'Ошибка обработки данных'**
String get parsingError;
/// No description provided for @voice.
///
/// In ru, this message translates to:
/// **'Голосовые вызовы'**
String get voice;
/// No description provided for @video.
///
/// In ru, this message translates to:
/// **'Видеовызовы'**
String get video;
/// No description provided for @lifetime.
///
/// In ru, this message translates to:
/// **'Время жизни'**
String get lifetime;
/// No description provided for @groups.
///
/// In ru, this message translates to:
/// **'Группы'**
String get groups;
/// No description provided for @maxParticipants.
///
/// In ru, this message translates to:
/// **'Макс. участников'**
String get maxParticipants;
/// No description provided for @hours.
///
/// In ru, this message translates to:
/// **'ч.'**
String get hours;
/// No description provided for @dailyLimit.
///
/// In ru, this message translates to:
/// **'Дневной лимит'**
String get dailyLimit;
/// No description provided for @historyLimit.
///
/// In ru, this message translates to:
/// **'Лимит истории'**
String get historyLimit;
/// No description provided for @maxFileSize.
///
/// In ru, this message translates to:
/// **'Макс. файл'**
String get maxFileSize;
/// No description provided for @noLimit.
///
/// In ru, this message translates to:
/// **'Без лимита'**
String get noLimit;
/// No description provided for @allowForwarding.
///
/// In ru, this message translates to:
/// **'Пересылка'**
String get allowForwarding;
/// No description provided for @allowReactions.
///
/// In ru, this message translates to:
/// **'Реакции'**
String get allowReactions;
/// No description provided for @allowReplies.
///
/// In ru, this message translates to:
/// **'Ответы'**
String get allowReplies;
/// No description provided for @allowQuoting.
///
/// In ru, this message translates to:
/// **'Цитирование'**
String get allowQuoting;
/// No description provided for @allowMessageDeletion.
///
/// In ru, this message translates to:
/// **'Удаление'**
String get allowMessageDeletion;
/// No description provided for @forbidCopying.
///
/// In ru, this message translates to:
/// **'Запрет копирования'**
String get forbidCopying;
/// No description provided for @allowLinks.
///
/// In ru, this message translates to:
/// **'Ссылки'**
String get allowLinks;
/// No description provided for @allowPolls.
///
/// In ru, this message translates to:
/// **'Опросы'**
String get allowPolls;
/// No description provided for @allowPinning.
///
/// In ru, this message translates to:
/// **'Закрепы'**
String get allowPinning;
/// No description provided for @allowMedia.
///
/// In ru, this message translates to:
/// **'Медиа'**
String get allowMedia;
/// No description provided for @description.
///
/// In ru, this message translates to:
/// **'Описание'**
String get description;
/// No description provided for @server.
///
/// In ru, this message translates to:
/// **'Сервер'**
String get server;
/// No description provided for @notSpecified.
///
/// In ru, this message translates to:
/// **'не указан'**
String get notSpecified;
/// No description provided for @settingsSaved.
///
/// In en, this message translates to:
/// **'Settings saved'**
/// In ru, this message translates to:
/// **'Настройки сохранены'**
String get settingsSaved;
/// No description provided for @enterUsername.
///
/// In ru, this message translates to:
/// **'Введите логин'**
String get enterUsername;
/// No description provided for @invalidUsername.
///
/// In ru, this message translates to:
/// **'Логин должен быть от 3 символов и без кириллицы'**
String get invalidUsername;
/// No description provided for @loginFailed.
///
/// In ru, this message translates to:
/// **'Ошибка входа. Проверьте логин и пароль'**
String get loginFailed;
/// No description provided for @registrationFailed.
///
/// In ru, this message translates to:
/// **'Ошибка регистрации'**
String get registrationFailed;
}
class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
class _AppLocalizationsDelegate
extends LocalizationsDelegate<AppLocalizations> {
const _AppLocalizationsDelegate();
@override
@@ -393,25 +589,25 @@ class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations>
}
@override
bool isSupported(Locale locale) => <String>['en', 'ru'].contains(locale.languageCode);
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();
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.'
);
'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.');
}
@@ -24,7 +24,7 @@ class AppLocalizationsEn extends AppLocalizations {
String get login => 'Login';
@override
String get email => 'Email';
String get username => 'Login';
@override
String get password => 'Password';
@@ -87,7 +87,7 @@ class AppLocalizationsEn extends AppLocalizations {
String get domainUrl => 'Domain';
@override
String get enableRegistration => 'Registration Enabled';
String get registrationStatus => 'Registration';
@override
String get enabled => 'Enabled';
@@ -149,6 +149,103 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get serverConnectionError => 'Server connection error';
@override
String get connected => 'Connected';
@override
String get unknownError => 'Unknown error';
@override
String get networkError => 'Network error';
@override
String get serverError => 'Server error';
@override
String get parsingError => 'Data parsing error';
@override
String get voice => 'Voice Calls';
@override
String get video => 'Video Calls';
@override
String get lifetime => 'Lifetime';
@override
String get groups => 'Groups';
@override
String get maxParticipants => 'Max participants';
@override
String get hours => 'h';
@override
String get dailyLimit => 'Daily Limit';
@override
String get historyLimit => 'History Limit';
@override
String get maxFileSize => 'Max File Size';
@override
String get noLimit => 'No Limit';
@override
String get allowForwarding => 'Forwarding';
@override
String get allowReactions => 'Reactions';
@override
String get allowReplies => 'Replies';
@override
String get allowQuoting => 'Quoting';
@override
String get allowMessageDeletion => 'Deletion';
@override
String get forbidCopying => 'Forbid Copying';
@override
String get allowLinks => 'Links';
@override
String get allowPolls => 'Polls';
@override
String get allowPinning => 'Pins';
@override
String get allowMedia => 'Media';
@override
String get description => 'Description';
@override
String get server => 'Server';
@override
String get notSpecified => 'not specified';
@override
String get settingsSaved => 'Settings saved';
@override
String get enterUsername => 'Enter login';
@override
String get invalidUsername =>
'Login must be at least 3 characters and without Cyrillic';
@override
String get loginFailed => 'Login failed. Check your login and password';
@override
String get registrationFailed => 'Registration failed';
}
@@ -24,7 +24,7 @@ class AppLocalizationsRu extends AppLocalizations {
String get login => 'Вход';
@override
String get email => 'Email';
String get username => 'Логин';
@override
String get password => 'Пароль';
@@ -87,7 +87,7 @@ class AppLocalizationsRu extends AppLocalizations {
String get domainUrl => 'Домен';
@override
String get enableRegistration => 'Регистрация включена';
String get registrationStatus => 'Регистрация';
@override
String get enabled => 'Включено';
@@ -149,6 +149,103 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get serverConnectionError => 'Ошибка подключения к серверу';
@override
String get connected => 'Подключено';
@override
String get unknownError => 'Неизвестная ошибка';
@override
String get networkError => 'Ошибка сети';
@override
String get serverError => 'Ошибка сервера';
@override
String get parsingError => 'Ошибка обработки данных';
@override
String get voice => 'Голосовые вызовы';
@override
String get video => 'Видеовызовы';
@override
String get lifetime => 'Время жизни';
@override
String get groups => 'Группы';
@override
String get maxParticipants => 'Макс. участников';
@override
String get hours => 'ч.';
@override
String get dailyLimit => 'Дневной лимит';
@override
String get historyLimit => 'Лимит истории';
@override
String get maxFileSize => 'Макс. файл';
@override
String get noLimit => 'Без лимита';
@override
String get allowForwarding => 'Пересылка';
@override
String get allowReactions => 'Реакции';
@override
String get allowReplies => 'Ответы';
@override
String get allowQuoting => 'Цитирование';
@override
String get allowMessageDeletion => 'Удаление';
@override
String get forbidCopying => 'Запрет копирования';
@override
String get allowLinks => 'Ссылки';
@override
String get allowPolls => 'Опросы';
@override
String get allowPinning => 'Закрепы';
@override
String get allowMedia => 'Медиа';
@override
String get description => 'Описание';
@override
String get server => 'Сервер';
@override
String get notSpecified => 'не указан';
@override
String get settingsSaved => 'Настройки сохранены';
@override
String get enterUsername => 'Введите логин';
@override
String get invalidUsername =>
'Логин должен быть от 3 символов и без кириллицы';
@override
String get loginFailed => 'Ошибка входа. Проверьте логин и пароль';
@override
String get registrationFailed => 'Ошибка регистрации';
}