Skip to content

Commit 421cffe

Browse files
committed
feat: pulled changes from upstream and did more README fixes
1 parent 2a54441 commit 421cffe

File tree

1 file changed

+51
-51
lines changed

1 file changed

+51
-51
lines changed

README.md

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ Also included is the `l10n` / `i18n` of error text messages to multiple language
1818

1919
- [Features](#features)
2020
- [Validators](#validators)
21-
- [Supported languages](#supported-languages)
21+
- [Supported languages](#supported-languages)
2222
- [Use](#use)
23-
- [Setup](#setup)
24-
- [Basic use](#basic-use)
25-
- [Specific uses](#specific-uses)
26-
- [Composing multiple validators](#composing-multiple-validators)
27-
- [Modify the default error message in a specific language](#modify-the-default-error-message-in-a-specific-language)
23+
- [Setup](#setup)
24+
- [Basic use](#basic-use)
25+
- [Specific uses](#specific-uses)
26+
- [Composing multiple validators](#composing-multiple-validators)
27+
- [Modify the default error message in a specific language](#modify-the-default-error-message-in-a-specific-language)
2828
- [Support](#support)
29-
- [Contribute](#contribute)
30-
- [Add new supported language](#add-new-supported-language)
31-
- [Add new validator](#add-new-validator)
32-
- [Questions and answers](#questions-and-answers)
33-
- [Donations](#donations)
29+
- [Contribute](#contribute)
30+
- [Add new supported language](#add-new-supported-language)
31+
- [Add new validator](#add-new-validator)
32+
- [Questions and answers](#questions-and-answers)
33+
- [Donations](#donations)
3434
- [Roadmap](#roadmap)
3535
- [Ecosystem](#ecosystem)
3636
- [Thanks to](#thanks-to)
@@ -85,7 +85,7 @@ Validators support default `errorText` messages in these languages:
8585
- Farsi/Persian (fa)
8686
- French (fr)
8787
- German (de)
88-
- Greek (el)
88+
- Greek (el)
8989
- Hungarian (hu)
9090
- Indonesian (id)
9191
- Italian (it)
@@ -119,28 +119,28 @@ The default error message is in English. To allow for localization of default er
119119

120120
```Dart
121121
return MaterialApp(
122-
supportedLocales: [
123-
Locale('de'),
124-
Locale('en'),
125-
Locale('es'),
126-
Locale('fr'),
127-
Locale('it'),
128-
...
129-
],
130-
localizationsDelegates: [
131-
GlobalMaterialLocalizations.delegate,
132-
GlobalWidgetsLocalizations.delegate,
133-
FormBuilderLocalizations.delegate,
134-
],
122+
supportedLocales: [
123+
Locale('de'),
124+
Locale('en'),
125+
Locale('es'),
126+
Locale('fr'),
127+
Locale('it'),
128+
...
129+
],
130+
localizationsDelegates: [
131+
GlobalMaterialLocalizations.delegate,
132+
GlobalWidgetsLocalizations.delegate,
133+
FormBuilderLocalizations.delegate,
134+
],
135135
```
136136

137137
### Basic use
138138

139139
```dart
140140
TextFormField(
141-
decoration: InputDecoration(labelText: 'Name'),
142-
autovalidateMode: AutovalidateMode.always,
143-
validator: FormBuilderValidators.required(),
141+
decoration: InputDecoration(labelText: 'Name'),
142+
autovalidateMode: AutovalidateMode.always,
143+
validator: FormBuilderValidators.required(),
144144
),
145145
```
146146

@@ -165,20 +165,20 @@ validator: FormBuilderValidators.compose([
165165
/// Makes this field required
166166
FormBuilderValidators.required(),
167167
168-
/// Ensures the value entered is numeric - with a custom error message
169-
FormBuilderValidators.numeric(errorText: 'La edad debe ser numérica.'),
168+
/// Ensures the value entered is numeric - with a custom error message
169+
FormBuilderValidators.numeric(errorText: 'La edad debe ser numérica.'),
170170
171-
/// Sets a maximum value of 70
172-
FormBuilderValidators.max(70),
171+
/// Sets a maximum value of 70
172+
FormBuilderValidators.max(70),
173173
174-
/// Include your own custom `FormFieldValidator` function, if you want
175-
/// Ensures positive values only. We could also have used `FormBuilderValidators.min(0)` instead
176-
(val) {
177-
final number = int.tryParse(val);
178-
if (number == null) return null;
179-
if (number < 0) return 'We cannot have a negative age';
180-
return null;
181-
}
174+
/// Include your own custom `FormFieldValidator` function, if you want
175+
/// Ensures positive values only. We could also have used `FormBuilderValidators.min(0)` instead
176+
(val) {
177+
final number = int.tryParse(val);
178+
if (number == null) return null;
179+
if (number < 0) return 'We cannot have a negative age';
180+
return null;
181+
}
182182
]),
183183
),
184184
```
@@ -194,7 +194,7 @@ see [override_form_builder_localizations_en](example/lib/override_form_builder_l
194194
You have some ways to contribute to this package.
195195

196196
- Beginner: Reporting bugs or requesting new features
197-
- Intermediate: Answer questions, implement new features (from issues or not) and create pull requests
197+
- Intermediate: Answer questions, implement new features (from issues or not), and create pull requests
198198
- Advanced: Join [organization](#ecosystem) like a member and help to code, manage issues, discuss new features, and other things
199199

200200
See the [contribution file](https://github.com/flutter-form-builder-ecosystem/.github/blob/main/CONTRIBUTING.md) for more details
@@ -205,42 +205,42 @@ We welcome efforts to internationalize/localize the package by translating the d
205205

206206
1. Add ARB files
207207

208-
Create one ARB file inside the `lib/l10n` folder for each locale 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`.
208+
Create one ARB file inside the `lib/l10n` folder for each locale 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`.
209209

210210
2. Translate the error messages
211211

212-
Copy and paste the contents of `intl_en.arb` into your newly created ARB file. Then translate the error messages by overwriting the default messages.
212+
Copy and paste the contents of `intl_en.arb` into your newly created ARB file. Then translate the error messages by overwriting the default messages.
213213

214214
3. Generate localization code
215215

216-
To generate boilerplate code for localization, run the generate command inside the package directory where `pubspec.yaml` file is located:
216+
To generate boilerplate code for localization, run the generate command inside the package directory where `pubspec.yaml` file is located:
217217

218-
`flutter gen-l10n`
218+
`flutter gen-l10n`
219219

220-
The command will automatically create/update files inside the `lib/localization` directory, including your newly added locale support.
220+
The command will automatically create/update files inside the `lib/localization` directory, including your newly added locale support.
221221

222222
4. Update README
223223

224-
Remember to update README, adding the new language (and language code) under [Supported languages section](#supported-languages) in alphabetic order, so that everyone knows your new language is now supported!
224+
Remember to update README, adding the new language (and language code) under [Supported languages section](#supported-languages) in alphabetic order, so that everyone knows your new language is now supported!
225225

226226
5. Submit PR
227227

228-
Submit your PR and be of help to millions of developers all over the world!
228+
Submit your PR and be of help to millions of developers all over the world!
229229

230230
#### Add new validator
231231

232232
1. Add method to `validators.dart` with your Dart documentation
233233
2. Implement tests
234234
3. Add to [validators](#validators) with name and description
235235
4. Add message error translated on all languages (yes, all languages). To accomplish this need:
236-
a. Add property to all `intl_*.arb` files, on alphabetic order.
237-
b. Translate message on all languages.
236+
a. Add property to all `intl_*.arb` files, in alphabetic order.
237+
b. Translate message in all languages.
238238
c. Run `flutter gen-l10n` command
239239
5. Submit PR
240240

241241
### Questions and answers
242242

243-
You can ask questions or search answers on [Github discussion](https://github.com/flutter-form-builder-ecosystem/form_builder_validators/discussions) or on [StackOverflow](https://stackoverflow.com/questions/tagged/flutter-form-builder)
243+
You can ask questions or search for answers on [Github discussion](https://github.com/flutter-form-builder-ecosystem/form_builder_validators/discussions) or on [StackOverflow](https://stackoverflow.com/questions/tagged/flutter-form-builder)
244244

245245
### Donations
246246

0 commit comments

Comments
 (0)