Skip to content

Commit 0c26444

Browse files
committed
Revert "Use Localizely's intl_utils package for localization instead of less maintained intl_translation"
This reverts commit 689e6a0.
1 parent 689e6a0 commit 0c26444

26 files changed

+691
-748
lines changed

lib/flutter_form_builder.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export 'package:flutter_typeahead/flutter_typeahead.dart';
44
export 'package:signature/signature.dart';
55
export 'package:dropdown_search/dropdown_search.dart' hide ErrorBuilder;
66

7-
export './localization/l10n.dart';
7+
export './localization/form_builder_localizations.dart';
88
export './src/fields/form_builder_checkbox.dart';
99
export './src/fields/form_builder_checkbox_group.dart';
1010
export './src/fields/form_builder_chips_input.dart';

lib/localization/intl/messages_all.dart renamed to lib/l10n/messages_all.dart

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import 'messages_de.dart' as messages_de;
1919
import 'messages_en.dart' as messages_en;
2020
import 'messages_es.dart' as messages_es;
2121
import 'messages_fr.dart' as messages_fr;
22-
import 'messages_hu.dart' as messages_hu;
2322
import 'messages_it.dart' as messages_it;
2423
import 'messages_ja.dart' as messages_ja;
2524
import 'messages_messages.dart' as messages_messages;
@@ -33,13 +32,12 @@ Map<String, LibraryLoader> _deferredLibraries = {
3332
'en': () => new Future.value(null),
3433
'es': () => new Future.value(null),
3534
'fr': () => new Future.value(null),
36-
'hu': () => new Future.value(null),
3735
'it': () => new Future.value(null),
3836
'ja': () => new Future.value(null),
3937
'messages': () => new Future.value(null),
40-
'pl': () => new Future.value(null),
4138
'pt': () => new Future.value(null),
4239
'sk': () => new Future.value(null),
40+
'pl': () => new Future.value(null),
4341
};
4442

