Продолжаю разбираться с локализацией
This commit is contained in:
@@ -1,43 +1,45 @@
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:sprintf/sprintf.dart';
|
||||
import 'i18n/messages_all.dart';
|
||||
import 'dart:async';
|
||||
|
||||
class Strings extends LocaleQueryData {
|
||||
class Strings {
|
||||
|
||||
static Strings of(BuildContext context) {
|
||||
return LocaleQuery.of(context);
|
||||
static final Strings _singleton = new Strings._internal();
|
||||
|
||||
String _localeName;
|
||||
|
||||
factory Strings(){
|
||||
return _singleton;
|
||||
}
|
||||
|
||||
static final Strings instance = new Strings();
|
||||
Strings._internal();
|
||||
|
||||
String confirmPurchase(String val) {
|
||||
return sprintf(Intl.message('confirm_purchase'), val);
|
||||
Future load(String locale) async {
|
||||
_localeName = locale;
|
||||
return initializeMessages(locale);
|
||||
}
|
||||
|
||||
String purchaseCompleted(String val) {
|
||||
return sprintf(Intl.message('purchase_complite'), val);
|
||||
}
|
||||
|
||||
String idStore() => Intl.message('ID_Store');
|
||||
String signUp() => Intl.message('sign_up');
|
||||
String registration() => Intl.message('registration');
|
||||
String specifyDinStore() => Intl.message('specify_din_store');
|
||||
String confirmation() => Intl.message('confirmation');
|
||||
String askChangeStore() => Intl.message('ask_change_store');
|
||||
String yes() => Intl.message('yes');
|
||||
String no() => Intl.message('no');
|
||||
String requestSentWaitActivation() => Intl.message('request_sent_wait_activ');
|
||||
String refreshActivationStatus() => Intl.message('update_activ_status');
|
||||
String appActivated() => Intl.message('app_activ');
|
||||
String completeRegistration() => Intl.message('complite_activ');
|
||||
String cardScanner() => Intl.message('card_scaner');
|
||||
String userName() => Intl.message('user_name');
|
||||
String card() => Intl.message('card');
|
||||
String reward() => Intl.message('reward');
|
||||
String sum() => Intl.message('sum');
|
||||
String carryingPurchase() => Intl.message('carry_purchase');
|
||||
String completePurchase() => Intl.message('complite_purchase');
|
||||
String scan() => Intl.message('scan');
|
||||
String buyer() => Intl.message('buyer');
|
||||
String idNotFound() => Intl.message('ID_not_found');
|
||||
String registration() => Intl.message('registration', name: 'registration', locale: _localeName);
|
||||
String idStore() => Intl.message('ID_Store', name: 'ID_Store', locale: _localeName);
|
||||
String signUp() => Intl.message('sign_up', name: 'sign_up', locale: _localeName);
|
||||
String specifyDinStore() => Intl.message('specify_din_store', name: 'specify_din_store', locale: _localeName);
|
||||
String confirmation() => Intl.message('confirmation', name: 'confirmation', locale: _localeName);
|
||||
String askChangeStore() => Intl.message('ask_change_store', name: 'ask_change_store', locale: _localeName);
|
||||
String yes() => Intl.message('yes', name: 'yes', locale: _localeName);
|
||||
String no() => Intl.message('no', name: 'no', locale: _localeName);
|
||||
String requestSentWaitActivation() => Intl.message('request_sent_wait_activ', name: 'request_sent_wait_activ', locale: _localeName);
|
||||
String refreshActivationStatus() => Intl.message('update_activ_status', name: 'update_activ_status', locale: _localeName);
|
||||
String appActivated() => Intl.message('app_activ', name: 'app_activ', locale: _localeName);
|
||||
String completeRegistration() => Intl.message('complite_activ', name: 'complite_activ', locale: _localeName);
|
||||
String cardScanner() => Intl.message('card_scaner', name: 'card_scaner', locale: _localeName);
|
||||
String userName() => Intl.message('user_name', name: 'user_name', locale: _localeName);
|
||||
String card() => Intl.message('card', name: 'card', locale: _localeName);
|
||||
String reward() => Intl.message('reward', name: 'reward', locale: _localeName);
|
||||
String sum() => Intl.message('sum', name: 'sum', locale: _localeName);
|
||||
String carryingPurchase() => Intl.message('carry_purchase', name: 'carry_purchase', locale: _localeName);
|
||||
String completePurchase() => Intl.message('complite_purchase', name: 'complite_purchase', locale: _localeName);
|
||||
String scan() => Intl.message('scan', name: 'scan', locale: _localeName);
|
||||
String buyer() => Intl.message('buyer', name: 'buyer', locale: _localeName);
|
||||
String confirmPurchase() => Intl.message('confirm_purchase', name: 'confirm_purchase', locale: _localeName);
|
||||
String idNotFound() => Intl.message('ID_not_found', name: 'ID_not_found', locale: _localeName);
|
||||
}
|
||||
Reference in New Issue
Block a user