Skip to content

Commit 3f917b9

Browse files
Merge pull request #40 from aballaci/main
added localisation for Albanian (al)
2 parents 327faa5 + c68e0c4 commit 3f917b9

File tree

4 files changed

+187
-1
lines changed

4 files changed

+187
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Available built-in validators include:
6464

6565
Validators support default errorText messages in this languages:
6666

67+
- Albanian (al)
6768
- Arabic (ar)
6869
- Bangla (bn)
6970
- Bosnian (bs)

lib/l10n/intl_al.arb

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
{
2+
"@@last_modified": "2020-06-19T21:53:39.706877",
3+
"@@locale": "en",
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+
},
50+
"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+
},
62+
"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+
},
84+
"matchErrorText": "Vlera nuk përputhet me shabllonin.",
85+
"@matchErrorText": {
86+
"description": "Error Text for pattern field",
87+
"type": "text",
88+
"placeholders": {}
89+
},
90+
"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+
}
114+
}

lib/localization/intl/messages.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import 'package:flutter/widgets.dart';
55
import 'package:flutter_localizations/flutter_localizations.dart';
66
import 'package:intl/intl.dart' as intl;
77

8+
import 'messages_al.dart';
89
import 'messages_ar.dart';
910
import 'messages_bn.dart';
1011
import 'messages_bs.dart';
@@ -123,6 +124,7 @@ abstract class FormBuilderLocalizationsImpl {
123124

124125
/// A list of this localizations delegate's supported locales.
125126
static const List<Locale> supportedLocales = <Locale>[
127+
Locale('al'),
126128
Locale('ar'),
127129
Locale('bn'),
128130
Locale('bs'),
@@ -268,7 +270,7 @@ class _FormBuilderLocalizationsImplDelegate extends LocalizationsDelegate<FormBu
268270
}
269271

270272
@override
271-
bool isSupported(Locale locale) => <String>['ar', 'bn', 'bs', 'ca', 'cs', 'de', 'el', 'en', 'es', 'et', 'fa', 'fr', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'lo', 'mn', 'ms', 'my', 'nl', 'ne', 'pl', 'pt', 'ro', 'ru', 'sk', 'sl', 'sw', 'ta', 'th', 'tr', 'uk', 'zh'].contains(locale.languageCode);
273+
bool isSupported(Locale locale) => <String>['al','ar', 'bn', 'bs', 'ca', 'cs', 'de', 'el', 'en', 'es', 'et', 'fa', 'fr', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'lo', 'mn', 'ms', 'my', 'nl', 'ne', 'pl', 'pt', 'ro', 'ru', 'sk', 'sl', 'sw', 'ta', 'th', 'tr', 'uk', 'zh'].contains(locale.languageCode);
272274

273275
@override
274276
bool shouldReload(_FormBuilderLocalizationsImplDelegate old) => false;
@@ -288,6 +290,7 @@ FormBuilderLocalizationsImpl lookupFormBuilderLocalizationsImpl(Locale locale) {
288290

289291
// Lookup logic when only language code is specified.
290292
switch (locale.languageCode) {
293+
case 'al': return FormBuilderLocalizationsImplAl();
291294
case 'ar': return FormBuilderLocalizationsImplAr();
292295
case 'bn': return FormBuilderLocalizationsImplBn();
293296
case 'bs': return FormBuilderLocalizationsImplBs();
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import 'messages.dart';
2+
3+
/// The translations for Albanian (`al`).
4+
class FormBuilderLocalizationsImplAl extends FormBuilderLocalizationsImpl {
5+
FormBuilderLocalizationsImplAl([String locale = 'al']) : super(locale);
6+
7+
@override
8+
String get requiredErrorText => 'Kjo fushë nuk mund të jetë bosh.';
9+
10+
@override
11+
String minErrorText(Object min) {
12+
return 'Vlera duhet te jete me e madhe ose e barabarte me $min.';
13+
}
14+
15+
@override
16+
String minLengthErrorText(Object minLength) {
17+
return 'Vlera duhet të ketë një gjatësi më të madhe ose të barabartë me $minLength';
18+
}
19+
20+
@override
21+
String maxErrorText(Object max) {
22+
return 'Vlera duhet të jetë më e vogël ose e barabartë me $max';
23+
}
24+
25+
@override
26+
String maxLengthErrorText(Object maxLength) {
27+
return 'Vlera duhet të ketë një gjatësi më të vogël ose të barabartë me $maxLength';
28+
}
29+
30+
@override
31+
String equalLengthErrorText(Object length) {
32+
return 'Vlera duhet të ketë nje gjatësi të barabartë me $length';
33+
}
34+
35+
@override
36+
String get emailErrorText => 'Kjo fushe kërkon një adresë e E-mail-i të vlefshëme.';
37+
38+
@override
39+
String get integerErrorText => 'Kjo fushe kërkon një numër të plotë të vlefshëm.';
40+
41+
@override
42+
String equalErrorText(Object value) {
43+
return 'Kjo vlerë duhet të jetë e barabartë me $value.';
44+
}
45+
46+
@override
47+
String notEqualErrorText(Object value) {
48+
return 'Kjo vlerë nuk duhet të jetë e barabartë me $value.';
49+
}
50+
51+
@override
52+
String get urlErrorText => 'Kjo fushe kërkon një adresë URL të vlefshme.';
53+
54+
@override
55+
String get matchErrorText => 'Vlera nuk përputhet me shabllonin.';
56+
57+
@override
58+
String get numericErrorText => 'Vlera duhet të jetë numerike.';
59+
60+
@override
61+
String get creditCardErrorText => 'Kjo fushë kërkon një numër të vlefshëm per karten e kreditit.';
62+
63+
@override
64+
String get ipErrorText => 'Kjo fushë kërkon një IP të vlefshme.';
65+
66+
@override
67+
String get dateStringErrorText => 'Kjo fushë kërkon një date të vlefshme.';
68+
}

0 commit comments

Comments
 (0)