Skip to content

Commit a5eea05

Browse files
Japanese (ja) added. (#643)
* Adding Japanese (ja) localisation. * Fixing the switch * Update messages_all.dart Co-authored-by: Danvick Miller <[email protected]>
1 parent 938b709 commit a5eea05

File tree

5 files changed

+171
-1
lines changed

5 files changed

+171
-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('ja', ''),
3031
Locale('pt', ''),
3132
],
3233
home: HomePage(),

lib/l10n/intl_ja.arb

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
{
2+
"@@last_modified": "2020-12-10T13:55:09.562241",
3+
"@@locale": "ja",
4+
"requiredErrorText": "必須項目です。",
5+
"@requiredErrorText": {
6+
"description": "Error Text for required validator",
7+
"type": "text",
8+
"placeholders": {}
9+
},
10+
"equalErrorText": "{value}に一致していません。",
11+
"@equalErrorText": {
12+
"description": "Error Text for equal validator",
13+
"type": "text",
14+
"placeholders": {
15+
"value": {}
16+
}
17+
},
18+
"notEqualErrorText": "{value}と違うものにしてください。",
19+
"@notEqualErrorText": {
20+
"description": "Error Text for not-equal validator",
21+
"type": "text",
22+
"placeholders": {
23+
"value": {}
24+
}
25+
},
26+
"minErrorText": "{min}以上にしてください。",
27+
"@minErrorText": {
28+
"description": "Error Text for required field",
29+
"type": "text",
30+
"placeholders": {
31+
"min": {}
32+
}
33+
},
34+
"minLengthErrorText": "{minLength}文字以上で入力してください。",
35+
"@minLengthErrorText": {
36+
"description": "Error Text for minLength validator",
37+
"type": "text",
38+
"placeholders": {
39+
"minLength": {}
40+
}
41+
},
42+
"maxErrorText": "{max}以下にしてください。",
43+
"@maxErrorText": {
44+
"description": "Error Text for max validator",
45+
"type": "text",
46+
"placeholders": {
47+
"max": {}
48+
}
49+
},
50+
"maxLengthErrorText": "{maxLength}文字以下で入力してください。",
51+
"@maxLengthErrorText": {
52+
"description": "Error Text for required field",
53+
"type": "text",
54+
"placeholders": {
55+
"maxLength": {}
56+
}
57+
},
58+
"emailErrorText": "有効なメールアドレスを入力してください。",
59+
"@emailErrorText": {
60+
"description": "Error Text for email validator",
61+
"type": "text",
62+
"placeholders": {}
63+
},
64+
"urlErrorText": "有効なURLを入力してください。",
65+
"@urlErrorText": {
66+
"description": "Error Text for URL validator",
67+
"type": "text",
68+
"placeholders": {}
69+
},
70+
"matchErrorText": "有効な正規表現を指定してください。",
71+
"@matchErrorText": {
72+
"description": "Error Text for pattern validator",
73+
"type": "text",
74+
"placeholders": {}
75+
},
76+
"numericErrorText": "半角数字で入力してください。",
77+
"@numericErrorText": {
78+
"description": "Error Text for numeric validator",
79+
"type": "text",
80+
"placeholders": {}
81+
},
82+
"integerErrorText": "整数で入力してください。",
83+
"@integerErrorText": {
84+
"description": "Error Text for integer validator",
85+
"type": "text",
86+
"placeholders": {}
87+
},
88+
"creditCardErrorText": "有効なクレジットカード番号を入力してください。",
89+
"@creditCardErrorText": {
90+
"description": "Error Text for credit card validator",
91+
"type": "text",
92+
"placeholders": {}
93+
},
94+
"ipErrorText": "有効なIPアドレスを入力してください。",
95+
"@ipErrorText": {
96+
"description": "Error Text for IP address validator",
97+
"type": "text",
98+
"placeholders": {}
99+
},
100+
"dateStringErrorText": "正しい日付を入力してください。",
101+
"@dateStringErrorText": {
102+
"description": "Error Text for date string validator",
103+
"type": "text",
104+
"placeholders": {}
105+
}
106+
}

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_en.dart' as messages_en;
1919
import 'messages_es.dart' as messages_es;
2020
import 'messages_fr.dart' as messages_fr;
21+
import 'messages_ja.dart' as messages_ja;
2122
import 'messages_messages.dart' as messages_messages;
2223
import 'messages_pt.dart' as messages_pt;
2324

@@ -26,6 +27,7 @@ Map<String, LibraryLoader> _deferredLibraries = {
2627
'en': () => new Future.value(null),
2728
'es': () => new Future.value(null),
2829
'fr': () => new Future.value(null),
30+
'ja': () => new Future.value(null),
2931
'messages': () => new Future.value(null),
3032
'pt': () => new Future.value(null),
3133
};
@@ -38,6 +40,8 @@ MessageLookupByLibrary _findExact(String localeName) {
3840
return messages_es.messages;
3941
case 'fr':
4042
return messages_fr.messages;
43+
case 'ja':
44+
return messages_ja.messages;
4145
case 'messages':
4246
return messages_messages.messages;
4347
case 'pt':

lib/l10n/messages_ja.dart

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
2+
// This is a library that provides messages for a ja 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 => 'ja';
21+
22+
static m0(value) => "${value}に一致していません。";
23+
24+
static m1(max) => "${max}以下にしてください。";
25+
26+
static m2(maxLength) => "${maxLength}文字以下で入力してください。";
27+
28+
static m3(min) => "${min}以上にしてください。";
29+
30+
static m4(minLength) => "${minLength}文字以上で入力してください。";
31+
32+
static m5(value) => "${value}と違うものにしてください。";
33+
34+
final messages = _notInlinedMessages(_notInlinedMessages);
35+
static _notInlinedMessages(_) => <String, Function>{
36+
"creditCardErrorText":
37+
MessageLookupByLibrary.simpleMessage("有効なクレジットカード番号を入力してください。"),
38+
"dateStringErrorText":
39+
MessageLookupByLibrary.simpleMessage("正しい日付を入力してください。"),
40+
"emailErrorText":
41+
MessageLookupByLibrary.simpleMessage("有効なメールアドレスを入力してください。"),
42+
"equalErrorText": m0,
43+
"integerErrorText":
44+
MessageLookupByLibrary.simpleMessage("整数で入力してください。"),
45+
"ipErrorText":
46+
MessageLookupByLibrary.simpleMessage("有効なIPアドレスを入力してください。"),
47+
"matchErrorText":
48+
MessageLookupByLibrary.simpleMessage("有効な正規表現を指定してください。"),
49+
"maxErrorText": m1,
50+
"maxLengthErrorText": m2,
51+
"minErrorText": m3,
52+
"minLengthErrorText": m4,
53+
"notEqualErrorText": m5,
54+
"numericErrorText":
55+
MessageLookupByLibrary.simpleMessage("半角数字で入力してください。"),
56+
"requiredErrorText": MessageLookupByLibrary.simpleMessage("必須項目です。"),
57+
"urlErrorText": MessageLookupByLibrary.simpleMessage("有効なURLを入力してください。")
58+
};
59+
}

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', 'pt'].contains(locale.languageCode);
138+
return ['en', 'es', 'fr', 'ja', 'pt'].contains(locale.languageCode);
139139
}
140140

141141
@override

0 commit comments

Comments
 (0)