Skip to content

Commit

Permalink
fix libya arabic and english name (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
mohn93 authored Sep 3, 2023
1 parent ab8b6c6 commit 8cbe02d
Show file tree
Hide file tree
Showing 12 changed files with 304 additions and 340 deletions.
24 changes: 12 additions & 12 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
url: "https://pub.dev"
source: hosted
version: "1.17.2"
version: "1.17.1"
diacritic:
dependency: transitive
description:
Expand Down Expand Up @@ -108,10 +108,10 @@ packages:
dependency: transitive
description:
name: intl
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6
url: "https://pub.dev"
source: hosted
version: "0.18.1"
version: "0.18.0"
js:
dependency: transitive
description:
Expand All @@ -132,18 +132,18 @@ packages:
dependency: transitive
description:
name: matcher
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb"
url: "https://pub.dev"
source: hosted
version: "0.12.16"
version: "0.12.15"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
url: "https://pub.dev"
source: hosted
version: "0.5.0"
version: "0.2.0"
meta:
dependency: transitive
description:
Expand Down Expand Up @@ -200,10 +200,10 @@ packages:
dependency: transitive
description:
name: source_span
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
url: "https://pub.dev"
source: hosted
version: "1.10.0"
version: "1.9.1"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -240,10 +240,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb
url: "https://pub.dev"
source: hosted
version: "0.6.0"
version: "0.5.1"
vector_graphics:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion lib/l10n/ar.arb
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"lt_": "ليتوانيا",
"lu_": "لوكسمبورغ",
"lv_": "لاتفيا",
"ly_": "الجماهيرية العربية الليبية",
"ly_": "ليبيا",
"ma_": "المغرب",
"mc_": "موناكو",
"md_": "مولدوفا",
Expand Down
2 changes: 1 addition & 1 deletion lib/l10n/en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"lt_": "Lithuania",
"lu_": "Luxembourg",
"lv_": "Latvia",
"ly_": "Libyan Arab Jamahiriya",
"ly_": "Libya",
"ma_": "Morocco",
"mc_": "Monaco",
"md_": "Moldova",
Expand Down
97 changes: 33 additions & 64 deletions lib/l10n/generated/phone_field_localization.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import 'phone_field_localization_de.dart';
import 'phone_field_localization_el.dart';
import 'phone_field_localization_en.dart';
import 'phone_field_localization_es.dart';
import 'phone_field_localization_fa.dart';
import 'phone_field_localization_fr.dart';
import 'phone_field_localization_hi.dart';
import 'phone_field_localization_it.dart';
Expand Down Expand Up @@ -73,18 +74,15 @@ import 'phone_field_localization_zh.dart';
/// be consistent with the languages listed in the PhoneFieldLocalization.supportedLocales
/// property.
abstract class PhoneFieldLocalization {
PhoneFieldLocalization(String locale)
: localeName = intl.Intl.canonicalizedLocale(locale.toString());
PhoneFieldLocalization(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString());

final String localeName;

static PhoneFieldLocalization? of(BuildContext context) {
return Localizations.of<PhoneFieldLocalization>(
context, PhoneFieldLocalization);
return Localizations.of<PhoneFieldLocalization>(context, PhoneFieldLocalization);
}

static const LocalizationsDelegate<PhoneFieldLocalization> delegate =
_PhoneFieldLocalizationDelegate();
static const LocalizationsDelegate<PhoneFieldLocalization> delegate = _PhoneFieldLocalizationDelegate();

/// A list of this localizations delegate along with the default localizations
/// delegates.
Expand All @@ -96,8 +94,7 @@ abstract class PhoneFieldLocalization {
/// Additional delegates can be added by appending to this list in
/// MaterialApp. This list does not have to be used at all if a custom list
/// of delegates is preferred or required.
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates =
<LocalizationsDelegate<dynamic>>[
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates = <LocalizationsDelegate<dynamic>>[
delegate,
GlobalMaterialLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
Expand All @@ -111,6 +108,7 @@ abstract class PhoneFieldLocalization {
Locale('el'),
Locale('en'),
Locale('es'),
Locale('fa'),
Locale('fr'),
Locale('hi'),
Locale('it'),
Expand Down Expand Up @@ -960,7 +958,7 @@ abstract class PhoneFieldLocalization {
/// No description provided for @ly_.
///
/// In en, this message translates to:
/// **'Libyan Arab Jamahiriya'**
/// **'Libya'**
String get ly_;

/// No description provided for @ma_.
Expand Down Expand Up @@ -1618,77 +1616,48 @@ abstract class PhoneFieldLocalization {
String get zw_;
}

class _PhoneFieldLocalizationDelegate
extends LocalizationsDelegate<PhoneFieldLocalization> {
class _PhoneFieldLocalizationDelegate extends LocalizationsDelegate<PhoneFieldLocalization> {
const _PhoneFieldLocalizationDelegate();

@override
Future<PhoneFieldLocalization> load(Locale locale) {
return SynchronousFuture<PhoneFieldLocalization>(
lookupPhoneFieldLocalization(locale));
return SynchronousFuture<PhoneFieldLocalization>(lookupPhoneFieldLocalization(locale));
}

@override
bool isSupported(Locale locale) => <String>[
'ar',
'de',
'el',
'en',
'es',
'fr',
'hi',
'it',
'nl',
'pt',
'ru',
'sv',
'tr',
'uk',
'zh'
].contains(locale.languageCode);
bool isSupported(Locale locale) => <String>['ar', 'de', 'el', 'en', 'es', 'fa', 'fr', 'hi', 'it', 'nl', 'pt', 'ru', 'sv', 'tr', 'uk', 'zh'].contains(locale.languageCode);

@override
bool shouldReload(_PhoneFieldLocalizationDelegate old) => false;
}

PhoneFieldLocalization lookupPhoneFieldLocalization(Locale locale) {


// Lookup logic when only language code is specified.
switch (locale.languageCode) {
case 'ar':
return PhoneFieldLocalizationAr();
case 'de':
return PhoneFieldLocalizationDe();
case 'el':
return PhoneFieldLocalizationEl();
case 'en':
return PhoneFieldLocalizationEn();
case 'es':
return PhoneFieldLocalizationEs();
case 'fr':
return PhoneFieldLocalizationFr();
case 'hi':
return PhoneFieldLocalizationHi();
case 'it':
return PhoneFieldLocalizationIt();
case 'nl':
return PhoneFieldLocalizationNl();
case 'pt':
return PhoneFieldLocalizationPt();
case 'ru':
return PhoneFieldLocalizationRu();
case 'sv':
return PhoneFieldLocalizationSv();
case 'tr':
return PhoneFieldLocalizationTr();
case 'uk':
return PhoneFieldLocalizationUk();
case 'zh':
return PhoneFieldLocalizationZh();
case 'ar': return PhoneFieldLocalizationAr();
case 'de': return PhoneFieldLocalizationDe();
case 'el': return PhoneFieldLocalizationEl();
case 'en': return PhoneFieldLocalizationEn();
case 'es': return PhoneFieldLocalizationEs();
case 'fa': return PhoneFieldLocalizationFa();
case 'fr': return PhoneFieldLocalizationFr();
case 'hi': return PhoneFieldLocalizationHi();
case 'it': return PhoneFieldLocalizationIt();
case 'nl': return PhoneFieldLocalizationNl();
case 'pt': return PhoneFieldLocalizationPt();
case 'ru': return PhoneFieldLocalizationRu();
case 'sv': return PhoneFieldLocalizationSv();
case 'tr': return PhoneFieldLocalizationTr();
case 'uk': return PhoneFieldLocalizationUk();
case 'zh': return PhoneFieldLocalizationZh();
}

throw FlutterError(
'PhoneFieldLocalization.delegate failed to load unsupported locale "$locale". This is likely '
'an issue with the localizations generation tool. Please file an issue '
'on GitHub with a reproducible sample app and the gen-l10n configuration '
'that was used.');
'PhoneFieldLocalization.delegate failed to load unsupported locale "$locale". This is likely '
'an issue with the localizations generation tool. Please file an issue '
'on GitHub with a reproducible sample app and the gen-l10n configuration '
'that was used.'
);
}
6 changes: 3 additions & 3 deletions lib/l10n/generated/phone_field_localization_ar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class PhoneFieldLocalizationAr extends PhoneFieldLocalization {
String get bo_ => 'بوليفيا ، دولة متعددة القوميات';

@override
String get bq_ => 'Bonaire';
String get bq_ => 'بونير';

@override
String get br_ => 'البرازيل';
Expand Down Expand Up @@ -422,7 +422,7 @@ class PhoneFieldLocalizationAr extends PhoneFieldLocalization {
String get lv_ => 'لاتفيا';

@override
String get ly_ => 'الجماهيرية العربية الليبية';
String get ly_ => 'ليبيا';

@override
String get ma_ => 'المغرب';
Expand Down Expand Up @@ -647,7 +647,7 @@ class PhoneFieldLocalizationAr extends PhoneFieldLocalization {
String get sz_ => 'سوازيلاند';

@override
String get ta_ => 'Tristan da Cunha';
String get ta_ => 'تريستان دا كونها';

@override
String get tc_ => 'جزر تركس وكايكوس';
Expand Down
3 changes: 1 addition & 2 deletions lib/l10n/generated/phone_field_localization_el.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ class PhoneFieldLocalizationEl extends PhoneFieldLocalization {
String get invalidMobilePhoneNumber => 'Μη έγκυρος αριθμός κινητού τηλεφώνου';

@override
String get invalidFixedLinePhoneNumber =>
'Μη έγκυρος αριθμός σταθερού τηλεφώνου';
String get invalidFixedLinePhoneNumber => 'Μη έγκυρος αριθμός σταθερού τηλεφώνου';

@override
String get requiredPhoneNumber => 'Απαιτούμενος αριθμός τηλεφώνου';
Expand Down
2 changes: 1 addition & 1 deletion lib/l10n/generated/phone_field_localization_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ class PhoneFieldLocalizationEn extends PhoneFieldLocalization {
String get lv_ => 'Latvia';

@override
String get ly_ => 'Libyan Arab Jamahiriya';
String get ly_ => 'Libya';

@override
String get ma_ => 'Morocco';
Expand Down
Loading

0 comments on commit 8cbe02d

Please sign in to comment.