问题
I am new to flutter. I want to get the support for Japanese language for the application. I followed the example listed here; https://medium.com/flutter-community/flutter-internationalization-the-easy-way-using-provider-and-json-c47caa4212b2
It works perfectly for Arabic language listed there, but when i try the same for Japanese. It does not work.
Only thing I did was modify to include 'jp' locale
return MaterialApp(
locale: model.appLocal,
supportedLocales: [
Locale('en', 'US'),
Locale('jp', 'JP'),
],
localizationsDelegates: [
AppLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
home: AppLang(),
);
...
@override
bool isSupported(Locale locale) {
// Include all of your supported language codes here
return ['en', 'jp'].contains(locale.languageCode);
}
getting error
I/flutter (20037): Warning: This application's locale, jp, is not supported by all of its
I/flutter (20037): localization delegates.
I/flutter (20037): > A MaterialLocalizations delegate that supports the jp locale was not found.
I/flutter (20037): See https://flutter.dev/tutorials/internationalization/ for more
I/flutter (20037): information about configuring an app's locale, supportedLocales,
I/flutter (20037): and localizationsDelegates parameters.
I found information that state there is advance locale support https://flutter.dev/docs/development/accessibility-and-localization/internationalization But no information no how to do it.
Can anyone provide some help on this?
来源:https://stackoverflow.com/questions/62540699/flutter-internationalization-for-japanese-failed