Skip to content

Commit ef2686b

Browse files
authored
Persian/Farsi language support added (#864)
1 parent 162fce8 commit ef2686b

File tree

5 files changed

+166
-1
lines changed

5 files changed

+166
-1
lines changed

example/lib/main.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class MyApp extends StatelessWidget {
2626
supportedLocales: [
2727
Locale('en', ''),
2828
Locale('es', ''),
29+
Locale('fa', ''),
2930
Locale('fr', ''),
3031
Locale('ja', ''),
3132
Locale('pt', ''),

lib/l10n/intl_fa.arb

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
{
2+
"@@last_modified": "2020-06-19T21:53:39.706877",
3+
"requiredErrorText": "این ورودی نمی تواند خالی باشد.",
4+
"@requiredErrorText": {
5+
"description": "Error Text for required field",
6+
"type": "text",
7+
"placeholders": {}
8+
},
9+
"minErrorText": "مقدار باید برابر یا بیشتر از {min} باشد.",
10+
"@minErrorText": {
11+
"description": "Error Text for required field",
12+
"type": "text",
13+
"placeholders": {
14+
"min": {}
15+
}
16+
},
17+
"minLengthErrorText": "مقدار باید دارای طول بزرگتر یا برابر {minLength} باشد.",
18+
"@minLengthErrorText": {
19+
"description": "Error Text for required field",
20+
"type": "text",
21+
"placeholders": {
22+
"minLength": {}
23+
}
24+
},
25+
"maxErrorText": "مقدار باید برابر یا کمتر از {max} باشد.",
26+
"@maxErrorText": {
27+
"description": "Error Text for required field",
28+
"type": "text",
29+
"placeholders": {
30+
"max": {}
31+
}
32+
},
33+
"maxLengthErrorText": "مقدار باید دارای طول بزرگتر یا برابر {maxLength} باشد.",
34+
"@maxLengthErrorText": {
35+
"description": "Error Text for required field",
36+
"type": "text",
37+
"placeholders": {
38+
"maxLength": {}
39+
}
40+
},
41+
"emailErrorText": "این ورودی به یک آدرس ایمیل معتبر نیاز دارد.",
42+
"@emailErrorText": {
43+
"description": "Error Text for email field",
44+
"type": "text",
45+
"placeholders": {}
46+
},
47+
"integerErrorText": "این ورودی به یک عدد صحیح معتبر نیاز دارد.",
48+
"@integerErrorText": {
49+
"description": "Error Text for integer validator",
50+
"type": "text",
51+
"placeholders": {}
52+
},
53+
"equalErrorText": "مقدار این ورودی باید برابر با {value} باشد.",
54+
"@equalErrorText": {
55+
"description": "Error Text for equal validator",
56+
"type": "text",
57+
"placeholders": {
58+
"value": {}
59+
}
60+
},
61+
"notEqualErrorText": "مقدار این ورودی نباید برابر با {value} باشد.",
62+
"@notEqualErrorText": {
63+
"description": "Error Text for not-equal validator",
64+
"type": "text",
65+
"placeholders": {
66+
"value": {}
67+
}
68+
},
69+
"urlErrorText": "این ورودی به آدرس اینترنتی معتبر نیاز دارد.",
70+
"@urlErrorText": {
71+
"description": "Error Text for URL field",
72+
"type": "text",
73+
"placeholders": {}
74+
},
75+
"matchErrorText": "مقدار با الگو مطابقت ندارد.",
76+
"@matchErrorText": {
77+
"description": "Error Text for pattern field",
78+
"type": "text",
79+
"placeholders": {}
80+
},
81+
"numericErrorText": "مقدار باید عددی باشد.",
82+
"@numericErrorText": {
83+
"description": "Error Text for numeric field",
84+
"type": "text",
85+
"placeholders": {}
86+
},
87+
"creditCardErrorText": "این ورودی به شماره کارت اعتباری معتبر نیاز دارد.",
88+
"@creditCardErrorText": {
89+
"description": "Error Text for credit card field",
90+
"type": "text",
91+
"placeholders": {}
92+
},
93+
"ipErrorText": "این قسمت نیاز به یک IP معتبر دارد.",
94+
"@ipErrorText": {
95+
"description": "Error Text for IP address field",
96+
"type": "text",
97+
"placeholders": {}
98+
},
99+
"dateStringErrorText": "این ورودی به یک تاریخ معتبر نیاز دارد.",
100+
"@dateStringErrorText": {
101+
"description": "Error Text for date string field",
102+
"type": "text",
103+
"placeholders": {}
104+
}
105+
}

lib/l10n/messages_all.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import 'package:intl/src/intl_helpers.dart';
1818
import 'messages_de.dart' as messages_de;
1919
import 'messages_en.dart' as messages_en;
2020
import 'messages_es.dart' as messages_es;
21+
import 'messages_fa.dart' as messages_fa;
2122
import 'messages_fr.dart' as messages_fr;
2223
import 'messages_it.dart' as messages_it;
2324
import 'messages_ja.dart' as messages_ja;
@@ -32,6 +33,7 @@ Map<String, LibraryLoader> _deferredLibraries = {
3233
'de': () => new Future.value(null),
3334
'en': () => new Future.value(null),
3435
'es': () => new Future.value(null),
36+
'fa': () => new Future.value(null),
3537
'fr': () => new Future.value(null),
3638
'it': () => new Future.value(null),
3739
'ja': () => new Future.value(null),
@@ -50,6 +52,8 @@ MessageLookupByLibrary? _findExact(String localeName) {
5052
return messages_en.messages;
5153
case 'es':
5254
return messages_es.messages;
55+
case 'fa':
56+
return messages_fa.messages;
5357
case 'fr':
5458
return messages_fr.messages;
5559
case 'it':

lib/l10n/messages_fa.dart

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
2+
// This is a library that provides messages for a en 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
11+
12+
import 'package:intl/intl.dart';
13+
import 'package:intl/message_lookup_by_library.dart';
14+
15+
final messages = new MessageLookup();
16+
17+
typedef String MessageIfAbsent(String messageStr, List<dynamic> args);
18+
19+
class MessageLookup extends MessageLookupByLibrary {
20+
String get localeName => 'fa';
21+
22+
static m1(max) => "مقدار باید برابر یا کمتر از ${max} باشد.";
23+
24+
static m2(maxLength) =>
25+
"مقدار باید دارای طول بزرگتر یا برابر ${maxLength} باشد.";
26+
27+
static m3(min) => "مقدار باید برابر یا بیشتر از ${min} باشد.";
28+
29+
static m4(minLength) =>
30+
"مقدار باید دارای طول بزرگتر یا برابر {minLength} باشد.";
31+
32+
final messages = _notInlinedMessages(_notInlinedMessages);
33+
static _notInlinedMessages(_) => <String, Function>{
34+
"creditCardErrorText": MessageLookupByLibrary.simpleMessage(
35+
"این ورودی به شماره کارت اعتباری معتبر نیاز دارد."),
36+
"dateStringErrorText": MessageLookupByLibrary.simpleMessage(
37+
"این ورودی به یک تاریخ معتبر نیاز دارد."),
38+
"emailErrorText": MessageLookupByLibrary.simpleMessage(
39+
"این ورودی به یک آدرس ایمیل معتبر نیاز دارد."),
40+
"ipErrorText": MessageLookupByLibrary.simpleMessage(
41+
"این قسمت نیاز به یک IP معتبر دارد."),
42+
"matchErrorText":
43+
MessageLookupByLibrary.simpleMessage("مقدار با الگو مطابقت ندارد."),
44+
"maxErrorText": m1,
45+
"maxLengthErrorText": m2,
46+
"minErrorText": m3,
47+
"minLengthErrorText": m4,
48+
"numericErrorText":
49+
MessageLookupByLibrary.simpleMessage("مقدار باید عددی باشد."),
50+
"requiredErrorText": MessageLookupByLibrary.simpleMessage(
51+
"این ورودی نمی تواند خالی باشد."),
52+
"urlErrorText": MessageLookupByLibrary.simpleMessage(
53+
"این ورودی به آدرس اینترنتی معتبر نیاز دارد.")
54+
};
55+
}

lib/localization/form_builder_localizations.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class _FormBuilderLocalizationsDelegate
135135

136136
@override
137137
bool isSupported(Locale locale) {
138-
return ['de', 'en', 'es', 'fr', 'hu', 'it', 'ja', 'pt', 'sk', 'pl', 'ar']
138+
return ['de', 'en', 'es', 'fa', 'fr', 'hu', 'it', 'ja', 'pt', 'sk', 'pl', 'ar']
139139
.contains(locale.languageCode);
140140
}
141141

0 commit comments

Comments
 (0)