Skip to content

Commit a4c5959

Browse files
authored
Merge pull request #19 from Fasuh/polish-translation
add polish translation
2 parents 91e680b + e027a18 commit a4c5959

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

lib/src/i18n/all.dart

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'package:form_validator/src/i18n/pl.dart';
2+
13
import '../form_validator_locale.dart';
24
import 'az.dart';
35
import 'de.dart';
@@ -32,6 +34,9 @@ FormValidatorLocale createLocale(String locale) {
3234
case 'pt-br':
3335
return LocalePtBr();
3436

37+
case 'pl':
38+
return LocalePl();
39+
3540
case 'zh-CN':
3641
return LocaleZhCN();
3742

@@ -40,7 +45,6 @@ FormValidatorLocale createLocale(String locale) {
4045
return LocaleEn();
4146

4247
default:
43-
throw ArgumentError.value(
44-
locale, 'locale', 'Form validation locale is not available.');
48+
throw ArgumentError.value(locale, 'locale', 'Form validation locale is not available.');
4549
}
4650
}

lib/src/i18n/pl.dart

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import '../form_validator_locale.dart';
2+
3+
class LocalePl extends FormValidatorLocale {
4+
@override
5+
String name() => 'pl';
6+
7+
@override
8+
String minLength(String v, int n) => 'Minimalna ilość znaków to $n';
9+
10+
@override
11+
String maxLength(String v, int n) => 'Maksymalna ilość znaków to $n';
12+
13+
@override
14+
String email(String v) => 'Adres Email jest niepoprawny';
15+
16+
@override
17+
String phoneNumber(String v) => 'Numer telefonu jest niepoprawny';
18+
19+
@override
20+
String required() => 'To pole jest wymagane';
21+
22+
@override
23+
String ip(String v) => 'adres IP jest niepoprawny';
24+
25+
@override
26+
String ipv6(String v) => 'adres IPv6 jest niepoprawny';
27+
28+
@override
29+
String url(String v) => 'adres URL jest niepoprawny';
30+
}

0 commit comments

Comments
 (0)