Добавил тексты локализации
This commit is contained in:
@@ -6,12 +6,6 @@ const String appName = "Dinect";
|
||||
const String url = 'https://pos-api-autoclub.dinect.com/20130701/';
|
||||
const String appToken = 'bdea0f3ba9034b688019a7cac753d1209e2b227f';
|
||||
|
||||
// Texts
|
||||
const String merchantIDHint = 'ID магазина';
|
||||
const String posIDHint = 'Номер кассы';
|
||||
const String tokenActiveMessage = 'Программа активирована';
|
||||
const String tokenWaitMessage = 'Запрос на активацию программы отправлен, дождитесь подтверждения активации администратором';
|
||||
|
||||
// Assets
|
||||
const String logo_png = 'assets/registration_logo.png';
|
||||
const String splash_png = 'assets/splash.png';
|
||||
|
||||
62
lib/i18n/stock_messages_all.dart
Normal file
62
lib/i18n/stock_messages_all.dart
Normal file
@@ -0,0 +1,62 @@
|
||||
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
|
||||
// This is a library that looks up messages for specific locales by
|
||||
// delegating to the appropriate library.
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:intl/message_lookup_by_library.dart';
|
||||
import 'package:intl/src/intl_helpers.dart';
|
||||
|
||||
import 'stock_messages_messages_en.dart' as messages_messages_en;
|
||||
import 'stock_messages_messages_es.dart' as messages_messages_es;
|
||||
import 'stock_messages_messages_ru.dart' as messages_messages_ru;
|
||||
import 'stock_messages_messages_ua.dart' as messages_messages_ua;
|
||||
|
||||
typedef Future<dynamic> LibraryLoader();
|
||||
Map<String, LibraryLoader> _deferredLibraries = {
|
||||
'en': () => new Future.value(null),
|
||||
'es': () => new Future.value(null),
|
||||
'ru': () => new Future.value(null),
|
||||
'ua': () => new Future.value(null),
|
||||
};
|
||||
|
||||
MessageLookupByLibrary _findExact(localeName) {
|
||||
switch (localeName) {
|
||||
case 'en':
|
||||
return messages_messages_en.messages;
|
||||
case 'es':
|
||||
return messages_messages_es.messages;
|
||||
case 'ru':
|
||||
return messages_messages_ru.messages;
|
||||
case 'ua':
|
||||
return messages_messages_ua.messages;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// User programs should call this before using [localeName] for messages.
|
||||
Future initializeMessages(String localeName) {
|
||||
var lib = _deferredLibraries[Intl.canonicalizedLocale(localeName)];
|
||||
var load = lib == null ? new Future.value(false) : lib();
|
||||
return load.then((_) {
|
||||
initializeInternalMessageLookup(() => new CompositeMessageLookup());
|
||||
messageLookup.addLocale(localeName, _findGeneratedMessagesFor);
|
||||
});
|
||||
}
|
||||
|
||||
bool _messagesExistFor(String locale) {
|
||||
var messages;
|
||||
try {
|
||||
messages = _findExact(locale);
|
||||
} catch (e) {}
|
||||
return messages != null;
|
||||
}
|
||||
|
||||
MessageLookupByLibrary _findGeneratedMessagesFor(locale) {
|
||||
var actualLocale = Intl.verifiedLocale(locale, _messagesExistFor,
|
||||
onFailure: (_) => null);
|
||||
if (actualLocale == null) return null;
|
||||
return _findExact(actualLocale);
|
||||
}
|
||||
43
lib/i18n/stock_messages_messages_en.dart
Normal file
43
lib/i18n/stock_messages_messages_en.dart
Normal file
@@ -0,0 +1,43 @@
|
||||
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
|
||||
// This is a library that provides messages for a messages_en locale. All the
|
||||
// messages from the main program should be duplicated here with the same
|
||||
// function name.
|
||||
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:intl/message_lookup_by_library.dart';
|
||||
|
||||
final messages = new MessageLookup();
|
||||
|
||||
final _keepAnalysisHappy = Intl.defaultLocale;
|
||||
|
||||
class MessageLookup extends MessageLookupByLibrary {
|
||||
get localeName => 'messages_en';
|
||||
|
||||
final messages = _notInlinedMessages(_notInlinedMessages);
|
||||
static _notInlinedMessages(_) => {
|
||||
"ID_Store" : MessageLookupByLibrary.simpleMessage("DIN Store"),
|
||||
"ID_not_found" : MessageLookupByLibrary.simpleMessage("Identifier N is not found"),
|
||||
"app_activ" : MessageLookupByLibrary.simpleMessage("The application is activated"),
|
||||
"ask_change_store" : MessageLookupByLibrary.simpleMessage("Do you really want to log out and enter a different store number?"),
|
||||
"buyer" : MessageLookupByLibrary.simpleMessage("Buyer"),
|
||||
"card" : MessageLookupByLibrary.simpleMessage("Card"),
|
||||
"card_scaner" : MessageLookupByLibrary.simpleMessage("Card Scanner"),
|
||||
"carry_purchase" : MessageLookupByLibrary.simpleMessage("Сarrying out a purchase"),
|
||||
"complite_activ" : MessageLookupByLibrary.simpleMessage("Complete registration"),
|
||||
"complite_purchase" : MessageLookupByLibrary.simpleMessage("Complete purchase"),
|
||||
"confirm_purchase" : MessageLookupByLibrary.simpleMessage("You confirm the purchase for N USD"),
|
||||
"confirmation" : MessageLookupByLibrary.simpleMessage("Сonfirmation"),
|
||||
"no" : MessageLookupByLibrary.simpleMessage("No"),
|
||||
"purchase_complite" : MessageLookupByLibrary.simpleMessage("A purchase of N USD was complite"),
|
||||
"registration" : MessageLookupByLibrary.simpleMessage("Registration"),
|
||||
"request_sent_wait_activ" : MessageLookupByLibrary.simpleMessage("The activation request for the application has been sent, wait for confirm activation"),
|
||||
"reward" : MessageLookupByLibrary.simpleMessage("Reward"),
|
||||
"scan" : MessageLookupByLibrary.simpleMessage("Scan"),
|
||||
"sign_up" : MessageLookupByLibrary.simpleMessage("Sign Up"),
|
||||
"specify_din_store" : MessageLookupByLibrary.simpleMessage("Specify the DIN store"),
|
||||
"sum" : MessageLookupByLibrary.simpleMessage("Sum"),
|
||||
"update_activ_status" : MessageLookupByLibrary.simpleMessage("Update activation status"),
|
||||
"user_name" : MessageLookupByLibrary.simpleMessage("User name"),
|
||||
"yes" : MessageLookupByLibrary.simpleMessage("Yes")
|
||||
};
|
||||
}
|
||||
43
lib/i18n/stock_messages_messages_es.dart
Normal file
43
lib/i18n/stock_messages_messages_es.dart
Normal file
@@ -0,0 +1,43 @@
|
||||
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
|
||||
// This is a library that provides messages for a messages_es locale. All the
|
||||
// messages from the main program should be duplicated here with the same
|
||||
// function name.
|
||||
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:intl/message_lookup_by_library.dart';
|
||||
|
||||
final messages = new MessageLookup();
|
||||
|
||||
final _keepAnalysisHappy = Intl.defaultLocale;
|
||||
|
||||
class MessageLookup extends MessageLookupByLibrary {
|
||||
get localeName => 'messages_es';
|
||||
|
||||
final messages = _notInlinedMessages(_notInlinedMessages);
|
||||
static _notInlinedMessages(_) => {
|
||||
"ID_Store" : MessageLookupByLibrary.simpleMessage("DIN del negocio "),
|
||||
"ID_not_found" : MessageLookupByLibrary.simpleMessage("ID N no está encontrado"),
|
||||
"app_activ" : MessageLookupByLibrary.simpleMessage("Aplicación está activada"),
|
||||
"ask_change_store" : MessageLookupByLibrary.simpleMessage("¿Os realmente quiereis acabarse una sesión y dar otro DIN del negocio?"),
|
||||
"buyer" : MessageLookupByLibrary.simpleMessage("El comprador"),
|
||||
"card" : MessageLookupByLibrary.simpleMessage("Tarjeta"),
|
||||
"card_scaner" : MessageLookupByLibrary.simpleMessage("El escaneo de tarjeta"),
|
||||
"carry_purchase" : MessageLookupByLibrary.simpleMessage("Realizar la compra"),
|
||||
"complite_activ" : MessageLookupByLibrary.simpleMessage("Terminar el registro"),
|
||||
"complite_purchase" : MessageLookupByLibrary.simpleMessage("Terminar la compra"),
|
||||
"confirm_purchase" : MessageLookupByLibrary.simpleMessage("¿Confirmais la compra por N euros?"),
|
||||
"confirmation" : MessageLookupByLibrary.simpleMessage("Confirmacón"),
|
||||
"no" : MessageLookupByLibrary.simpleMessage("No"),
|
||||
"purchase_complite" : MessageLookupByLibrary.simpleMessage("La compra por N euros está realizada"),
|
||||
"registration" : MessageLookupByLibrary.simpleMessage("El registro"),
|
||||
"request_sent_wait_activ" : MessageLookupByLibrary.simpleMessage("El requieremento de activación de aplicación esta mandado, esperad la activación por el administrador."),
|
||||
"reward" : MessageLookupByLibrary.simpleMessage("Gratificación"),
|
||||
"scan" : MessageLookupByLibrary.simpleMessage("Escanear"),
|
||||
"sign_up" : MessageLookupByLibrary.simpleMessage("Registrarse"),
|
||||
"specify_din_store" : MessageLookupByLibrary.simpleMessage("Hay que dar DIN del negocio"),
|
||||
"sum" : MessageLookupByLibrary.simpleMessage("Suma"),
|
||||
"update_activ_status" : MessageLookupByLibrary.simpleMessage("Actualizar la condición de activación"),
|
||||
"user_name" : MessageLookupByLibrary.simpleMessage("Un nombre de usario"),
|
||||
"yes" : MessageLookupByLibrary.simpleMessage("Si")
|
||||
};
|
||||
}
|
||||
43
lib/i18n/stock_messages_messages_ru.dart
Normal file
43
lib/i18n/stock_messages_messages_ru.dart
Normal file
@@ -0,0 +1,43 @@
|
||||
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
|
||||
// This is a library that provides messages for a messages_ru locale. All the
|
||||
// messages from the main program should be duplicated here with the same
|
||||
// function name.
|
||||
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:intl/message_lookup_by_library.dart';
|
||||
|
||||
final messages = new MessageLookup();
|
||||
|
||||
final _keepAnalysisHappy = Intl.defaultLocale;
|
||||
|
||||
class MessageLookup extends MessageLookupByLibrary {
|
||||
get localeName => 'messages_ru';
|
||||
|
||||
final messages = _notInlinedMessages(_notInlinedMessages);
|
||||
static _notInlinedMessages(_) => {
|
||||
"ID_Store" : MessageLookupByLibrary.simpleMessage("DIN магазина"),
|
||||
"ID_not_found" : MessageLookupByLibrary.simpleMessage("Идентификатор N не найден"),
|
||||
"app_activ" : MessageLookupByLibrary.simpleMessage("Приложение активировано"),
|
||||
"ask_change_store" : MessageLookupByLibrary.simpleMessage("Вы действительно хотите выйти и ввести другой номер магазина?"),
|
||||
"buyer" : MessageLookupByLibrary.simpleMessage("Покупатель"),
|
||||
"card" : MessageLookupByLibrary.simpleMessage("Карта"),
|
||||
"card_scaner" : MessageLookupByLibrary.simpleMessage("Сканер карты"),
|
||||
"carry_purchase" : MessageLookupByLibrary.simpleMessage("Проведение покупки"),
|
||||
"complite_activ" : MessageLookupByLibrary.simpleMessage("Завершить регистрацию"),
|
||||
"complite_purchase" : MessageLookupByLibrary.simpleMessage("Завершить покупку"),
|
||||
"confirm_purchase" : MessageLookupByLibrary.simpleMessage("Вы подтверждаете покупку на N рублей"),
|
||||
"confirmation" : MessageLookupByLibrary.simpleMessage("Подтверждение"),
|
||||
"no" : MessageLookupByLibrary.simpleMessage("Нет"),
|
||||
"purchase_complite" : MessageLookupByLibrary.simpleMessage("Покупка на сумму N рублей проведена"),
|
||||
"registration" : MessageLookupByLibrary.simpleMessage("Регистрация"),
|
||||
"request_sent_wait_activ" : MessageLookupByLibrary.simpleMessage("Запрос на активацию приложения отправлен, дождитесь подтверждения активации администратором"),
|
||||
"reward" : MessageLookupByLibrary.simpleMessage("Вознаграждение"),
|
||||
"scan" : MessageLookupByLibrary.simpleMessage("Сканировать"),
|
||||
"sign_up" : MessageLookupByLibrary.simpleMessage("Зарегистрироваться"),
|
||||
"specify_din_store" : MessageLookupByLibrary.simpleMessage("Необходимо указать DIN магазина"),
|
||||
"sum" : MessageLookupByLibrary.simpleMessage("Сумма"),
|
||||
"update_activ_status" : MessageLookupByLibrary.simpleMessage("Обновить статус активации"),
|
||||
"user_name" : MessageLookupByLibrary.simpleMessage("ФИО"),
|
||||
"yes" : MessageLookupByLibrary.simpleMessage("Да")
|
||||
};
|
||||
}
|
||||
43
lib/i18n/stock_messages_messages_ua.dart
Normal file
43
lib/i18n/stock_messages_messages_ua.dart
Normal file
@@ -0,0 +1,43 @@
|
||||
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
|
||||
// This is a library that provides messages for a messages_ua locale. All the
|
||||
// messages from the main program should be duplicated here with the same
|
||||
// function name.
|
||||
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:intl/message_lookup_by_library.dart';
|
||||
|
||||
final messages = new MessageLookup();
|
||||
|
||||
final _keepAnalysisHappy = Intl.defaultLocale;
|
||||
|
||||
class MessageLookup extends MessageLookupByLibrary {
|
||||
get localeName => 'messages_ua';
|
||||
|
||||
final messages = _notInlinedMessages(_notInlinedMessages);
|
||||
static _notInlinedMessages(_) => {
|
||||
"ID_Store" : MessageLookupByLibrary.simpleMessage("DIN магазину"),
|
||||
"ID_not_found" : MessageLookupByLibrary.simpleMessage("Ідентифікатор N не знайден"),
|
||||
"app_activ" : MessageLookupByLibrary.simpleMessage("Додаток активований"),
|
||||
"ask_change_store" : MessageLookupByLibrary.simpleMessage("Ви дійсно хочете вийти і ввести інший номер магазину"),
|
||||
"buyer" : MessageLookupByLibrary.simpleMessage("Покупець"),
|
||||
"card" : MessageLookupByLibrary.simpleMessage("Карта"),
|
||||
"card_scaner" : MessageLookupByLibrary.simpleMessage("Сканер карти"),
|
||||
"carry_purchase" : MessageLookupByLibrary.simpleMessage("Проведення покупки"),
|
||||
"complite_activ" : MessageLookupByLibrary.simpleMessage("Завершити реєстрацію"),
|
||||
"complite_purchase" : MessageLookupByLibrary.simpleMessage("Завершити купівлю"),
|
||||
"confirm_purchase" : MessageLookupByLibrary.simpleMessage("Ви підтверджуєте покупку на N гривень"),
|
||||
"confirmation" : MessageLookupByLibrary.simpleMessage("Підтвердження"),
|
||||
"no" : MessageLookupByLibrary.simpleMessage("Ні"),
|
||||
"purchase_complite" : MessageLookupByLibrary.simpleMessage("Купівля на суму N гривень проведена"),
|
||||
"registration" : MessageLookupByLibrary.simpleMessage("Реєстрація"),
|
||||
"request_sent_wait_activ" : MessageLookupByLibrary.simpleMessage("Запит на активацію додатку відправлений, дочекайтеся підтвердження активації адміністратором"),
|
||||
"reward" : MessageLookupByLibrary.simpleMessage("Винагорода"),
|
||||
"scan" : MessageLookupByLibrary.simpleMessage("Сканувати"),
|
||||
"sign_up" : MessageLookupByLibrary.simpleMessage("Зареєструватися"),
|
||||
"specify_din_store" : MessageLookupByLibrary.simpleMessage("Необхідно вказати DIN магазину"),
|
||||
"sum" : MessageLookupByLibrary.simpleMessage("Сума"),
|
||||
"update_activ_status" : MessageLookupByLibrary.simpleMessage("Оновити статус активації"),
|
||||
"user_name" : MessageLookupByLibrary.simpleMessage("ПІБ"),
|
||||
"yes" : MessageLookupByLibrary.simpleMessage("Так")
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,17 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'splash.dart';
|
||||
import 'consts.dart';
|
||||
import 'stock_strings.dart';
|
||||
import 'dart:async';
|
||||
import 'i18n/stock_messages_all.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
Future<LocaleQueryData> _onLocaleChanged(Locale locale) async {
|
||||
final String localeString = locale.toString();
|
||||
await initializeMessages(localeString);
|
||||
Intl.defaultLocale = localeString;
|
||||
return StockStrings.instance;
|
||||
}
|
||||
|
||||
/// Точка входа в приложение.
|
||||
void main() {
|
||||
@@ -11,6 +22,7 @@ class Checker extends StatelessWidget {
|
||||
@override Widget build(BuildContext context) {
|
||||
return new MaterialApp(title: appName,
|
||||
home: new SplashScreen(),
|
||||
onLocaleChanged: _onLocaleChanged,
|
||||
theme: new ThemeData(
|
||||
primaryColor: primaryColor,
|
||||
accentColor: primaryColor
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'network.dart';
|
||||
import 'consts.dart';
|
||||
import 'activate_token.dart';
|
||||
import 'base_state.dart';
|
||||
import 'stock_strings.dart';
|
||||
|
||||
/// Экран регистрации магазина и кассы.
|
||||
class RegistrationScreen extends StatefulWidget {
|
||||
@@ -15,7 +16,7 @@ class RegistrationScreen extends StatefulWidget {
|
||||
class _RegistrationScreenState extends BaseState<RegistrationScreen> {
|
||||
|
||||
@override String getTitle() {
|
||||
return "Регистрация";
|
||||
return StockStrings.of(context).registration();
|
||||
}
|
||||
|
||||
@override getHint() {
|
||||
|
||||
39
lib/stock_strings.dart
Normal file
39
lib/stock_strings.dart
Normal file
@@ -0,0 +1,39 @@
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'dart:async';
|
||||
|
||||
class StockStrings extends LocaleQueryData {
|
||||
|
||||
static StockStrings of(BuildContext context) {
|
||||
return LocaleQuery.of(context);
|
||||
}
|
||||
|
||||
static final StockStrings instance = new StockStrings();
|
||||
|
||||
|
||||
String ID_Store() => Intl.message('ID_Store');
|
||||
String sign_up() => Intl.message('sign_up');
|
||||
String registration() => Intl.message('registration');
|
||||
String specify_din_store() => Intl.message('specify_din_store');
|
||||
String confirmation() => Intl.message('confirmation');
|
||||
String ask_change_store() => Intl.message('ask_change_store');
|
||||
String yes() => Intl.message('yes');
|
||||
String no() => Intl.message('no');
|
||||
String request_sent_wait_activ() => Intl.message('request_sent_wait_activ');
|
||||
String update_activ_status() => Intl.message('update_activ_status');
|
||||
String app_activ() => Intl.message('app_activ');
|
||||
String complite_activ() => Intl.message('complite_activ');
|
||||
String card_scaner() => Intl.message('card_scaner');
|
||||
String user_name() => Intl.message('user_name');
|
||||
String card() => Intl.message('card');
|
||||
String reward() => Intl.message('reward');
|
||||
String sum() => Intl.message('sum');
|
||||
String carry_purchase() => Intl.message('carry_purchase');
|
||||
String complite_purchase() => Intl.message('complite_purchase');
|
||||
String scan() => Intl.message('scan');
|
||||
String confirm_purchase() => Intl.message('confirm_purchase');
|
||||
String buyer() => Intl.message('buyer');
|
||||
String purchase_complite() => Intl.message('purchase_complite');
|
||||
String ID_not_found() => Intl.message('ID_not_found');
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user