I suggest the following fix to match the standard given by Flutter in the previous URL.
In /lib/src/all_languages.dart:
final localizations = <String, FirebaseUILocalizationLabels>{
...
'zh': const ZhLocalizations(), // Simplified Chinese
'zh_Hans': const ZhLocalizations(), // Simplified Chinese
'zh_Hant': const ZhTWLocalizations(), // Traditional Chinese
'zh_Hans_CN': const ZhLocalizations(), // Simplified Chinese
'zh_Hant_TW': const ZhTWLocalizations(), // Traditional Chinese
'zh_Hant_HK': const ZhTWLocalizations(), // Traditional Chinese
...
};
In /lib/src/l10n.dart:
@override
Future<FirebaseUILocalizations> load(Locale locale) {
late FirebaseUILocalizationLabels labels;
final key = locale.languageCode;
// Change this line to include script code
final scriptCode = locale.scriptCode;
final countryCode = locale.countryCode;
var fullKey = key;
scriptCode != null ? fullKey += '_$scriptCode' : null;
countryCode != null ? fullKey += '_$countryCode' : null;
...
}
Traditional Chinese will not be loaded in Firebase UI Auth using the standard locales as described here. (Simplified Chinese can be properly loaded).
This issue is caused by the non-standard key
zh_tw
In /lib/src/all_languages.dart (see below). It should have beenzh_TW
.I suggest the following fix to match the standard given by Flutter in the previous URL.
In /lib/src/all_languages.dart:
In /lib/src/l10n.dart: