Comments (4)
Same issue but I resolved it now, Because I forgot add asset in pubspec.yaml
assets:
- resources/langs/en-US.json
- resources/langs/th-TH.json
Hope this can help you.
from easy_localization.
The one thing can make your app to black screen is "EasyLocalizationProvider", You need to wrap everything with it like this.
Widget build(BuildContext context) {
var data = EasyLocalizationProvider.of(context).data;
data.changeLocale(Locale("th","TH"));
return EasyLocalizationProvider(
data: data,
child: MaterialApp(
...
...
from easy_localization.
yes, me too.
This happen during load in the delegate
EasylocaLizationDelegate
class EasylocaLizationDelegate extends LocalizationsDelegate<AppLocalizations> {
final Locale locale;
final String path;
final String loadPath;
/// * use only the lang code to generate i18n file path like en.json or ar.json
final bool useOnlyLangCode;
EasylocaLizationDelegate({
@required this.locale,
this.path,
this.loadPath,
this.useOnlyLangCode = false,
});
@override
bool isSupported(Locale locale) => locale != null;
@override
Future<AppLocalizations> load(Locale value) async {
final SharedPreferences _preferences =
await SharedPreferences.getInstance();
var _codeLang = _preferences.getString('codeL');
var _codeCoun = _preferences.getString('codeC');
if (_codeLang == null || _codeCoun == null) {
//value = Locale(this.locale.languageCode, this.locale.countryCode);
await _preferences.setString('codeC', value.countryCode);
await _preferences.setString('codeL', value.languageCode);
} else
value = Locale(_codeLang, _codeCoun);
AppLocalizations localizations = AppLocalizations(value,
path: path, loadPath: loadPath, useOnlyLangCode: useOnlyLangCode);
await localizations.load();
return localizations;
}
@override
bool shouldReload(LocalizationsDelegate<AppLocalizations> old) => true;
}
It would be useful to load delegate before the runApp method so the app would stay in its splash screen
from easy_localization.
anyone has solution for this?
from easy_localization.
Related Issues (20)
- Find unused translation keys
- How to use in isolate? HOT 1
- Triggering Easy Localization Package on iOS Language Change
- Using plural(0) count as other HOT 6
- BottomNavigationBarItem lable not change the language HOT 2
- Need callback finish EasyLocalization -> Load asset from assets/translations
- How can i create custom locals for unsupported langauges?
- How to change default "DateFormat('d').format" format HOT 1
- intl 0.19.0 doesn't work with easy_localizaiton version 3.0.5 HOT 10
- Missing features about easy localization HOT 1
- French translation Special Cahracters are not displayed correctly HOT 1
- How to set mutiple language for mutiple package in project?
- context.setLocale reverse to previous language with Easy localization HOT 1
- [Feature Request] ARB support for localization
- [Feature Request]: Support namespaces / multiple files per language
- resetLocal crashes if deviceLocale not in supportedLocales HOT 2
- ignore_for_file: constant_identifier_names when generate locale_keys.g.dart
- Localization not working on physical device
- strict countryCode problem HOT 2
- Can we generate locale keys in record form?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easy_localization.