Skip to content

Commit 761dbdf

Browse files
feat: add missed translation validation messages
1 parent 394426f commit 761dbdf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1687
-1890
lines changed

README.md

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Form Builder Validators set of validators for `FlutterFormBuilder`. Provides com
55
Also included is the `l10n` / `i18n` of error text messages to multiple languages.
66

77
[![Pub Version](https://img.shields.io/pub/v/form_builder_validators?logo=flutter&style=for-the-badge)](https://pub.dev/packages/form_builder_validators)
8-
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/flutter-form-builder-ecosystem/form_builder_validators/Base?logo=github&style=for-the-badge)](https://github.com/flutter-form-builder-ecosystem/form_builder_validators/actions/workflows/base.yaml)
8+
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/flutter-form-builder-ecosystem/form_builder_validators/base.yaml?branch=main&logo=github&style=for-the-badge)](https://github.com/flutter-form-builder-ecosystem/form_builder_validators/actions/workflows/base.yaml)
99
[![Codecov](https://img.shields.io/codecov/c/github/flutter-form-builder-ecosystem/form_builder_validators?logo=codecov&style=for-the-badge)](https://codecov.io/gh/flutter-form-builder-ecosystem/form_builder_validators/)
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
---
@@ -21,8 +21,12 @@ Also included is the `l10n` / `i18n` of error text messages to multiple language
2121
- [Setup](#setup)
2222
- [Basic use](#basic-use)
2323
- [Especific uses](#especific-uses)
24+
- [Composing multiple validators](#composing-multiple-validators)
25+
- [Modify the default error message in a specific language](#modify-the-default-error-message-in-a-specific-language)
2426
- [Support](#support)
2527
- [Contribute](#contribute)
28+
- [Add new supported language](#add-new-supported-language)
29+
- [Add new validator](#add-new-validator)
2630
- [Questions and answers](#questions-and-answers)
2731
- [Donations](#donations)
2832
- [Roadmap](#roadmap)
@@ -73,19 +77,21 @@ Validators support default errorText messages in this languages:
7377
- Chinese Traditional (zh_Hant)
7478
- Croatian (hr)
7579
- Czech (cs)
80+
- Dutch (nl)
7681
- English (en)
7782
- Estonian (et)
78-
- Dutch (nl)
7983
- Farsi/Persian (fa)
8084
- French (fr)
81-
- Greek (el)
8285
- German (de)
86+
- Greek (el)
8387
- Hungarian (hu)
8488
- Indonesian (id)
8589
- Italian (it)
8690
- Japanese (ja)
8791
- Korean (ko)
8892
- Lao (lo)
93+
- Malay (ms)
94+
- Mongolian (mn)
8995
- Polish (pl)
9096
- Portuguese (pt)
9197
- Romanian (ro)
@@ -95,12 +101,10 @@ Validators support default errorText messages in this languages:
95101
- Spanish (es)
96102
- Swahili (sw)
97103
- Swedish (se)
98-
- Ukrainian (uk)
99104
- Tamil(ta)
100105
- Thai (th)
101106
- Turkish (tr)
102-
- Malay (ms)
103-
- Mongolian (mn)
107+
- Ukrainian (uk)
104108
- Vietnamese (vi)
105109

106110
And you can still add your custom error messages.
@@ -203,7 +207,7 @@ Create one ARB file inside the `lib/l10n` folder for each of the locales you nee
203207

204208
2. Translate the error messages
205209

206-
Duplicate the contents of `intl_en.arb` (or any other ARB file) into your newly created ARB file, then translate the error messages by overwriting the default messages.
210+
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.
207211

208212
3. Generate localization code
209213

@@ -215,12 +219,23 @@ Running the command will automatically create/update files inside the `lib/local
215219

216220
4. Update README
217221

218-
Remember to update README, adding the new language (and language code) under [Supported languages section](#supported-languages) so that everyone knows your new language is now supported!
222+
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!
219223

220224
5. Submit PR
221225

222226
Submit your PR and be of help to millions of developers all over the world!
223227

228+
#### Add new validator
229+
230+
1. Add method to `validators.dart` with your Dart documentation
231+
2. Implement tests
232+
3. Add to [validators](#validators) with name and description
233+
4. Add message error translated on all languages (yes, all languages). To accomplish this need:
234+
a. Add property to all `intl_*.arb` files, on alphabetic order.
235+
b. Translate message on all languages.
236+
c. Run `flutter gen-l10n` command
237+
5. Submit PR
238+
224239
### Questions and answers
225240

226241
You can question 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)

example/pubspec.lock

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ packages:
2121
dependency: transitive
2222
description:
2323
name: characters
24-
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
24+
sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c
2525
url: "https://pub.dev"
2626
source: hosted
27-
version: "1.3.0"
27+
version: "1.2.1"
2828
clock:
2929
dependency: transitive
3030
description:
@@ -37,10 +37,10 @@ packages:
3737
dependency: transitive
3838
description:
3939
name: collection
40-
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
40+
sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0
4141
url: "https://pub.dev"
4242
source: hosted
43-
version: "1.17.1"
43+
version: "1.17.0"
4444
fake_async:
4545
dependency: transitive
4646
description:
@@ -83,18 +83,18 @@ packages:
8383
dependency: transitive
8484
description:
8585
name: intl
86-
sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6
86+
sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91"
8787
url: "https://pub.dev"
8888
source: hosted
89-
version: "0.18.0"
89+
version: "0.17.0"
9090
js:
9191
dependency: transitive
9292
description:
9393
name: js
94-
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
94+
sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
9595
url: "https://pub.dev"
9696
source: hosted
97-
version: "0.6.7"
97+
version: "0.6.5"
9898
lints:
9999
dependency: transitive
100100
description:
@@ -107,10 +107,10 @@ packages:
107107
dependency: transitive
108108
description:
109109
name: matcher
110-
sha256: c94db23593b89766cda57aab9ac311e3616cf87c6fa4e9749df032f66f30dcb8
110+
sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72"
111111
url: "https://pub.dev"
112112
source: hosted
113-
version: "0.12.14"
113+
version: "0.12.13"
114114
material_color_utilities:
115115
dependency: transitive
116116
description:
@@ -123,18 +123,18 @@ packages:
123123
dependency: transitive
124124
description:
125125
name: meta
126-
sha256: "12307e7f0605ce3da64cf0db90e5fcab0869f3ca03f76be6bb2991ce0a55e82b"
126+
sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42"
127127
url: "https://pub.dev"
128128
source: hosted
129-
version: "1.9.0"
129+
version: "1.8.0"
130130
path:
131131
dependency: transitive
132132
description:
133133
name: path
134-
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
134+
sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b
135135
url: "https://pub.dev"
136136
source: hosted
137-
version: "1.8.3"
137+
version: "1.8.2"
138138
sky_engine:
139139
dependency: transitive
140140
description: flutter
@@ -184,10 +184,10 @@ packages:
184184
dependency: transitive
185185
description:
186186
name: test_api
187-
sha256: "6182294da5abf431177fccc1ee02401f6df30f766bc6130a0852c6b6d7ee6b2d"
187+
sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206
188188
url: "https://pub.dev"
189189
source: hosted
190-
version: "0.4.18"
190+
version: "0.4.16"
191191
vector_math:
192192
dependency: transitive
193193
description:

lib/l10n/intl_al.arb

Lines changed: 14 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,21 @@
11
{
2-
"@@last_modified": "2020-06-19T21:53:39.706877",
32
"@@locale": "sq",
4-
"requiredErrorText": "Kjo fushë nuk mund të jetë bosh.",
5-
"@requiredErrorText": {
6-
"description": "Error Text for required field",
7-
"type": "text",
8-
"placeholders": {}
9-
},
10-
"minErrorText": "Vlera duhet te jete me e madhe ose e barabarte me {min}.",
11-
"@minErrorText": {
12-
"description": "Error Text for required field",
13-
"type": "text",
14-
"placeholders": {
15-
"min": {}
16-
}
17-
},
18-
"minLengthErrorText": "Vlera duhet të ketë një gjatësi më të madhe ose të barabartë me {minLength}",
19-
"@minLengthErrorText": {
20-
"description": "Error Text for required field",
21-
"type": "text",
22-
"placeholders": {
23-
"minLength": {}
24-
}
25-
},
26-
"maxErrorText": "Vlera duhet të jetë më e vogël ose e barabartë me {max}",
27-
"@maxErrorText": {
28-
"description": "Error Text for required field",
29-
"type": "text",
30-
"placeholders": {
31-
"max": {}
32-
}
33-
},
34-
"maxLengthErrorText": "Vlera duhet të ketë një gjatësi më të vogël ose të barabartë me {maxLength}",
35-
"@maxLengthErrorText": {
36-
"description": "Error Text for required field",
37-
"type": "text",
38-
"placeholders": {
39-
"maxLength": {}
40-
}
41-
},
42-
"equalLengthErrorText": "Vlera duhet të ketë nje gjatësi të barabartë me {length}",
43-
"@equalLengthErrorText": {
44-
"description": "Error Text for required field",
45-
"type": "text",
46-
"placeholders": {
47-
"length": {}
48-
}
49-
},
3+
"creditCardErrorText": "Kjo fushë kërkon një numër të vlefshëm per karten e kreditit.",
4+
"dateStringErrorText": "Kjo fushë kërkon një date të vlefshme.",
505
"emailErrorText": "Kjo fushe kërkon një adresë e E-mail-i të vlefshëme.",
51-
"@emailErrorText": {
52-
"description": "Error Text for email field",
53-
"type": "text",
54-
"placeholders": {}
55-
},
56-
"integerErrorText": "Kjo fushe kërkon një numër të plotë të vlefshëm.",
57-
"@integerErrorText": {
58-
"description": "Error Text for integer validator",
59-
"type": "text",
60-
"placeholders": {}
61-
},
626
"equalErrorText": "Kjo vlerë duhet të jetë e barabartë me {value}.",
63-
"@equalErrorText": {
64-
"description": "Error Text for equal validator",
65-
"type": "text",
66-
"placeholders": {
67-
"value": {}
68-
}
69-
},
70-
"notEqualErrorText": "Kjo vlerë nuk duhet të jetë e barabartë me {value}.",
71-
"@notEqualErrorText": {
72-
"description": "Error Text for not-equal validator",
73-
"type": "text",
74-
"placeholders": {
75-
"value": {}
76-
}
77-
},
78-
"urlErrorText": "Kjo fushe kërkon një adresë URL të vlefshme.",
79-
"@urlErrorText": {
80-
"description": "Error Text for URL field",
81-
"type": "text",
82-
"placeholders": {}
83-
},
7+
"equalLengthErrorText": "Vlera duhet të ketë nje gjatësi të barabartë me {length}",
8+
"integerErrorText": "Kjo fushe kërkon një numër të plotë të vlefshëm.",
9+
"ipErrorText": "Kjo fushë kërkon një IP të vlefshme.",
8410
"matchErrorText": "Vlera nuk përputhet me shabllonin.",
85-
"@matchErrorText": {
86-
"description": "Error Text for pattern field",
87-
"type": "text",
88-
"placeholders": {}
89-
},
11+
"maxErrorText": "Vlera duhet të jetë më e vogël ose e barabartë me {max}",
12+
"maxLengthErrorText": "Vlera duhet të ketë një gjatësi më të vogël ose të barabartë me {maxLength}",
13+
"maxWordsCountErrorText": "Vlera duhet të ketë një numër fjalësh më të vogël ose të barabartë me {maxWordsCount}",
14+
"minErrorText": "Vlera duhet te jete me e madhe ose e barabarte me {min}.",
15+
"minLengthErrorText": "Vlera duhet të ketë një gjatësi më të madhe ose të barabartë me {minLength}",
16+
"minWordsCountErrorText": "Vlera duhet të ketë një numër fjalësh më të madh ose të barabartë me {minWordsCount}",
17+
"notEqualErrorText": "Kjo vlerë nuk duhet të jetë e barabartë me {value}.",
9018
"numericErrorText": "Vlera duhet të jetë numerike.",
91-
"@numericErrorText": {
92-
"description": "Error Text for numeric field",
93-
"type": "text",
94-
"placeholders": {}
95-
},
96-
"creditCardErrorText": "Kjo fushë kërkon një numër të vlefshëm per karten e kreditit.",
97-
"@creditCardErrorText": {
98-
"description": "Error Text for credit card field",
99-
"type": "text",
100-
"placeholders": {}
101-
},
102-
"ipErrorText": "Kjo fushë kërkon një IP të vlefshme.",
103-
"@ipErrorText": {
104-
"description": "Error Text for IP address field",
105-
"type": "text",
106-
"placeholders": {}
107-
},
108-
"dateStringErrorText": "Kjo fushë kërkon një date të vlefshme.",
109-
"@dateStringErrorText": {
110-
"description": "Error Text for date string field",
111-
"type": "text",
112-
"placeholders": {}
113-
}
19+
"requiredErrorText": "Kjo fushë nuk mund të jetë bosh.",
20+
"urlErrorText": "Kjo fushe kërkon një adresë URL të vlefshme."
11421
}

lib/l10n/intl_ar.arb

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
{
22
"@@locale": "ar",
3-
"requiredErrorText": "هذا الحقل يجب ملؤه.",
3+
"creditCardErrorText": "القيمة المدخلة لا تصلح كرقم بطاقة إئتمانية.",
4+
"dateStringErrorText": "هذا الحقل يتطلب تاريخا صالحا.",
5+
"emailErrorText": "هذا الحقل يتطلب عنوان بريد إلكتروني صالح.",
46
"equalErrorText": "يجب أن تكون القيمة المدخلة مساوية لـ {value}.",
5-
"notEqualErrorText": "يجب أن لا تكون القيمة المدخلة مساوية لـ {value}.",
6-
"minErrorText": "يجب أن لا تقل القيمة المدخلة عن {min}.",
7-
"minLengthErrorText": "يجب أن لا يقل طول القيمة المدخلة عن {minLength}.",
7+
"equalLengthErrorText": "يجب أن يكون طول القيمة يساوي {length}",
8+
"integerErrorText": "القيمة المدخلة ليست رقما صحيحا.",
9+
"ipErrorText": "هذا الحقل يتطلب عنوان IP صالح.",
10+
"matchErrorText": "القيمة المدخلة لا تطابق الصيغة المطلوبة.",
811
"maxErrorText": "يجب أن لا تزيد القيمة المدخلة عن {max}.",
912
"maxLengthErrorText": "يجب أن لا يزيد طول القيمة المدخلة عن {maxLength}.",
10-
"minWordsCountErrorText": "يجب أن لا يقل عدد الكلمات المدخلة عن {minWordsCount}.",
1113
"maxWordsCountErrorText": "يجب أن لا يزيد عدد الكلمات المدخلة عن {maxWordsCount}.",
12-
"emailErrorText": "هذا الحقل يتطلب عنوان بريد إلكتروني صالح.",
13-
"urlErrorText": "هذا الحقل يتطلب عنوان URL صالح.",
14-
"matchErrorText": "القيمة المدخلة لا تطابق الصيغة المطلوبة.",
14+
"minErrorText": "يجب أن لا تقل القيمة المدخلة عن {min}.",
15+
"minLengthErrorText": "يجب أن لا يقل طول القيمة المدخلة عن {minLength}.",
16+
"minWordsCountErrorText": "يجب أن لا يقل عدد الكلمات المدخلة عن {minWordsCount}.",
17+
"notEqualErrorText": "يجب أن لا تكون القيمة المدخلة مساوية لـ {value}.",
1518
"numericErrorText": "القيمة المدخلة ليست رقما.",
16-
"integerErrorText": "القيمة المدخلة ليست رقما صحيحا.",
17-
"creditCardErrorText": "القيمة المدخلة لا تصلح كرقم بطاقة إئتمانية.",
18-
"ipErrorText": "هذا الحقل يتطلب عنوان IP صالح.",
19-
"dateStringErrorText": "هذا الحقل يتطلب تاريخا صالحا."
19+
"requiredErrorText": "هذا الحقل يجب ملؤه.",
20+
"urlErrorText": "هذا الحقل يتطلب عنوان URL صالح."
2021
}

lib/l10n/intl_bn.arb

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
{
22
"@@locale": "bn",
3-
"requiredErrorText": "খালি রাখা যাবে না।",
3+
"creditCardErrorText": "বৈধ ক্রেডিট কার্ড নম্বর প্রয়োজন।",
4+
"dateStringErrorText": "একটি বৈধ তারিখ প্রয়োজন।",
5+
"emailErrorText": "একটি বৈধ ইমেল আইডি প্রয়োজন।",
46
"equalErrorText": "মান {value} সমান হতে হবে।",
5-
"notEqualErrorText": "মান {value} এর সমান হওয়া উচিত নয়।",
6-
"minErrorText": "মান অবশ্যই {min} এর থেকে বেশি বা সমান হতে হবে।",
7-
"minLengthErrorText": "মান অবশ্যই {minLength} এর চেয়ে বেশি বা সমান সংখ্যা হতে হবে।",
7+
"equalLengthErrorText": "Value must have a length equal to {length}",
8+
"integerErrorText": "মান অবশ্যই একটি পূর্ণসংখ্যা হতে হবে।",
9+
"ipErrorText": "একটি বৈধ আইপি এড্রেস প্রয়োজন।",
10+
"matchErrorText": "মান প্যাটার্নের সাথে মেলে না।",
811
"maxErrorText": "মান অবশ্যই {max} এর কম বা সমান হতে হবে।",
912
"maxLengthErrorText": "মান অবশ্যই {maxLength} এর থেকে কম বা সমান সংখ্যা হতে হবে।",
10-
"minWordsCountErrorText": "মান অবশ্যই একটি শব্দের গণনা থাকতে হবে {minWordsCount} এর চেয়ে বেশি বা সমান",
1113
"maxWordsCountErrorText": "মান অবশ্যই একটি শব্দের গণনা থাকতে হবে {maxWordsCount} এর চেয়ে কম বা সমান",
12-
"emailErrorText": "একটি বৈধ ইমেল আইডি প্রয়োজন।",
13-
"urlErrorText": "একটি বৈধ ওয়েব এড্রেস প্রয়োজন।",
14-
"matchErrorText": "মান প্যাটার্নের সাথে মেলে না।",
14+
"minErrorText": "মান অবশ্যই {min} এর থেকে বেশি বা সমান হতে হবে।",
15+
"minLengthErrorText": "মান অবশ্যই {minLength} এর চেয়ে বেশি বা সমান সংখ্যা হতে হবে।",
16+
"minWordsCountErrorText": "মান অবশ্যই একটি শব্দের গণনা থাকতে হবে {minWordsCount} এর চেয়ে বেশি বা সমান",
17+
"notEqualErrorText": "মান {value} এর সমান হওয়া উচিত নয়।",
1518
"numericErrorText": "মান অবশ্যই সংখ্যায় হতে হবে।",
16-
"integerErrorText": "মান অবশ্যই একটি পূর্ণসংখ্যা হতে হবে।",
17-
"creditCardErrorText": "বৈধ ক্রেডিট কার্ড নম্বর প্রয়োজন।",
18-
"ipErrorText": "একটি বৈধ আইপি এড্রেস প্রয়োজন।",
19-
"dateStringErrorText": "একটি বৈধ তারিখ প্রয়োজন।"
19+
"requiredErrorText": "খালি রাখা যাবে না।",
20+
"urlErrorText": "একটি বৈধ ওয়েব এড্রেস প্রয়োজন।"
2021
}

0 commit comments

Comments
 (0)