Skip to content

Commit 938b709

Browse files
authored
Portuguese language added (#626)
* portuguese language added * Added pt to isSupported function
1 parent 7b0018f commit 938b709

File tree

5 files changed

+144
-1
lines changed

5 files changed

+144
-1
lines changed

example/lib/main.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class MyApp extends StatelessWidget {
2727
Locale('en', ''),
2828
Locale('es', ''),
2929
Locale('fr', ''),
30+
Locale('pt', ''),
3031
],
3132
home: HomePage(),
3233
);

lib/l10n/intl_pt.arb

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"@@last_modified": "2020-06-19T21:53:39.706877",
3+
"requiredErrorText": "Este campo não pode ficar vazio.",
4+
"@requiredErrorText": {
5+
"description": "Error Text for required field",
6+
"type": "text",
7+
"placeholders": {}
8+
},
9+
"minErrorText": "O valor deve ser maior ou igual a {min}.",
10+
"@minErrorText": {
11+
"description": "Error Text for required field",
12+
"type": "text",
13+
"placeholders": {
14+
"min": {}
15+
}
16+
},
17+
"minLengthErrorText": "O valor deve ter um comprimento maior ou igual a {minLength}",
18+
"@minLengthErrorText": {
19+
"description": "Error Text for required field",
20+
"type": "text",
21+
"placeholders": {
22+
"minLength": {}
23+
}
24+
},
25+
"maxErrorText": "O valor deve ser menor ou igual a {max}",
26+
"@maxErrorText": {
27+
"description": "Error Text for required field",
28+
"type": "text",
29+
"placeholders": {
30+
"max": {}
31+
}
32+
},
33+
"maxLengthErrorText": "O valor deve ter um comprimento menor ou igual a {maxLength}",
34+
"@maxLengthErrorText": {
35+
"description": "Error Text for required field",
36+
"type": "text",
37+
"placeholders": {
38+
"maxLength": {}
39+
}
40+
},
41+
"emailErrorText": "Este campo requer um endereço de e-mail válido.",
42+
"@emailErrorText": {
43+
"description": "Error Text for email field",
44+
"type": "text",
45+
"placeholders": {}
46+
},
47+
"urlErrorText": "Este campo requer um endereço de URL válido.",
48+
"@urlErrorText": {
49+
"description": "Error Text for URL field",
50+
"type": "text",
51+
"placeholders": {}
52+
},
53+
"matchErrorText": "O valor não corresponde ao padrão.",
54+
"@matchErrorText": {
55+
"description": "Error Text for pattern field",
56+
"type": "text",
57+
"placeholders": {}
58+
},
59+
"numericErrorText": "O valor deve ser numérico.",
60+
"@numericErrorText": {
61+
"description": "Error Text for numeric field",
62+
"type": "text",
63+
"placeholders": {}
64+
},
65+
"creditCardErrorText": "Este campo requer um número de cartão de crédito válido.",
66+
"@creditCardErrorText": {
67+
"description": "Error Text for credit card field",
68+
"type": "text",
69+
"placeholders": {}
70+
},
71+
"ipErrorText": "Este campo requer um IP válido.",
72+
"@ipErrorText": {
73+
"description": "Error Text for IP address field",
74+
"type": "text",
75+
"placeholders": {}
76+
},
77+
"dateStringErrorText": "Este campo requer uma string de data válida.",
78+
"@dateStringErrorText": {
79+
"description": "Error Text for date string field",
80+
"type": "text",
81+
"placeholders": {}
82+
}
83+
}

lib/l10n/messages_all.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ import 'messages_en.dart' as messages_en;
1919
import 'messages_es.dart' as messages_es;
2020
import 'messages_fr.dart' as messages_fr;
2121
import 'messages_messages.dart' as messages_messages;
22+
import 'messages_pt.dart' as messages_pt;
2223

2324
typedef Future<dynamic> LibraryLoader();
2425
Map<String, LibraryLoader> _deferredLibraries = {
2526
'en': () => new Future.value(null),
2627
'es': () => new Future.value(null),
2728
'fr': () => new Future.value(null),
2829
'messages': () => new Future.value(null),
30+
'pt': () => new Future.value(null),
2931
};
3032

3133
MessageLookupByLibrary _findExact(String localeName) {
@@ -38,6 +40,8 @@ MessageLookupByLibrary _findExact(String localeName) {
3840
return messages_fr.messages;
3941
case 'messages':
4042
return messages_messages.messages;
43+
case 'pt':
44+
return messages_pt.messages;
4145
default:
4246
return null;
4347
}

lib/l10n/messages_pt.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 pt 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 => 'pt';
21+
22+
static m0(max) => "O valor deve ser menor ou igual a ${max}";
23+
24+
static m1(maxLength) =>
25+
"O valor deve ter um comprimento menor ou igual a ${maxLength}";
26+
27+
static m2(min) => "O valor deve ser maior ou igual a ${min}.";
28+
29+
static m3(minLength) =>
30+
"O valor deve ter um comprimento maior ou igual a ${minLength}";
31+
32+
final messages = _notInlinedMessages(_notInlinedMessages);
33+
static _notInlinedMessages(_) => <String, Function>{
34+
"creditCardErrorText": MessageLookupByLibrary.simpleMessage(
35+
"Este campo requer um número de cartão de crédito válido."),
36+
"dateStringErrorText": MessageLookupByLibrary.simpleMessage(
37+
"Este campo requer uma string de data válida."),
38+
"emailErrorText": MessageLookupByLibrary.simpleMessage(
39+
"Este campo requer um endereço de e-mail válido."),
40+
"ipErrorText": MessageLookupByLibrary.simpleMessage(
41+
"Este campo requer um IP válido."),
42+
"matchErrorText": MessageLookupByLibrary.simpleMessage(
43+
"O valor não corresponde ao padrão."),
44+
"maxErrorText": m0,
45+
"maxLengthErrorText": m1,
46+
"minErrorText": m2,
47+
"minLengthErrorText": m3,
48+
"numericErrorText":
49+
MessageLookupByLibrary.simpleMessage("O valor deve ser numérico."),
50+
"requiredErrorText": MessageLookupByLibrary.simpleMessage(
51+
"Este campo não pode ficar vazio."),
52+
"urlErrorText": MessageLookupByLibrary.simpleMessage(
53+
"Este campo requer um endereço de URL válido.")
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 ['en', 'es', 'fr'].contains(locale.languageCode);
138+
return ['en', 'es', 'fr', 'pt'].contains(locale.languageCode);
139139
}
140140

141141
@override

0 commit comments

Comments
 (0)