4543
MessageLookupByLibrary _findExact(String localeName) {
@@ -52,20 +50,18 @@ MessageLookupByLibrary _findExact(String localeName) {
5250
return messages_es.messages;
5351
case 'fr':
5452
return messages_fr.messages;
55-
case 'hu':
56-
return messages_hu.messages;
5753
case 'it':
5854
return messages_it.messages;
5955
case 'ja':
6056
return messages_ja.messages;
6157
case 'messages':
6258
return messages_messages.messages;
63-
case 'pl':
64-
return messages_pl.messages;
6559
case 'pt':
6660
return messages_pt.messages;
6761
case 'sk':
6862
return messages_sk.messages;
63+
case 'pl':
64+
return messages_pl.messages;
6965
default:
7066
return null;
7167
}
@@ -74,9 +70,8 @@ MessageLookupByLibrary _findExact(String localeName) {
7470
/// User programs should call this before using [localeName] for messages.
7571
Future<bool> initializeMessages(String localeName) async {
7672
var availableLocale = Intl.verifiedLocale(
77-
localeName,
78-
(locale) => _deferredLibraries[locale] != null,
79-
onFailure: (_) => null);
73+
localeName, (locale) => _deferredLibraries[locale] != null,
74+
onFailure: (_) => null);
8075
if (availableLocale == null) {
8176
return new Future.value(false);
8277
}
@@ -96,8 +91,8 @@ bool _messagesExistFor(String locale) {
9691
}
9792

9893
MessageLookupByLibrary _findGeneratedMessagesFor(String locale) {
99-
var actualLocale = Intl.verifiedLocale(locale, _messagesExistFor,
100-
onFailure: (_) => null);
94+
var actualLocale =
95+
Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null);
10196
if (actualLocale == null) return null;
10297
return _findExact(actualLocale);
10398
}
File renamed without changes.

lib/l10n/messages_en.dart

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
2+
// This is a library that provides messages for a en locale. All the
3+
// messages from the main program should be duplicated here with the same
4+
// function name.
5+
6+
// Ignore issues from commonly used lints in this file.
7+
// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new
8+
// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering
9+
// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases
10+
// ignore_for_file:unused_import, file_names
11+
12+
import 'package:intl/intl.dart';
13+
import 'package:intl/message_lookup_by_library.dart';
14+
15+
final messages = new MessageLookup();
16+
17+
typedef String MessageIfAbsent(String messageStr, List<dynamic> args);
18+
19+
class MessageLookup extends MessageLookupByLibrary {
20+
String get localeName => 'en';
21+
22+
static m1(max) => "Value must be less than or equal to ${max}";
23+
24+
static m2(maxLength) =>
25+
"Value must have a length less than or equal to ${maxLength}";
26+
27+
static m3(min) => "Value must be greater than or equal to ${min}.";
28+
29+
static m4(minLength) =>
30+
"Value must have a length greater than or equal to ${minLength}";
31+
32+
final messages = _notInlinedMessages(_notInlinedMessages);
33+
static _notInlinedMessages(_) => <String, Function>{
34+
"creditCardErrorText": MessageLookupByLibrary.simpleMessage(
35+
"This field requires a valid credit card number."),
36+
"dateStringErrorText": MessageLookupByLibrary.simpleMessage(
37+
"This field requires a valid date string."),
38+
"emailErrorText": MessageLookupByLibrary.simpleMessage(
39+
"This field requires a valid email address."),
40+
"ipErrorText": MessageLookupByLibrary.simpleMessage(
41+
"This field requires a valid IP."),
42+
"matchErrorText": MessageLookupByLibrary.simpleMessage(
43+
"Value does not match pattern."),
44+
"maxErrorText": m1,
45+
"maxLengthErrorText": m2,
46+
"minErrorText": m3,
47+
"minLengthErrorText": m4,
48+
"numericErrorText":
49+
MessageLookupByLibrary.simpleMessage("Value must be numeric."),
50+
"requiredErrorText":
51+
MessageLookupByLibrary.simpleMessage("This field cannot be empty."),
52+
"urlErrorText": MessageLookupByLibrary.simpleMessage(
53+
"This field requires a valid URL address.")
54+
};
55+
}

lib/l10n/messages_es.dart

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
2+
// This is a library that provides messages for a es locale. All the
3+
// messages from the main program should be duplicated here with the same
4+
// function name.
5+
6+
// Ignore issues from commonly used lints in this file.
7+
// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new
8+
// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering
9+
// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases
10+
// ignore_for_file:unused_import, file_names
11+
12+
import 'package:intl/intl.dart';
13+
import 'package:intl/message_lookup_by_library.dart';
14+
15+
final messages = new MessageLookup();
16+
17+
typedef String MessageIfAbsent(String messageStr, List<dynamic> args);
18+
19+
class MessageLookup extends MessageLookupByLibrary {
20+
String get localeName => 'es';
21+
22+
static m1(max) => "El valor debe ser menor o igual que ${max}.";
23+
24+
static m2(maxLength) =>
25+
"El valor debe tener una longitud menor o igual a ${maxLength}";
26+
27+
static m3(min) => "El valor debe ser mayor o igual que ${min}.";
28+
29+
static m4(minLength) =>
30+
"El valor debe tener una longitud mayor o igual a ${minLength}";
31+
32+
final messages = _notInlinedMessages(_notInlinedMessages);
33+
static _notInlinedMessages(_) => <String, Function>{
34+
"creditCardErrorText": MessageLookupByLibrary.simpleMessage(
35+
"Este campo requiere un número de tarjeta de crédito válido."),
36+
"dateStringErrorText": MessageLookupByLibrary.simpleMessage(
37+
"Este campo requiere una cadena de fecha válida."),
38+
"emailErrorText": MessageLookupByLibrary.simpleMessage(
39+
"Este campo requiere una dirección de correo electrónico válida."),
40+
"ipErrorText": MessageLookupByLibrary.simpleMessage(
41+
"Este campo requiere una IP válida."),
42+
"matchErrorText": MessageLookupByLibrary.simpleMessage(
43+
"El valor no coincide con el patrón requerido."),
44+
"maxErrorText": m1,
45+
"maxLengthErrorText": m2,
46+
"minErrorText": m3,
47+
"minLengthErrorText": m4,
48+
"numericErrorText":
49+
MessageLookupByLibrary.simpleMessage("El valor debe ser numérico."),
50+
"requiredErrorText": MessageLookupByLibrary.simpleMessage(
51+
"Este campo no puede estar vacío."),
52+
"urlErrorText": MessageLookupByLibrary.simpleMessage(
53+
"Este campo requiere una dirección URL válida.")
54+
};
55+
}

lib/l10n/messages_fr.dart

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
2+
// This is a library that provides messages for a fr locale. All the
3+
// messages from the main program should be duplicated here with the same
4+
// function name.
5+
6+
// Ignore issues from commonly used lints in this file.
7+
// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new
8+
// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering
9+
// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases
10+
// ignore_for_file:unused_import, file_names
11+
12+
import 'package:intl/intl.dart';
13+
import 'package:intl/message_lookup_by_library.dart';
14+
15+
final messages = new MessageLookup();
16+
17+
typedef String MessageIfAbsent(String messageStr, List<dynamic> args);
18+
19+
class MessageLookup extends MessageLookupByLibrary {
20+
String get localeName => 'fr';
21+
22+
static m1(max) => "La valeur doit être inférieure ou égale à ${max}";
23+
24+
static m2(maxLength) =>
25+
"La valeur doit avoir une longueur inférieure ou égale à ${maxLength}";
26+
27+
static m3(min) => "La valeur doit être supérieure ou égale à ${min}.";
28+
29+
static m4(minLength) =>
30+
"La valeur doit avoir une longueur supérieure ou égale à ${minLength}";
31+
32+
final messages = _notInlinedMessages(_notInlinedMessages);
33+
static _notInlinedMessages(_) => <String, Function>{
34+
"creditCardErrorText": MessageLookupByLibrary.simpleMessage(
35+
"Ce champ nécessite un numéro de carte de crédit valide."),
36+
"dateStringErrorText": MessageLookupByLibrary.simpleMessage(
37+
"Ce champ nécessite une chaîne de date valide."),
38+
"emailErrorText": MessageLookupByLibrary.simpleMessage(
39+
"Ce champ nécessite une adresse e-mail valide."),
40+
"ipErrorText": MessageLookupByLibrary.simpleMessage(
41+
"Ce champ nécessite une adresse IP valide."),
42+
"matchErrorText": MessageLookupByLibrary.simpleMessage(
43+
"La valeur ne correspond pas au modèle."),
44+
"maxErrorText": m1,
45+
"maxLengthErrorText": m2,
46+
"minErrorText": m3,
47+
"minLengthErrorText": m4,
48+
"numericErrorText": MessageLookupByLibrary.simpleMessage(
49+
"La valeur doit être numérique."),
50+
"requiredErrorText": MessageLookupByLibrary.simpleMessage(
51+
"Ce champ ne peut pas être vide."),
52+
"urlErrorText": MessageLookupByLibrary.simpleMessage(
53+
"Ce champ nécessite une adresse URL valide.")
54+
};
55+
}

lib/l10n/messages_it.dart

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
2+
// This is a library that provides messages for a it locale. All the
3+
// messages from the main program should be duplicated here with the same
4+
// function name.
5+
6+
// Ignore issues from commonly used lints in this file.
7+
// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new
8+
// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering
9+
// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases
10+
// ignore_for_file:unused_import, file_names
11+
12+
import 'package:intl/intl.dart';
13+
import 'package:intl/message_lookup_by_library.dart';
14+
15+
final messages = new MessageLookup();
16+
17+
typedef String MessageIfAbsent(String messageStr, List<dynamic> args);
18+
19+
class MessageLookup extends MessageLookupByLibrary {
20+
String get localeName => 'it';
21+
22+
static m4(value) =>
23+
"Il valore di questo campo deve essere uguale a ${value}.";
24+
25+
static m0(max) => "Il valore inserito deve essere minore o uguale a ${max}";
26+
27+
static m1(maxLength) =>
28+
"Il valore inserito deve avere una lunghezza minore o uguale a ${maxLength}";
29+
30+
static m2(min) =>
31+
"Il valore inserito deve essere maggiore o uguale a ${min}.";
32+
33+
static m3(minLength) =>
34+
"Il valore inserito deve avere una lunghezza maggiore o uguale a ${minLength}";
35+
36+
final messages = _notInlinedMessages(_notInlinedMessages);
37+
static _notInlinedMessages(_) => <String, Function>{
38+
"creditCardErrorText": MessageLookupByLibrary.simpleMessage(
39+
"Questo campo richiede un numero di carta di credito valido."),
40+
"dateStringErrorText": MessageLookupByLibrary.simpleMessage(
41+
"Questo campo richiede una data valida."),
42+
"emailErrorText": MessageLookupByLibrary.simpleMessage(
43+
"Questo campo richiede un indirizzo email valido."),
44+
"equalErrorText": m4,
45+
"integerErrorText": MessageLookupByLibrary.simpleMessage(
46+
"Il valore deve essere un integer."),
47+
"ipErrorText": MessageLookupByLibrary.simpleMessage(
48+
"Questo campo richiede un indirizzo IP valido."),
49+
"matchErrorText": MessageLookupByLibrary.simpleMessage(
50+
"Il valore non corrisponde al formato richiesto."),
51+
"maxErrorText": m0,
52+
"maxLengthErrorText": m1,
53+
"minErrorText": m2,
54+
"minLengthErrorText": m3,
55+
"numericErrorText": MessageLookupByLibrary.simpleMessage(
56+
"Il valore deve essere numerico."),
57+
"requiredErrorText": MessageLookupByLibrary.simpleMessage(
58+
"Questo campo non può essere vuoto."),
59+
"urlErrorText": MessageLookupByLibrary.simpleMessage(
60+
"Questo campo richiede una URL valida.")
61+
};
62+
}

lib/l10n/messages_ja.dart

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
2+
// This is a library that provides messages for a ja locale. All the
3+
// messages from the main program should be duplicated here with the same
4+
// function name.
5+
6+
// Ignore issues from commonly used lints in this file.
7+
// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new
8+
// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering
9+
// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases
10+
// ignore_for_file:unused_import, file_names
11+
12+
import 'package:intl/intl.dart';
13+
import 'package:intl/message_lookup_by_library.dart';
14+
15+
final messages = new MessageLookup();
16+
17+
typedef String MessageIfAbsent(String messageStr, List<dynamic> args);
18+
19+
class MessageLookup extends MessageLookupByLibrary {
20+
String get localeName => 'ja';
21+
22+
static m4(value) => "${value}に一致していません。";
23+
24+
static m0(max) => "${max}以下にしてください。";
25+
26+
static m1(maxLength) => "${maxLength}文字以下で入力してください。";
27+
28+
static m2(min) => "${min}以上にしてください。";
29+
30+
static m3(minLength) => "${minLength}文字以上で入力してください。";
31+
32+
static m5(value) => "${value}と違うものにしてください。";
33+
34+
final messages = _notInlinedMessages(_notInlinedMessages);
35+
static _notInlinedMessages(_) => <String, Function>{
36+
"creditCardErrorText":
37+
MessageLookupByLibrary.simpleMessage("有効なクレジットカード番号を入力してください。"),
38+
"dateStringErrorText":
39+
MessageLookupByLibrary.simpleMessage("正しい日付を入力してください。"),
40+
"emailErrorText":
41+
MessageLookupByLibrary.simpleMessage("有効なメールアドレスを入力してください。"),
42+
"equalErrorText": m4,
43+
"integerErrorText":
44+
MessageLookupByLibrary.simpleMessage("整数で入力してください。"),
45+
"ipErrorText":
46+
MessageLookupByLibrary.simpleMessage("有効なIPアドレスを入力してください。"),
47+
"matchErrorText":
48+
MessageLookupByLibrary.simpleMessage("有効な正規表現を指定してください。"),
49+
"maxErrorText": m0,
50+
"maxLengthErrorText": m1,
51+
"minErrorText": m2,
52+
"minLengthErrorText": m3,
53+
"notEqualErrorText": m5,
54+
"numericErrorText":
55+
MessageLookupByLibrary.simpleMessage("半角数字で入力してください。"),
56+
"requiredErrorText": MessageLookupByLibrary.simpleMessage("必須項目です。"),
57+
"urlErrorText": MessageLookupByLibrary.simpleMessage("有効なURLを入力してください。")
58+
};
59+
}

0 commit comments

Comments
 (0)