Skip to content

Commit c2a5b59

Browse files
committed
feat(validators): added support for Ukranian (uk) language. Fixes #967
1 parent c6cd5a2 commit c2a5b59

File tree

6 files changed

+179
-2
lines changed

6 files changed

+179
-2
lines changed

packages/form_builder_validators/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ To allow for localization of default error messages within your app, add `FormBu
119119
```
120120
### Supported languages (default errorText messages)
121121
- Arabic (ar)
122+
- Chinese Simplified (zh_Hans)
123+
- Chinese Traditional (zh_Hant)
122124
- English (en)
123125
- Dutch (nl)
124126
- Farsi/Persian (fa)
@@ -136,8 +138,7 @@ To allow for localization of default error messages within your app, add `FormBu
136138
- Slovak (sk)
137139
- Slovenian (sl)
138140
- Spanish (es)
139-
- Chinese Traditional (zh_Hant)
140-
- Chinese Simplified (zh_Hans)
141+
- Ukrainian (uk)
141142

142143
and you can still add your own custom error messages.
143144

packages/form_builder_validators/example/lib/main.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class MyApp extends StatelessWidget {
2424
Locale('fr'),
2525
Locale('it'),
2626
Locale('lo'),
27+
Locale('uk'),
2728
],
2829
localizationsDelegates: const [
2930
GlobalMaterialLocalizations.delegate,
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
{
2+
"@@last_modified": "2022-02-15T13: 30: 00.706877",
3+
"@@locale": "uk",
4+
"requiredErrorText": "Поле не може бути порожнім.",
5+
"@requiredErrorText": {
6+
"description": "Error Text for required field",
7+
"type": "text",
8+
"placeholders": {}
9+
},
10+
"minErrorText": "Значення має бути більш або дорівнює {min}.",
11+
"@minErrorText": {
12+
"description": "Error Text for required field",
13+
"type": "text",
14+
"placeholders": {
15+
"min": {}
16+
}
17+
},
18+
"minLengthErrorText": "Довжина значеня Має бути більш або дорівнює {minLength}.",
19+
"@minLengthErrorText": {
20+
"description": "Error Text for required field",
21+
"type": "text",
22+
"placeholders": {
23+
"minLength": {}
24+
}
25+
},
26+
"maxErrorText": "Значення має бути менше або дорівнює {max}.",
27+
"@maxErrorText": {
28+
"description": "Error Text for required field",
29+
"type": "text",
30+
"placeholders": {
31+
"max": {}
32+
}
33+
},
34+
"maxLengthErrorText": "Довжина значеня Має бути менше або дорівнює {maxLength}.",
35+
"@maxLengthErrorText": {
36+
"description": "Error Text for required field",
37+
"type": "text",
38+
"placeholders": {
39+
"maxLength": {}
40+
}
41+
},
42+
"emailErrorText": "Поле має бути email адрес.",
43+
"@emailErrorText": {
44+
"description": "Error Text for email field",
45+
"type": "text",
46+
"placeholders": {}
47+
},
48+
"integerErrorText": "Поле має бути цілим числом.",
49+
"@integerErrorText": {
50+
"description": "Error Text for integer validator",
51+
"type": "text",
52+
"placeholders": {}
53+
},
54+
"equalErrorText": "Значення поля має дорівнювати {value}.",
55+
"@equalErrorText": {
56+
"description": "Error Text for equal validator",
57+
"type": "text",
58+
"placeholders": {
59+
"value": {}
60+
}
61+
},
62+
"notEqualErrorText": "Значення поля не повинно бути рівним {value}.",
63+
"@notEqualErrorText": {
64+
"description": "Error Text for not-equal validator",
65+
"type": "text",
66+
"placeholders": {
67+
"value": {}
68+
}
69+
},
70+
"urlErrorText": "Поле має бути URL адресою.",
71+
"@urlErrorText": {
72+
"description": "Error Text for URL field",
73+
"type": "text",
74+
"placeholders": {}
75+
},
76+
"matchErrorText": "Значення має задовольняти шаблоном.",
77+
"@matchErrorText": {
78+
"description": "Error Text for pattern field",
79+
"type": "text",
80+
"placeholders": {}
81+
},
82+
"numericErrorText": "Значення має бути числом.",
83+
"@numericErrorText": {
84+
"description": "Error Text for numeric field",
85+
"type": "text",
86+
"placeholders": {}
87+
},
88+
"creditCardErrorText": "Значення поля має бути номером кредитної картки.",
89+
"@creditCardErrorText": {
90+
"description": "Error Text for credit card field",
91+
"type": "text",
92+
"placeholders": {}
93+
},
94+
"ipErrorText": "Поле має бути IP номером.",
95+
"@ipErrorText": {
96+
"description": "Error Text for IP address field",
97+
"type": "text",
98+
"placeholders": {}
99+
},
100+
"dateStringErrorText": "Поле має бути датою.",
101+
"@dateStringErrorText": {
102+
"description": "Error Text for date string field",
103+
"type": "text",
104+
"placeholders": {}
105+
}
106+
}

packages/form_builder_validators/lib/localization/intl/messages_all.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import 'messages_pt.dart' as messages_pt;
3434
import 'messages_ru.dart' as messages_ru;
3535
import 'messages_sk.dart' as messages_sk;
3636
import 'messages_sl.dart' as messages_sl;
37+
import 'messages_uk.dart' as messages_uk;
3738
import 'messages_zh_Hans.dart' as messages_zh_hans;
3839
import 'messages_zh_Hant.dart' as messages_zh_hant;
3940

@@ -58,6 +59,7 @@ Map<String, LibraryLoader> _deferredLibraries = {
5859
'ru': () => new Future.value(null),
5960
'sk': () => new Future.value(null),
6061
'sl': () => new Future.value(null),
62+
'uk': () => new Future.value(null),
6163
'zh_Hans': () => new Future.value(null),
6264
'zh_Hant': () => new Future.value(null),
6365
};
@@ -102,6 +104,8 @@ MessageLookupByLibrary? _findExact(String localeName) {
102104
return messages_sk.messages;
103105
case 'sl':
104106
return messages_sl.messages;
107+
case 'uk':
108+
return messages_uk.messages;
105109
case 'zh_Hans':
106110
return messages_zh_hans.messages;
107111
case 'zh_Hant':
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
2+
// This is a library that provides messages for a uk 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, avoid_escaping_inner_quotes
11+
// ignore_for_file:unnecessary_string_interpolations, unnecessary_string_escapes
12+
13+
import 'package:intl/intl.dart';
14+
import 'package:intl/message_lookup_by_library.dart';
15+
16+
final messages = new MessageLookup();
17+
18+
typedef String MessageIfAbsent(String messageStr, List<dynamic> args);
19+
20+
class MessageLookup extends MessageLookupByLibrary {
21+
String get localeName => 'uk';
22+
23+
static String m0(value) => "Значення поля має дорівнювати ${value}.";
24+
25+
static String m1(max) => "Значення має бути менше або дорівнює ${max}.";
26+
27+
static String m2(maxLength) =>
28+
"Довжина значеня Має бути менше або дорівнює ${maxLength}.";
29+
30+
static String m3(min) => "Значення має бути більш або дорівнює ${min}.";
31+
32+
static String m4(minLength) =>
33+
"Довжина значеня Має бути більш або дорівнює ${minLength}.";
34+
35+
static String m5(value) => "Значення поля не повинно бути рівним ${value}.";
36+
37+
final messages = _notInlinedMessages(_notInlinedMessages);
38+
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
39+
"creditCardErrorText": MessageLookupByLibrary.simpleMessage(
40+
"Значення поля має бути номером кредитної картки."),
41+
"dateStringErrorText":
42+
MessageLookupByLibrary.simpleMessage("Поле має бути датою."),
43+
"emailErrorText":
44+
MessageLookupByLibrary.simpleMessage("Поле має бути email адрес."),
45+
"equalErrorText": m0,
46+
"integerErrorText":
47+
MessageLookupByLibrary.simpleMessage("Поле має бути цілим числом."),
48+
"ipErrorText":
49+
MessageLookupByLibrary.simpleMessage("Поле має бути IP номером."),
50+
"matchErrorText": MessageLookupByLibrary.simpleMessage(
51+
"Значення має задовольняти шаблоном."),
52+
"maxErrorText": m1,
53+
"maxLengthErrorText": m2,
54+
"minErrorText": m3,
55+
"minLengthErrorText": m4,
56+
"notEqualErrorText": m5,
57+
"numericErrorText":
58+
MessageLookupByLibrary.simpleMessage("Значення має бути числом."),
59+
"requiredErrorText":
60+
MessageLookupByLibrary.simpleMessage("Поле не може бути порожнім."),
61+
"urlErrorText":
62+
MessageLookupByLibrary.simpleMessage("Поле має бути URL адресою.")
63+
};
64+
}

packages/form_builder_validators/lib/localization/l10n.dart

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)