Skip to content

Commit 1f62b44

Browse files
committed
Bosnian and Croatian support, Slovenian update
1 parent 091af26 commit 1f62b44

File tree

5 files changed

+167
-143
lines changed

5 files changed

+167
-143
lines changed

README.md

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,27 @@ Also included is the `l10n` / `i18n` of error text messages to multiple language
1010
[![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/flutter-form-builder-ecosystem/form_builder_validators?logo=codefactor&style=for-the-badge)](https://www.codefactor.io/repository/github/flutter-form-builder-ecosystem/form_builder_validators)
1111
[![Discord](https://img.shields.io/discord/985922433578053673?logo=discord&style=for-the-badge)](https://discord.com/invite/25KNPMJQf2)
1212

13-
___
13+
---
1414

1515
> ### Migrating from version 7 to 8
16+
>
1617
> To migrate from v7 to v8, remove `context` as a parameter to validator functions. For example, `FormBuilderValidators.required(context)` becomes `FormBuilderValidators.required()` without context passed to it.
1718
1819
- [Features](#features)
1920
- [Validators](#validators)
2021
- [Supported languages](#supported-languages)
2122
- [Use](#use)
22-
- [Setup](#setup)
23-
- [Basic use](#basic-use)
24-
- [Especific uses](#especific-uses)
23+
- [Setup](#setup)
24+
- [Basic use](#basic-use)
25+
- [Especific uses](#especific-uses)
2526
- [Support](#support)
26-
- [Contribute](#contribute)
27-
- [Questions and answers](#questions-and-answers)
28-
- [Donations](#donations)
27+
- [Contribute](#contribute)
28+
- [Questions and answers](#questions-and-answers)
29+
- [Donations](#donations)
2930
- [Roadmap](#roadmap)
3031
- [Ecosystem](#ecosystem)
3132
- [Thanks to](#thanks-to)
32-
- [Contributors](#contributors)
33-
33+
- [Contributors](#contributors)
3434

3535
## Features
3636

@@ -43,31 +43,34 @@ This package comes with several most common `FormFieldValidator`s such as requir
4343
URL, min, max, minLength, maxLength, IP, credit card, etc., with default `errorText` messages.
4444

4545
Available built-in validators include:
46-
* `FormBuilderValidators.creditCard()` - requires the field's value to be a valid credit card number.
47-
* `FormBuilderValidators.date()` - requires the field's value to be a valid date string.
48-
* `FormBuilderValidators.email()` - requires the field's value to be a valid email address.
49-
* `FormBuilderValidators.equal()` - requires the field's value be equal to provided object.
50-
* `FormBuilderValidators.integer()` - requires the field's value to be an integer.
51-
* `FormBuilderValidators.ip()` - requires the field's value to be a valid IP address.
52-
* `FormBuilderValidators.match()` - requires the field's value to match the provided regex pattern.
53-
* `FormBuilderValidators.max()` - requires the field's value to be less than or equal to the provided number.
54-
* `FormBuilderValidators.maxLength()` - requires the length of the field's value to be less than or equal to the provided maximum length.
55-
* `FormBuilderValidators.min()` - requires the field's value to be greater than or equal to the provided number.
56-
* `FormBuilderValidators.minLength()` - requires the length of the field's value to be greater than or equal to the provided minimum length.
57-
* `FormBuilderValidators.equalLength()` - requires the length of the field's value to be equal to the provided minimum length.
58-
* `FormBuilderValidators.numeric()` - requires the field's value to be a valid number.
59-
* `FormBuilderValidators.required()` - requires the field have a non-empty value.
60-
* `FormBuilderValidators.url()` - requires the field's value to be a valid url.
61-
62-
### Supported languages
46+
47+
- `FormBuilderValidators.creditCard()` - requires the field's value to be a valid credit card number.
48+
- `FormBuilderValidators.date()` - requires the field's value to be a valid date string.
49+
- `FormBuilderValidators.email()` - requires the field's value to be a valid email address.
50+
- `FormBuilderValidators.equal()` - requires the field's value be equal to provided object.
51+
- `FormBuilderValidators.integer()` - requires the field's value to be an integer.
52+
- `FormBuilderValidators.ip()` - requires the field's value to be a valid IP address.
53+
- `FormBuilderValidators.match()` - requires the field's value to match the provided regex pattern.
54+
- `FormBuilderValidators.max()` - requires the field's value to be less than or equal to the provided number.
55+
- `FormBuilderValidators.maxLength()` - requires the length of the field's value to be less than or equal to the provided maximum length.
56+
- `FormBuilderValidators.min()` - requires the field's value to be greater than or equal to the provided number.
57+
- `FormBuilderValidators.minLength()` - requires the length of the field's value to be greater than or equal to the provided minimum length.
58+
- `FormBuilderValidators.equalLength()` - requires the length of the field's value to be equal to the provided minimum length.
59+
- `FormBuilderValidators.numeric()` - requires the field's value to be a valid number.
60+
- `FormBuilderValidators.required()` - requires the field have a non-empty value.
61+
- `FormBuilderValidators.url()` - requires the field's value to be a valid url.
62+
63+
### Supported languages
6364

6465
Validators support default errorText messages in this languages:
6566

6667
- Arabic (ar)
6768
- Bangla (bn)
69+
- Bosnian (bs)
6870
- Catalan (ca)
6971
- Chinese Simplified (zh_Hans)
7072
- Chinese Traditional (zh_Hant)
73+
- Croatian (hr)
7174
- Czech (cs)
7275
- English (en)
7376
- Estonian (et)
@@ -138,6 +141,7 @@ See [pud.dev example tab](https://pub.dev/packages/form_builder_validators/examp
138141
On validation, each validator is run, and if any one validator returns a non-null value (i.e., a String), validation fails, and the `errorText` for the field is set as the returned string.
139142

140143
Example:
144+
141145
```dart
142146
TextFormField(
143147
decoration: InputDecoration(labelText: 'Age'),
@@ -171,17 +175,17 @@ TextFormField(
171175

172176
You have some ways to contribute to this packages
173177

174-
- Beginner: Reporting bugs or request new features
175-
- Intermediate: Implement new features (from issues or not) and created pull requests
176-
- Advanced: Join to [organization](#ecosystem) like a member and help coding, manage issues, dicuss new features and other things
178+
- Beginner: Reporting bugs or request new features
179+
- Intermediate: Implement new features (from issues or not) and created pull requests
180+
- Advanced: Join to [organization](#ecosystem) like a member and help coding, manage issues, dicuss new features and other things
177181

178-
See [contribution file](https://github.com/flutter-form-builder-ecosystem/.github/blob/main/CONTRIBUTING.md) for more details
182+
See [contribution file](https://github.com/flutter-form-builder-ecosystem/.github/blob/main/CONTRIBUTING.md) for more details
179183

180-
#### Add new supported language
184+
#### Add new supported language
181185

182-
We especially welcome efforts to internationalize/localize the package by translating the default validation `errorText` strings for built-in validation rules.
186+
We especially welcome efforts to internationalize/localize the package by translating the default validation `errorText` strings for built-in validation rules.
183187

184-
1. Add ARB files
188+
1. Add ARB files
185189

186190
Create one ARB file inside the `lib/l10n` folder for each of the locales you need to add support. Name the files in the following way: `intl_<LOCALE_ISO_CODE>.arb`. For example: `intl_fr.arb` or `intl_fr_FR.arb`.
187191

@@ -219,7 +223,6 @@ Buy a coffe to [Danvick Miller](https://twitter.com/danvickmiller), creator of t
219223

220224
- [Solve open issues](https://github.com/flutter-form-builder-ecosystem/form_builder_validators/issues), [prioritizing bugs](https://github.com/flutter-form-builder-ecosystem/form_builder_validators/labels/bug)
221225

222-
223226
## Ecosystem
224227

225228
Take a look to [our awesome ecosystem](https://github.com/flutter-form-builder-ecosystem) and all packages in there

lib/l10n/intl_sl.arb

Lines changed: 111 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,114 @@
11
{
2-
"@@last_modified": "2021-12-26T12:00:39.706877",
3-
"@@locale": "sl",
4-
"requiredErrorText": "Polje ne more biti prazno.",
5-
"@requiredErrorText": {
6-
"description": "Error Text for required field",
7-
"type": "text",
8-
"placeholders": {}
9-
},
10-
"minErrorText": "Vrednost mora biti večja ali enaka {min}.",
11-
"@minErrorText": {
12-
"description": "Error Text for required field",
13-
"type": "text",
14-
"placeholders": {
15-
"min": {}
16-
}
17-
},
18-
"minLengthErrorText": "Besedilo mora biti daljše ali enako {minLength} znakov",
19-
"@minLengthErrorText": {
20-
"description": "Error Text for required field",
21-
"type": "text",
22-
"placeholders": {
23-
"minLength": {}
24-
}
25-
},
26-
"maxErrorText": "Vrednost ne sme presegati {max}",
27-
"@maxErrorText": {
28-
"description": "Error Text for required field",
29-
"type": "text",
30-
"placeholders": {
31-
"max": {}
32-
}
33-
},
34-
"maxLengthErrorText": "Besedilo mora biti krajše ali enako {maxLength} znakov",
35-
"@maxLengthErrorText": {
36-
"description": "Error Text for required field",
37-
"type": "text",
38-
"placeholders": {
39-
"maxLength": {}
40-
}
41-
},
42-
"emailErrorText": "Vnesite veljaven e-mail naslov.",
43-
"@emailErrorText": {
44-
"description": "Error Text for email field",
45-
"type": "text",
46-
"placeholders": {}
47-
},
48-
"integerErrorText": "Vnesite celo število.",
49-
"@integerErrorText": {
50-
"description": "Error Text for integer validator",
51-
"type": "text",
52-
"placeholders": {}
53-
},
54-
"equalErrorText": "Vrednost mora biti enaka {value}.",
55-
"@equalErrorText": {
56-
"description": "Error Text for equal validator",
57-
"type": "text",
58-
"placeholders": {
59-
"value": {}
60-
}
61-
},
62-
"notEqualErrorText": "Vrednost ne sme biti večja kot {value}.",
63-
"@notEqualErrorText": {
64-
"description": "Error Text for not-equal validator",
65-
"type": "text",
66-
"placeholders": {
67-
"value": {}
68-
}
69-
},
70-
"urlErrorText": "Vnesite veljaven URL naslov.",
71-
"@urlErrorText": {
72-
"description": "Error Text for URL field",
73-
"type": "text",
74-
"placeholders": {}
75-
},
76-
"matchErrorText": "Vrednost ne ustreza predpisanemu vzorcu.",
77-
"@matchErrorText": {
78-
"description": "Error Text for pattern field",
79-
"type": "text",
80-
"placeholders": {}
81-
},
82-
"numericErrorText": "Vrednost polja mora biti numerična.",
83-
"@numericErrorText": {
84-
"description": "Error Text for numeric field",
85-
"type": "text",
86-
"placeholders": {}
87-
},
88-
"creditCardErrorText": "Vnesite veljavno številko kreditne kartice.",
89-
"@creditCardErrorText": {
90-
"description": "Error Text for credit card field",
91-
"type": "text",
92-
"placeholders": {}
93-
},
94-
"ipErrorText": "Vnesite IP naslov.",
95-
"@ipErrorText": {
96-
"description": "Error Text for IP address field",
97-
"type": "text",
98-
"placeholders": {}
99-
},
100-
"dateStringErrorText": "Vnesite veljaven datum.",
101-
"@dateStringErrorText": {
102-
"description": "Error Text for date string field",
103-
"type": "text",
104-
"placeholders": {}
2+
"@@last_modified": "2020-11-13T10:38:27.938366",
3+
"@@locale": "sl",
4+
"requiredErrorText": "Polje ne sme biti prazno.",
5+
"@requiredErrorText": {
6+
"description": "Error Text for required validator",
7+
"type": "text",
8+
"placeholders": {}
9+
},
10+
"equalErrorText": "Vrednost mora biti enaka {value}.",
11+
"@equalErrorText": {
12+
"description": "Error Text for equal validator",
13+
"type": "text",
14+
"placeholders": {
15+
"value": {}
10516
}
17+
},
18+
"notEqualErrorText": "Vrednost ne sme biti enaka {value}.",
19+
"@notEqualErrorText": {
20+
"description": "Error Text for not-equal validator",
21+
"type": "text",
22+
"placeholders": {
23+
"value": {}
24+
}
25+
},
26+
"minErrorText": "Vrednost mora biti večja ali enaka {min}.",
27+
"@minErrorText": {
28+
"description": "Error Text for required field",
29+
"type": "text",
30+
"placeholders": {
31+
"min": {}
32+
}
33+
},
34+
"minLengthErrorText": "Besedilo mora biti daljše ali enako {minLength} znakov.",
35+
"@minLengthErrorText": {
36+
"description": "Error Text for minLength validator",
37+
"type": "text",
38+
"placeholders": {
39+
"minLength": {}
40+
}
41+
},
42+
"maxErrorText": "Vrednost ne sme presegati {max}.",
43+
"@maxErrorText": {
44+
"description": "Error Text for max validator",
45+
"type": "text",
46+
"placeholders": {
47+
"max": {}
48+
}
49+
},
50+
"maxLengthErrorText": "Besedilo mora biti krajše ali enako {maxLength} znakov.",
51+
"@maxLengthErrorText": {
52+
"description": "Error Text for required field",
53+
"type": "text",
54+
"placeholders": {
55+
"maxLength": {}
56+
}
57+
},
58+
"equalLengthErrorText": "Besedilo mora biti dolgo {length} znakov.",
59+
"@equalLengthErrorText": {
60+
"description": "Error Text for required field",
61+
"type": "text",
62+
"placeholders": {
63+
"length": {}
64+
}
65+
},
66+
"emailErrorText": "Vnesite veljaven e-mail naslov.",
67+
"@emailErrorText": {
68+
"description": "Error Text for email validator",
69+
"type": "text",
70+
"placeholders": {}
71+
},
72+
"urlErrorText": "Vnesite veljaven URL naslov.",
73+
"@urlErrorText": {
74+
"description": "Error Text for URL validator",
75+
"type": "text",
76+
"placeholders": {}
77+
},
78+
"matchErrorText": "Vrednost ne ustreza predpisanemu vzorcu.",
79+
"@matchErrorText": {
80+
"description": "Error Text for pattern validator",
81+
"type": "text",
82+
"placeholders": {}
83+
},
84+
"numericErrorText": "Vrednost polja mora biti numerična.",
85+
"@numericErrorText": {
86+
"description": "Error Text for numeric validator",
87+
"type": "text",
88+
"placeholders": {}
89+
},
90+
"integerErrorText": "Vnesite celo število.",
91+
"@integerErrorText": {
92+
"description": "Error Text for integer validator",
93+
"type": "text",
94+
"placeholders": {}
95+
},
96+
"creditCardErrorText": "Vnesite veljavno številko kreditne kartice.",
97+
"@creditCardErrorText": {
98+
"description": "Error Text for credit card validator",
99+
"type": "text",
100+
"placeholders": {}
101+
},
102+
"ipErrorText": "Vnesite veljaven IP naslov.",
103+
"@ipErrorText": {
104+
"description": "Error Text for IP address validator",
105+
"type": "text",
106+
"placeholders": {}
107+
},
108+
"dateStringErrorText": "Vnesite veljaven datum.",
109+
"@dateStringErrorText": {
110+
"description": "Error Text for date string validator",
111+
"type": "text",
112+
"placeholders": {}
113+
}
106114
}

lib/localization/intl/messages_all.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import 'package:intl/src/intl_helpers.dart';
1717

1818
import 'messages_ar.dart' as messages_ar;
1919
import 'messages_bn.dart' as messages_bn;
20+
import 'messages_bs.dart' as messages_bs;
2021
import 'messages_ca.dart' as messages_ca;
2122
import 'messages_cs.dart' as messages_cs;
2223
import 'messages_de.dart' as messages_de;
@@ -25,6 +26,7 @@ import 'messages_es.dart' as messages_es;
2526
import 'messages_et.dart' as messages_et;
2627
import 'messages_fa.dart' as messages_fa;
2728
import 'messages_fr.dart' as messages_fr;
29+
import 'messages_hr.dart' as messages_hr;
2830
import 'messages_hu.dart' as messages_hu;
2931
import 'messages_id.dart' as messages_id;
3032
import 'messages_it.dart' as messages_it;
@@ -49,6 +51,7 @@ typedef Future<dynamic> LibraryLoader();
4951
Map<String, LibraryLoader> _deferredLibraries = {
5052
'ar': () => new Future.value(null),
5153
'bn': () => new Future.value(null),
54+
'bs': () => new Future.value(null),
5255
'ca': () => new Future.value(null),
5356
'cs': () => new Future.value(null),
5457
'de': () => new Future.value(null),
@@ -57,6 +60,7 @@ Map<String, LibraryLoader> _deferredLibraries = {
5760
'et': () => new Future.value(null),
5861
'fa': () => new Future.value(null),
5962
'fr': () => new Future.value(null),
63+
'hr': () => new Future.value(null),
6064
'hu': () => new Future.value(null),
6165
'id': () => new Future.value(null),
6266
'it': () => new Future.value(null),
@@ -84,6 +88,8 @@ MessageLookupByLibrary? _findExact(String localeName) {
8488
return messages_ar.messages;
8589
case 'bn':
8690
return messages_bn.messages;
91+
case 'bs':
92+
return messages_bs.messages;
8793
case 'ca':
8894
return messages_ca.messages;
8995
case 'cs':
@@ -100,6 +106,8 @@ MessageLookupByLibrary? _findExact(String localeName) {
100106
return messages_fa.messages;
101107
case 'fr':
102108
return messages_fr.messages;
109+
case 'hr':
110+
return messages_hr.messages;
103111
case 'hu':
104112
return messages_hu.messages;
105113
case 'id':

0 commit comments

Comments
 (0)