Skip to content

Commit 18fa126

Browse files
Merge pull request #99 from martijn00/ci
Update CI
2 parents 9ef1aa0 + ec14a43 commit 18fa126

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+144
-3869
lines changed

.github/workflows/base.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,21 @@ jobs:
3535
cache: true
3636

3737
- name: Install dependencies
38-
run: flutter pub get
38+
run: dart pub get
3939

4040
- name: Run l10n
4141
run: flutter gen-l10n
4242

43+
- name: Run l10n on example
44+
run: |
45+
cd example
46+
flutter gen-l10n
47+
4348
- name: Format code
44-
run: dart format --set-exit-if-changed $(find . -name "*.dart" -not -wholename "./lib/localization/intl/*")
49+
run: dart format --set-exit-if-changed $(find . -name "*.dart" ! \( -wholename "./lib/localization/intl/*" -or -wholename "./example/lib/localization/intl/*" \))
4550

4651
- name: Analyze static code
47-
run: flutter analyze
52+
run: dart analyze
4853

4954
- name: Run tests
5055
run: flutter test
@@ -85,6 +90,9 @@ jobs:
8590
# use the build-in cache from Subosito
8691
cache: true
8792

93+
- name: Install dependencies
94+
run: dart pub get
95+
8896
- name: Run l10n
8997
run: flutter gen-l10n
9098

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,5 @@ pubspec.lock
7575
!**/ios/**/default.pbxuser
7676
!**/ios/**/default.perspectivev3
7777

78+
# L10n files
79+
**/intl

.pubignore

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
.fvm/
12+
13+
# IntelliJ related
14+
*.iml
15+
*.ipr
16+
*.iws
17+
.idea/
18+
19+
# The .vscode folder contains launch configuration and tasks you configure in
20+
# VS Code which you may wish to be included in version control, so this line
21+
# is commented out by default.
22+
#.vscode/
23+
24+
# Flutter/Dart/Pub related
25+
**/doc/api/
26+
.dart_tool/
27+
.flutter-plugins
28+
.flutter-plugins-dependencies
29+
.packages
30+
.pub-cache/
31+
.pub/
32+
build/
33+
pubspec.lock
34+
35+
# Android related
36+
**/android/**/gradle-wrapper.jar
37+
**/android/.gradle
38+
**/android/captures/
39+
**/android/gradlew
40+
**/android/gradlew.bat
41+
**/android/local.properties
42+
**/android/**/GeneratedPluginRegistrant.java
43+
44+
# iOS/XCode related
45+
**/ios/**/*.mode1v3
46+
**/ios/**/*.mode2v3
47+
**/ios/**/*.moved-aside
48+
**/ios/**/*.pbxuser
49+
**/ios/**/*.perspectivev3
50+
**/ios/**/*sync/
51+
**/ios/**/.sconsign.dblite
52+
**/ios/**/.tags*
53+
**/ios/**/.vagrant/
54+
**/ios/**/DerivedData/
55+
**/ios/**/Icon?
56+
**/ios/**/Pods/
57+
**/ios/**/.symlinks/
58+
**/ios/**/profile
59+
**/ios/**/xcuserdata
60+
**/ios/.generated/
61+
**/ios/Flutter/App.framework
62+
**/ios/Flutter/Flutter.framework
63+
**/ios/Flutter/Flutter.podspec
64+
**/ios/Flutter/Generated.xcconfig
65+
**/ios/Flutter/app.flx
66+
**/ios/Flutter/app.zip
67+
**/ios/Flutter/flutter_assets/
68+
**/ios/Flutter/flutter_export_environment.sh
69+
**/ios/ServiceDefinitions.json
70+
**/ios/Runner/GeneratedPluginRegistrant.*
71+
72+
# Exceptions to above rules.
73+
!**/ios/**/default.mode1v3
74+
!**/ios/**/default.mode2v3
75+
!**/ios/**/default.pbxuser
76+
!**/ios/**/default.perspectivev3
77+

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 10.0.2
2+
* Reland generated l10n files
3+
* Add Bulgarian
4+
15
## 10.0.1
26
* Fix regression (include l10n files)
37

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ Validators support default `errorText` messages in these languages:
7474
- Arabic (ar)
7575
- Bangla (bn)
7676
- Bosnian (bs)
77+
- Bulgarian (bg)
7778
- Catalan (ca)
7879
- Chinese Simplified (zh_Hans)
7980
- Chinese Traditional (zh_Hant)
@@ -97,7 +98,7 @@ Validators support default `errorText` messages in these languages:
9798
- Lao (lo)
9899
- Malay (ms)
99100
- Mongolian (mn)
100-
- Norwegian
101+
- Norwegian (no)
101102
- Polish (pl)
102103
- Portuguese (pt)
103104
- Romanian (ro)

example/l10n.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# https://docs.flutter.dev/development/accessibility-and-localization/internationalization#adding-your-own-localized-messages
2+
# https://docs.google.com/document/d/10e0saTfAv32OZLRmONy866vnaw0I2jwL8zukykpgWBc
3+
arb-dir: lib/l10n
4+
template-arb-file: app_en.arb
5+
synthetic-package: false
6+
output-dir: lib/localization/intl
7+
output-localization-file: app_localizations.dart
8+
output-class: AppLocalizations
9+
nullable-getter: false
10+
#untranslated-messages-file: build/untranslated-messages.txt

example/lib/l10n.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import 'package:flutter/material.dart';
2+
3+
import 'localization/intl/app_localizations.dart';
4+
5+
/// Extension for the app localization.
6+
extension AppLocalizationsExtensions on BuildContext {
7+
/// Get the L10n localization.
8+
AppLocalizations get l10n => AppLocalizations.of(this);
9+
}

example/lib/l10n/app_en.arb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"@@locale": "en"
3+
}

example/lib/main.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'package:flutter_localizations/flutter_localizations.dart';
33
import 'package:form_builder_validators/form_builder_validators.dart';
44

55
import 'home_page.dart';
6+
import 'localization/intl/app_localizations.dart';
67
import 'override_form_builder_localizations_en.dart';
78

89
void main() {
@@ -18,12 +19,11 @@ class MyApp extends StatelessWidget {
1819
title: 'Form Builder Validators Demo',
1920
theme: ThemeData(primarySwatch: Colors.blue),
2021
home: const HomePage(),
21-
supportedLocales: const [
22-
...FormBuilderLocalizations.supportedLocales,
23-
],
22+
supportedLocales: AppLocalizations.supportedLocales,
2423
localizationsDelegates: const [
2524
...GlobalMaterialLocalizations.delegates,
2625
// Placed in front of `FormBuilderLocalizations.delegate`
26+
...AppLocalizations.localizationsDelegates,
2727
OverrideFormBuilderLocalizationsEn.delegate,
2828
FormBuilderLocalizations.delegate,
2929
],

example/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ dev_dependencies:
2222

2323
flutter:
2424
uses-material-design: true
25+
generate: true

0 commit comments

Comments
 (0)