RefreshLocalizations class
Implementation of localized strings for the ClassicHeader,ClassicFooter,TwoLevelHeader
Supported languages:now only add Chinese and English If you need to add other languages,please give me a pr
Sample code
To include the localizations provided by this class in a MaterialApp,
add RefreshLocalizations.delegates
to
MaterialApp.localizationsDelegates, and specify the locales your
app supports with MaterialApp.supportedLocales:
new MaterialApp(
localizationsDelegates: RefreshLocalizations.delegates,
supportedLocales: [
const Locale('en'), // American English
const Locale('zh'), // Israeli Hebrew
// ...
],
// ...
)
If you don't have the language you need here and you want to add it, you can give me a pr.
Steps:
1. custom a class XXRefreshString implements RefreshString ,and then translate them
2. add it into values
```dart
Map<String, RefreshString> values = {
'en': EnRefreshString(),
'zh': ChRefreshString(),
'fr': FrRefreshString(),
'ru': RuRefreshString(),
'uk': UkRefreshString(),
'xx':XXRefreshString(), // xx indicate your country code
};
3. update delegate a method "isSupported"
```dart
@override
see #175 to find more details
Constructors
- RefreshLocalizations(Locale locale)
Properties
- currentLocalization → RefreshString?
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- locale → Locale
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
values
↔ Map<
String, RefreshString> -
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
of(
BuildContext context) → RefreshLocalizations?
Constants
- delegate → const RefreshLocalizationsDelegate