diff --git a/checker.sublime-workspace b/checker.sublime-workspace index 9febbcd..f516e7e 100644 --- a/checker.sublime-workspace +++ b/checker.sublime-workspace @@ -19,132 +19,6 @@ }, "buffers": [ - { - "file": "lib/base_state.dart", - "settings": - { - "buffer_size": 5449, - "encoding": "UTF-8", - "line_ending": "Unix" - } - }, - { - "file": "lib/main.dart", - "settings": - { - "buffer_size": 439, - "encoding": "UTF-8", - "line_ending": "Unix" - } - }, - { - "file": "lib/network.dart", - "settings": - { - "buffer_size": 926, - "encoding": "UTF-8", - "line_ending": "Unix" - } - }, - { - "file": "pubspec.yaml", - "settings": - { - "buffer_size": 1885, - "encoding": "UTF-8", - "line_ending": "Unix" - } - }, - { - "file": "lib/purchase.dart", - "settings": - { - "buffer_size": 5304, - "encoding": "UTF-8", - "line_ending": "Unix" - } - }, - { - "file": "lib/registration.dart", - "settings": - { - "buffer_size": 2467, - "encoding": "UTF-8", - "line_ending": "Unix" - } - }, - { - "file": "android/app/src/main/java/com/dinect/checker/activity/MainActivity.java", - "settings": - { - "buffer_size": 6565, - "encoding": "UTF-8", - "line_ending": "Unix" - } - }, - { - "file": "lib/activate_token.dart", - "settings": - { - "buffer_size": 3295, - "encoding": "UTF-8", - "line_ending": "Unix" - } - }, - { - "file": "lib/common.dart", - "settings": - { - "buffer_size": 3529, - "encoding": "UTF-8", - "line_ending": "Unix" - } - }, - { - "file": "lib/consts.dart", - "settings": - { - "buffer_size": 1494, - "encoding": "UTF-8", - "line_ending": "Unix" - } - }, - { - "file": "android/app/src/main/AndroidManifest.xml", - "settings": - { - "buffer_size": 2161, - "encoding": "UTF-8", - "line_ending": "Unix" - } - }, - { - "file": "lib/splash.dart", - "settings": - { - "buffer_size": 3493, - "encoding": "UTF-8", - "line_ending": "Unix" - } - }, - { - "file": "lib/faq.dart", - "settings": - { - "buffer_size": 4681, - "encoding": "UTF-8", - "line_ending": "Unix" - } - }, - { - "file": "android/app/src/main/java/com/dinect/checker/activity/CameraActivity.java", - "settings": - { - "buffer_size": 13352, - "encoding": "UTF-8", - "line_ending": "Unix" - } - } ], "build_system": "", "build_system_choices": @@ -153,7 +27,7 @@ "build_varint": "", "command_palette": { - "height": 359.0, + "height": 392.0, "last_filter": "packa", "selected_items": [ @@ -186,23 +60,24 @@ }, "expanded_folders": [ - "/Users/kifio/FlutterProjects/checker", - "/Users/kifio/FlutterProjects/checker/android", - "/Users/kifio/FlutterProjects/checker/android/app", - "/Users/kifio/FlutterProjects/checker/android/app/src", - "/Users/kifio/FlutterProjects/checker/android/app/src/main", - "/Users/kifio/FlutterProjects/checker/android/app/src/main/java", - "/Users/kifio/FlutterProjects/checker/android/app/src/main/java/com", - "/Users/kifio/FlutterProjects/checker/android/app/src/main/java/com/dinect", - "/Users/kifio/FlutterProjects/checker/android/app/src/main/java/com/dinect/checker", - "/Users/kifio/FlutterProjects/checker/android/app/src/main/java/com/dinect/checker/activity", - "/Users/kifio/FlutterProjects/checker/android/app/src/main/res", - "/Users/kifio/FlutterProjects/checker/android/app/src/main/res/menu", - "/Users/kifio/FlutterProjects/checker/assets", - "/Users/kifio/FlutterProjects/checker/lib" + "/home/kifio/checker" ], "file_history": [ + "/home/kifio/checker/lib/purchase.dart", + "/home/kifio/checker/lib/base_state.dart", + "/home/kifio/checker/lib/main.dart", + "/home/kifio/checker/lib/network.dart", + "/home/kifio/checker/pubspec.yaml", + "/home/kifio/checker/lib/registration.dart", + "/home/kifio/checker/lib/activate_token.dart", + "/home/kifio/checker/lib/common.dart", + "/home/kifio/checker/lib/consts.dart", + "/home/kifio/checker/android/app/src/main/AndroidManifest.xml", + "/home/kifio/checker/lib/splash.dart", + "/home/kifio/checker/lib/faq.dart", + "/home/kifio/checker/android/app/src/main/java/com/dinect/checker/activity/CameraActivity.java", + "/home/kifio/checker/android/app/src/main/java/com/dinect/checker/activity/MainActivity.java", "/Users/kifio/FlutterProjects/checker/lib/consts.dart", "/Users/kifio/FlutterProjects/checker/lib/activate_token.dart", "/Users/kifio/FlutterProjects/checker/lib/registration.dart", @@ -218,7 +93,7 @@ ], "find": { - "height": 35.0 + "height": 23.0 }, "find_in_files": { @@ -270,434 +145,14 @@ "groups": [ { - "selected": 10, "sheets": [ - { - "buffer": 0, - "file": "lib/base_state.dart", - "semi_transient": false, - "settings": - { - "buffer_size": 5449, - "regions": - { - }, - "selection": - [ - [ - 886, - 886 - ] - ], - "settings": - { - "auto_name": "", - "syntax": "Packages/Dart/Dart.tmLanguage", - "tab_size": 2, - "translate_tabs_to_spaces": true - }, - "translation.x": 0.0, - "translation.y": 976.0, - "zoom_level": 1.0 - }, - "stack_index": 10, - "type": "text" - }, - { - "buffer": 1, - "file": "lib/main.dart", - "semi_transient": false, - "settings": - { - "buffer_size": 439, - "regions": - { - }, - "selection": - [ - [ - 83, - 83 - ] - ], - "settings": - { - "syntax": "Packages/Dart/Dart.tmLanguage", - "tab_size": 2, - "translate_tabs_to_spaces": true - }, - "translation.x": 0.0, - "translation.y": 0.0, - "zoom_level": 1.0 - }, - "stack_index": 13, - "type": "text" - }, - { - "buffer": 2, - "file": "lib/network.dart", - "semi_transient": false, - "settings": - { - "buffer_size": 926, - "regions": - { - }, - "selection": - [ - [ - 926, - 926 - ] - ], - "settings": - { - "syntax": "Packages/Dart/Dart.tmLanguage", - "tab_size": 2, - "translate_tabs_to_spaces": true - }, - "translation.x": 0.0, - "translation.y": 0.0, - "zoom_level": 1.0 - }, - "stack_index": 6, - "type": "text" - }, - { - "buffer": 3, - "file": "pubspec.yaml", - "semi_transient": false, - "settings": - { - "buffer_size": 1885, - "regions": - { - }, - "selection": - [ - [ - 916, - 916 - ] - ], - "settings": - { - "syntax": "Packages/Dart/Pubspec.tmLanguage", - "tab_size": 2, - "translate_tabs_to_spaces": true - }, - "translation.x": 0.0, - "translation.y": 0.0, - "zoom_level": 1.0 - }, - "stack_index": 5, - "type": "text" - }, - { - "buffer": 4, - "file": "lib/purchase.dart", - "semi_transient": false, - "settings": - { - "buffer_size": 5304, - "regions": - { - }, - "selection": - [ - [ - 0, - 0 - ] - ], - "settings": - { - "syntax": "Packages/Dart/Dart.tmLanguage", - "tab_size": 2, - "translate_tabs_to_spaces": true - }, - "translation.x": 0.0, - "translation.y": 0.0, - "zoom_level": 1.0 - }, - "stack_index": 7, - "type": "text" - }, - { - "buffer": 5, - "file": "lib/registration.dart", - "semi_transient": false, - "settings": - { - "buffer_size": 2467, - "regions": - { - }, - "selection": - [ - [ - 1877, - 1877 - ] - ], - "settings": - { - "syntax": "Packages/Dart/Dart.tmLanguage", - "tab_size": 2, - "translate_tabs_to_spaces": true - }, - "translation.x": 0.0, - "translation.y": 0.0, - "zoom_level": 1.0 - }, - "stack_index": 8, - "type": "text" - }, - { - "buffer": 6, - "file": "android/app/src/main/java/com/dinect/checker/activity/MainActivity.java", - "semi_transient": false, - "settings": - { - "buffer_size": 6565, - "regions": - { - }, - "selection": - [ - [ - 5764, - 5764 - ] - ], - "settings": - { - "syntax": "Packages/Java/Java.sublime-syntax", - "tab_size": 4, - "translate_tabs_to_spaces": true - }, - "translation.x": 0.0, - "translation.y": 1245.0, - "zoom_level": 1.0 - }, - "stack_index": 12, - "type": "text" - }, - { - "buffer": 7, - "file": "lib/activate_token.dart", - "semi_transient": false, - "settings": - { - "buffer_size": 3295, - "regions": - { - }, - "selection": - [ - [ - 124, - 124 - ] - ], - "settings": - { - "syntax": "Packages/Dart/Dart.tmLanguage", - "tab_size": 2, - "translate_tabs_to_spaces": true - }, - "translation.x": 0.0, - "translation.y": 8.0, - "zoom_level": 1.0 - }, - "stack_index": 11, - "type": "text" - }, - { - "buffer": 8, - "file": "lib/common.dart", - "semi_transient": false, - "settings": - { - "buffer_size": 3529, - "regions": - { - }, - "selection": - [ - [ - 1136, - 1136 - ] - ], - "settings": - { - "syntax": "Packages/Dart/Dart.tmLanguage", - "tab_size": 2, - "translate_tabs_to_spaces": true - }, - "translation.x": 0.0, - "translation.y": 0.0, - "zoom_level": 1.0 - }, - "stack_index": 9, - "type": "text" - }, - { - "buffer": 9, - "file": "lib/consts.dart", - "semi_transient": false, - "settings": - { - "buffer_size": 1494, - "regions": - { - }, - "selection": - [ - [ - 358, - 358 - ] - ], - "settings": - { - "syntax": "Packages/Dart/Dart.tmLanguage" - }, - "translation.x": 0.0, - "translation.y": 0.0, - "zoom_level": 1.0 - }, - "stack_index": 1, - "type": "text" - }, - { - "buffer": 10, - "file": "android/app/src/main/AndroidManifest.xml", - "semi_transient": false, - "settings": - { - "buffer_size": 2161, - "regions": - { - }, - "selection": - [ - [ - 160, - 160 - ] - ], - "settings": - { - "syntax": "Packages/XML/XML.sublime-syntax", - "tab_size": 2, - "translate_tabs_to_spaces": true - }, - "translation.x": 0.0, - "translation.y": 0.0, - "zoom_level": 1.0 - }, - "stack_index": 0, - "type": "text" - }, - { - "buffer": 11, - "file": "lib/splash.dart", - "semi_transient": false, - "settings": - { - "buffer_size": 3493, - "regions": - { - }, - "selection": - [ - [ - 812, - 797 - ] - ], - "settings": - { - "syntax": "Packages/Dart/Dart.tmLanguage", - "tab_size": 2, - "translate_tabs_to_spaces": true - }, - "translation.x": 0.0, - "translation.y": 0.0, - "zoom_level": 1.0 - }, - "stack_index": 4, - "type": "text" - }, - { - "buffer": 12, - "file": "lib/faq.dart", - "semi_transient": false, - "settings": - { - "buffer_size": 4681, - "regions": - { - }, - "selection": - [ - [ - 39, - 39 - ] - ], - "settings": - { - "syntax": "Packages/Dart/Dart.tmLanguage", - "tab_size": 2, - "translate_tabs_to_spaces": true - }, - "translation.x": 0.0, - "translation.y": 0.0, - "zoom_level": 1.0 - }, - "stack_index": 3, - "type": "text" - }, - { - "buffer": 13, - "file": "android/app/src/main/java/com/dinect/checker/activity/CameraActivity.java", - "semi_transient": false, - "settings": - { - "buffer_size": 13352, - "regions": - { - }, - "selection": - [ - [ - 10606, - 10606 - ] - ], - "settings": - { - "syntax": "Packages/Java/Java.sublime-syntax", - "tab_size": 4, - "translate_tabs_to_spaces": true - }, - "translation.x": 0.0, - "translation.y": 4935.0, - "zoom_level": 1.0 - }, - "stack_index": 2, - "type": "text" - } ] } ], "incremental_find": { - "height": 25.0 + "height": 23.0 }, "input": { @@ -734,7 +189,7 @@ "project": "checker.sublime-project", "replace": { - "height": 46.0 + "height": 42.0 }, "save_all_on_build": true, "select_file": diff --git a/lib/consts.dart b/lib/consts.dart index 1ac4a54..ddd9dd9 100644 --- a/lib/consts.dart +++ b/lib/consts.dart @@ -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'; diff --git a/lib/i18n/stock_messages_all.dart b/lib/i18n/stock_messages_all.dart new file mode 100644 index 0000000..ee60501 --- /dev/null +++ b/lib/i18n/stock_messages_all.dart @@ -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 LibraryLoader(); +Map _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); +} diff --git a/lib/i18n/stock_messages_messages_en.dart b/lib/i18n/stock_messages_messages_en.dart new file mode 100644 index 0000000..35821af --- /dev/null +++ b/lib/i18n/stock_messages_messages_en.dart @@ -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") + }; +} diff --git a/lib/i18n/stock_messages_messages_es.dart b/lib/i18n/stock_messages_messages_es.dart new file mode 100644 index 0000000..5322a7a --- /dev/null +++ b/lib/i18n/stock_messages_messages_es.dart @@ -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") + }; +} diff --git a/lib/i18n/stock_messages_messages_ru.dart b/lib/i18n/stock_messages_messages_ru.dart new file mode 100644 index 0000000..1ee157a --- /dev/null +++ b/lib/i18n/stock_messages_messages_ru.dart @@ -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("Да") + }; +} diff --git a/lib/i18n/stock_messages_messages_ua.dart b/lib/i18n/stock_messages_messages_ua.dart new file mode 100644 index 0000000..747a98a --- /dev/null +++ b/lib/i18n/stock_messages_messages_ua.dart @@ -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("Так") + }; +} diff --git a/lib/main.dart b/lib/main.dart index 10f340d..8c0fcca 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -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 _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 diff --git a/lib/registration.dart b/lib/registration.dart index e217134..5fbbb17 100644 --- a/lib/registration.dart +++ b/lib/registration.dart @@ -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 { @override String getTitle() { - return "Регистрация"; + return StockStrings.of(context).registration(); } @override getHint() { diff --git a/lib/stock_strings.dart b/lib/stock_strings.dart new file mode 100644 index 0000000..984f813 --- /dev/null +++ b/lib/stock_strings.dart @@ -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'); + +} diff --git a/pubspec.yaml b/pubspec.yaml index 3adbe6a..2a279a2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,6 +3,8 @@ description: A new Flutter project. dependencies: http: '>=0.11.3+12' + intl: '>=0.14.0 <0.16.0' + intl_translation: '>=0.14.0 <0.16.0' flutter: sdk: flutter