Skip to content

Commit

Permalink
Fix l10n.dart generator for country only langs
Browse files Browse the repository at this point in the history
  • Loading branch information
Albert221 committed Jun 22, 2020
1 parent abbe2da commit 624e67e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/src/generator/l10n_dart_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ class S {
static const delegate = ArbifyLocalizationsDelegate();
static Future<S> load(Locale locale) {
final name = locale.countryCode.isEmpty ? locale.languageCode : locale.toString();
final localeName = Intl.canonicalizedLocale(name);
final localeName = Intl.canonicalizedLocale(locale.toString());
return initializeMessages(localeName).then((_) {
Intl.defaultLocale = localeName;
Expand Down Expand Up @@ -114,7 +113,8 @@ $supportedLocales ];
final languageCode = "languageCode: '${locale.language}'";
final scriptCode =
locale.script == null ? '' : ", scriptCode: '${locale.script}'";
final countryCode = ", countryCode: '${locale.region ?? ''}'";
final countryCode =
locale.script == null ? '' : ", countryCode: '${locale.region}'";

supportedLocales.writeln(
' Locale.fromSubtags($languageCode$scriptCode$countryCode),');
Expand Down

0 comments on commit 624e67e

Please sign in to comment.